Text this: Resource scheduling based on routing tree and detection matrix for Internet of things