An Internet of Things data collection method based on collection mask bitmap and collection sequence number rearrangement, electronic equipment and medium
By using acquisition mask bitmap and sequence number rearrangement technology in the LoRa TDMA system, the problems of time slot resource waste and frequency conflict in selective acquisition scenarios are solved, and more efficient wireless resource utilization and data acquisition are achieved.
Patent Information
- Application Number
- CN202611179403.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-05
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2046-08-05
AI Technical Summary
In LoRa TDMA acquisition systems, under selective acquisition scenarios, existing solutions lead to a high risk of wasted time slot resources and frequency conflicts, making it impossible to effectively utilize wireless resources.
A method based on the acquisition mask bitmap and acquisition sequence number rearrangement is adopted. The acquisition mask bitmap is generated to determine the participating acquisition devices, and they are rearranged into consecutive acquisition sequence numbers for time slot and channel allocation, thereby reducing idle time slots and reducing the risk of frequency point conflict.
It improves the utilization rate of time slots and wireless resources, reduces the risk of frequency point conflicts within the same time slot and cross-time slot interference, and achieves more efficient data acquisition.
Smart Images

Figure CN122679493B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet of Things (IoT) wireless communication technology, and in particular to an IoT data acquisition method, electronic device, and medium based on the rearrangement of acquisition mask bitmap and acquisition sequence number, suitable for LoRa TDMA scenarios. Background Technology
[0002] In a LoRa TDMA data acquisition system, a single gateway manages at least one physical group, and each physical group includes multiple devices. When devices within a group report acquired data, the data must be transmitted in an orderly manner according to predetermined rules.
[0003] In large-scale IoT network data collection scenarios, when only selective data collection is required for a subset of devices within the group, existing solutions typically still allocate time slots based on the fixed serial numbers of the devices. This results in time slots for devices not participating in the collection remaining idle, leading to wasted time slot resources and an increase in overall collection time. Furthermore, if channel allocation is still based on fixed device serial numbers when only some devices participate in the collection, the mapping distribution of participating devices across time slots and frequencies may not be compact enough, which is detrimental to reducing the risk of frequency conflicts within the same time slot and the risk of cross-time slot interference. Summary of the Invention
[0004] This invention aims to address one of the technical problems in related technologies to a certain extent. To this end, this invention provides an IoT data acquisition method, electronic device, and medium based on acquisition mask bitmap and acquisition sequence number rearrangement. By using the acquisition mask bitmap to specify a subset of devices participating in the acquisition and rearranging the fixed device sequence numbers corresponding to the participating devices into consecutive acquisition sequence numbers, idle time slots in selective acquisition scenarios can be reduced, time slot and wireless resource utilization can be improved, and downlink overhead and frequency conflict risks within the same time slot can be reduced. Unlike schemes that allocate time slots based on fixed device sequence numbers, this invention does not directly use the fixed sequence numbers of the devices for resource allocation in this round. Instead, the network-connected devices participating in this acquisition calculate consecutive acquisition sequence numbers locally based on the current acquisition mask bitmap and their own bit indexes before allocating time slots and channels.
[0005] To achieve the above objectives, as a first aspect of the present invention, an IoT data acquisition method based on the rearrangement of acquisition mask bitmap and acquisition sequence number is provided for a server, wherein the IoT data acquisition method includes: Determine the data collection status of each network-connected device; Based on the acquisition status of the network-connected devices in each physical group and the corresponding device addressing identifier, a corresponding acquisition mask bitmap is generated for each group. The device addressing identifier consists of the physical group identifier G and the device serial number S in the group. The bit index in the acquisition mask bitmap corresponds to the device serial number of the network-connected devices in the same group, and the bit value is used to indicate whether the corresponding network-connected device participates in this acquisition. Each acquisition mask bitmap and the corresponding preset acquisition configuration information are encapsulated into an acquisition instruction. The preset acquisition configuration information includes at least the number of channels, the channel index list, and the time slot duration. The acquisition instruction is used to enable the network access device participating in this acquisition to count the number of valid acquisition bits from the start bit of the acquisition mask bitmap to its corresponding bit, based solely on the acquisition mask bitmap and its own corresponding bit index. The count result minus one is used as the continuous acquisition sequence number for this round of acquisition. Time slot allocation and channel allocation are then performed based on the continuous acquisition sequence number. The server does not need to issue the acquisition sequence number to each network access device individually. The acquisition command is sent to the gateway corresponding to the physical group identifier; Receive the collected data sent by the gateway.
[0006] Optionally, the device serial numbers S of each network-connected device within the same physical group are numbered consecutively; the step of generating a corresponding acquisition mask bitmap for each group based on the acquisition status and corresponding device addressing identifier of the network-connected devices within each physical group includes: The length of the acquisition mask bitmap is determined based on the number of device serial numbers within the same physical group; wherein, the device serial number S corresponds one-to-one with the bit index of the acquisition mask bitmap; The bit value of the bit index in the acquisition mask bitmap is determined based on the acquisition status; The acquisition mask bitmap is stored byte by byte, where bit0 corresponds to device serial number S=0, bit1 corresponds to device serial number S=1, and so on.
[0007] Optionally, the collection status includes a first collection status indicating that the network access device does not participate in collection and a second collection status indicating that the network access device participates in collection; Determining the bit value of the bit index in the acquisition mask bitmap based on the acquisition state includes: The acquisition mask bitmap is initialized using the first acquisition state; The bit value of the bit index corresponding to the network access device participating in the acquisition is updated in the acquisition mask bitmap to the second acquisition state; wherein, the first acquisition state and the second acquisition state are different.
[0008] Optionally, the IoT data acquisition method further includes: Assign device addressing identifiers to devices joining the network.
[0009] As a second aspect of the present invention, an IoT data acquisition method based on the rearrangement of acquisition mask bitmap and acquisition sequence number is provided for network access devices, wherein the IoT data acquisition method includes: Receive data collection instructions; The acquisition command is parsed to obtain the acquisition mask bitmap and preset acquisition configuration information; Determine whether the network access device participates in this data collection based on the data collection mask bitmap and the device serial number; If it is determined that the network access device participates in this data collection, the number of valid data collection bits from the starting bit of the data collection mask bitmap to the corresponding bit of the network access device is counted, and the number minus one is used as the data collection sequence number of the network access device participating in this data collection, so that each network access device participating in this data collection obtains a continuous data collection sequence number. If it is determined that the network access device will not participate in this data collection, the network access device that does not participate in this data collection will not generate a data collection serial number and will exit the current data collection process; Time slots and channels are allocated to network access devices based on the acquisition sequence number and preset acquisition configuration information; Data is collected according to the allocated time slots and channels; The collected data is sent to the gateway.
[0010] Optionally, determining whether the network access device participates in this data collection based on the data collection mask bitmap and the device serial number includes: Locate the bit index of the network access device in the acquisition mask bitmap based on the device serial number of the network access device; The acquisition status of the network access device is determined based on the bit value of the bit index; When the acquisition state is the second acquisition state, it indicates that the network access device participates in this acquisition. The number of bits participating in the acquisition is counted from the starting bit of the acquisition mask bitmap to the corresponding bit of the network access device. The number minus one is used as the acquisition sequence number of the network access device. The acquisition sequence number ranges from 0 to N_active-1, where N_active is the total number of bits participating in the acquisition represented by the bit value in the acquisition mask bitmap. When the collection state is the first collection state, it indicates that the network access device does not participate in this collection and does not generate a collection sequence number.
[0011] Optionally, the preset acquisition configuration information includes at least the number of channels, a channel index list, and the time slot duration; The step of allocating time slots and channels to network access devices based on the acquisition sequence number and preset acquisition configuration information includes: The time slot offset and the intra-group offset within the same time slot are determined based on the acquisition sequence number and the number of channels. The index position of the channel index list is determined based on the length of the channel index list, the time slot offset, and the intra-group offset; Determine the channel index of the channel index list at the index position; The actual operating frequency of the network access device is determined based on the channel index, starting frequency, and channel interval; wherein, the number of channels is less than or equal to the length of the channel index list, the actual operating frequencies of each network access device in the same time slot do not overlap, and the risk of interference is reduced by rotating the channel index in different time slots.
[0012] Optionally, the acquisition instruction may also include the highest valid acquisition bit information, or the highest valid acquisition bit may be determined by the network access device according to the acquisition mask bitmap to limit the resolution range of the acquisition mask bitmap; when the network access device's own bit index is higher than the highest valid acquisition bit, it is determined that it will not participate in this acquisition; when the network access device's own bit index is not higher than the highest valid acquisition bit and the corresponding bit value indicates participation in acquisition, the number of bits indicating participation in acquisition from the start bit to its own bit index is counted, and the number of bits minus one is used as the acquisition sequence number.
[0013] Optionally, the device serial number corresponding to the network access device that did not participate in this collection will not occupy a time slot position in this round of time slot allocation. The network access devices that participated in this collection will be mapped to consecutive time slot positions in sequence according to the continuous collection serial number, so as to compress the idle time slots caused by the corresponding positions of the devices that did not participate in this collection.
[0014] As a third aspect of the present invention, an IoT data acquisition method based on the rearrangement of acquisition mask bitmap and acquisition sequence number is provided for a gateway, the gateway managing at least one physical group, the physical group including multiple network-connected devices, characterized in that the IoT data acquisition method includes: Receive collection instructions sent by the server; The acquisition command is sent to each network-connected device in the physical group corresponding to the acquisition command; Receive the corresponding collected data sent by each network-connected device; The collected data is sent to the server.
[0015] As a fourth aspect of the present invention, an electronic device is provided, comprising: One or more processors; A memory having stored one or more computer programs that, when executed by one or more processors, cause the one or more processors to implement the Internet of Things data acquisition method based on the rearrangement of acquisition mask bitmap and acquisition sequence number according to the first, second, and third aspects of the present invention.
[0016] As a fifth aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the Internet of Things data acquisition method based on the rearrangement of acquisition mask bitmap and acquisition sequence number according to the first, second, and third aspects of the present invention.
[0017] The IoT data acquisition method provided by this invention is applicable to IoT acquisition systems, which adopt a hierarchical architecture of server, gateway, and multiple network-connected devices. The server establishes interactive communication with multiple gateways, and a single gateway can manage at least one physical group. Each physical group integrates several network-connected devices, achieving full-domain data acquisition and transmission based on LoRa TDMA. By clearly defining the hierarchical interaction logic and execution tasks of the server, gateway, and network-connected devices, IoT data acquisition for selective acquisition scenarios can be achieved.
[0018] In this data acquisition method, the server assigns a device addressing identifier to each network-connected device to determine its physical group and location within the group within the entire data acquisition system. The server determines the acquisition status of all network-connected devices based on user-issued acquisition tasks, business rules, historical configurations, time policies, or alarm conditions. It then generates a corresponding acquisition mask bitmap for each physical group based on the acquisition status of the network-connected devices and their corresponding device addressing identifiers. Each acquisition mask bitmap and corresponding preset acquisition configuration information are encapsulated into an acquisition command. The acquisition command is then sent to the gateway corresponding to the device addressing identifier of each group. Upon receiving the acquisition command from the server, the gateway sends a wake-up preamble to the target physical group and forwards the acquisition command, causing the devices within the group to enter the receiving state.
[0019] After receiving the acquisition command, the network access device parses the command to obtain an acquisition mask bitmap and preset acquisition configuration information. Based on the acquisition mask bitmap, it determines whether the network access device participates in the current acquisition. If the network access device participates, it calculates the acquisition sequence number of the network access device, ensuring that all participating network access devices obtain consecutive acquisition sequence numbers. Unlike traditional resource allocation methods that rely on inherent device sequence numbers, the core innovation of this invention lies in the network access device's rearrangement of participating devices using the acquisition mask bitmap. This creates a continuous and compact temporary acquisition sequence number for the current round, and time slot and channel allocation are performed based on this temporary acquisition sequence number. This reduces idle time slots caused by non-participating devices and solves the problem of discrete effective device numbers. The temporary acquisition sequence number is generated only for the current acquisition round and can be updated as the combination of participating devices changes to adapt to different device combinations and acquisition ranges. After serial number arrangement is completed, time slots and channels are allocated to the network access devices based on the acquired serial numbers and preset acquisition configuration information to determine the acquisition time slots and operating frequencies of the network access devices. Finally, data is acquired according to the allocated time slots and channels, and the acquired data is sent to the gateway, which then forwards it to the server.
[0020] Compared to traditional fixed-sequence-number full-round polling acquisition methods, this invention does not require traversing all devices within a group. It achieves precise selection of effective acquisition devices through an acquisition mask bitmap. Since the acquisition mask bitmap only adds one bitmap field, it reconstructs the discretely distributed acquisition device sequence numbers into a continuous and compact temporary acquisition sequence number for this round with extremely low downlink overhead. This concentrates all effective acquisition devices in the early part of the time slot, reducing idle time slots caused by non-participating acquisition devices in traditional schemes, achieving time slot compression, improving time slot utilization and overall wireless communication resource utilization. Furthermore, it reduces the risks of frequency overlap, channel conflict, and transmission interference in traditional discrete numbering scenarios through time slot allocation and channel allocation. In addition, since the acquisition mask bitmap of this invention corresponds to the physical group, the acquisition of multiple physical groups does not interfere with each other through independent group masks and group acquisition command issuance. The method disclosed in this invention has good scalability and versatility.
[0021] These features and advantages of the present invention will be disclosed in detail in the following specific embodiments and accompanying drawings. The preferred embodiments or means of the present invention will be shown in detail in conjunction with the accompanying drawings, but are not intended to limit the technical solutions of the present invention. In addition, each of these features, elements and components appearing in the following text and drawings is a plurality of, and different symbols or numbers are used for convenience of representation, but all represent parts with the same or similar construction or function. Attached Figure Description
[0022] The present invention will be further described below with reference to the accompanying drawings: Figure 1 A flowchart of an IoT data acquisition method for a server provided by the present invention; Figure 2 A flowchart illustrating one embodiment of step S120 of an IoT data acquisition method for a server provided by the present invention; Figure 3 A flowchart illustrating one embodiment of step S122 of the IoT data acquisition method for a server provided by the present invention; Figure 4 Another flowchart of an IoT data acquisition method for a server provided by the present invention; Figure 5 A flowchart of an IoT data acquisition method for network access devices provided by the present invention; Figure 6 A flowchart illustrating one embodiment of step S230 of the IoT data acquisition method for network access devices provided by the present invention; Figure 7 A flowchart illustrating one embodiment of step S260 of the IoT data acquisition method for network access devices provided by the present invention; Figure 8 A flowchart of an IoT data acquisition method for a gateway provided by the present invention; Figure 9 A system architecture diagram of an Internet of Things (IoT) data acquisition system provided by the present invention; Figure 10 This is a schematic diagram of a module of one embodiment of the electronic device provided by the present invention; Figure 11 This is a schematic diagram of the modules of the computer-readable medium provided by the present invention.
[0023] Explanation of reference numerals in the attached figures 101: Processor; 102: Memory; 103: I / O interface; 104: Bus. Detailed Implementation
[0024] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described are intended to explain the present invention and should not be construed as limiting the invention.
[0025] The terms "an embodiment," "example," or "trademark" used in this specification refer to a particular feature, structure, or characteristic described in connection with the embodiment itself that may be included in at least one embodiment disclosed in this invention. The phrase "in an embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment.
[0026] In large-scale IoT network data collection scenarios, while existing technologies utilize time slot allocation rules for ordered transmission, when only a subset of devices needs to collect data (i.e., selective collection) and transmit data, these allocation rules often result in a large number of idle time slots, leading to low resource utilization. This is because the traditional collection mode relied upon by existing technologies must perform a full traversal and polling of all devices within the physical group according to their inherent serial numbers, failing to select effective collection devices as needed. Even if some devices do not participate in the current collection, they still occupy corresponding time slot resources, causing effective collection devices to be scattered throughout the time slot interval, generating a large number of invalid idle time slots, fragmenting the time slots, and resulting in extremely low time slot utilization and overall communication resource utilization. Furthermore, when calculating channel allocation based on the dispersed effective collection devices with inherent serial numbers, the mapped channel frequencies are irregular, easily leading to problems such as overlapping frequencies of multiple devices, channel conflicts, and data transmission interference, severely reducing the communication stability and reliability of IoT data collection.
[0027] In view of this, in order to solve the problem of low resource utilization in selective data acquisition, as a first aspect of the present invention, an IoT data acquisition method based on the rearrangement of acquisition mask bitmap and acquisition sequence number is provided for a server, such as... Figure 1 As shown, the IoT data acquisition method includes: In step S110, the data acquisition status of each network-connected device is determined; In step S120, a data acquisition mask bitmap corresponding to each group is generated based on the data acquisition status of the network-connected devices in each physical group and the corresponding device addressing identifier. For example, the device addressing identifier consists of a physical group identifier G and a device serial number S within the group. The device serial numbers S of all network-connected devices within the same physical group are numbered consecutively. The acquisition mask bitmap is stored byte-by-byte. The bit indexes in the acquisition mask bitmap correspond to the device serial numbers of the network-connected devices in the same group. Bit 0 in the acquisition mask bitmap corresponds to device serial number S=0, bit 1 corresponds to device serial number S=1, and so on. Each bit value is used to indicate whether the corresponding network-connected device participates in this round of acquisition.
[0028] In step S130, each of the acquisition mask bitmaps and the corresponding preset acquisition configuration information are encapsulated into an acquisition instruction; wherein, the acquisition instruction is used to enable the network access device participating in this acquisition to count the number of valid acquisition bits from the start bit of the acquisition mask bitmap to its own corresponding bit based only on the acquisition mask bitmap and its own corresponding bit index, and to subtract one from the count result as the continuous acquisition sequence number for this round of acquisition, so as to perform time slot allocation and channel allocation based on the continuous acquisition sequence number, without the server needing to issue the acquisition sequence number to each network access device individually; In some implementations, the preset acquisition configuration information includes the number of channels, a channel index list, and the time slot duration; the starting frequency and channel interval can be pre-stored locally on the network access device, or they can be sent by the server as extended fields along with the acquisition command. In some implementations, the acquisition command may also carry the highest valid acquisition bit information to limit the effective resolution range of the acquisition mask bitmap.
[0029] In step S140, the acquisition command is sent to the gateway corresponding to the physical group identifier; In step S150, the collected data sent by the gateway is received.
[0030] Compared to traditional fixed-sequence-number full-polling acquisition methods, this invention does not require traversing all devices within a group. It achieves precise selection of effective acquisition devices through an acquisition mask bitmap. Since the acquisition mask bitmap only adds one bitmap field, it reconstructs discretely distributed acquisition device sequence numbers into continuous, compact virtual dynamic acquisition sequence numbers with extremely low downlink overhead. This concentrates all effective acquisition devices in the early stages of the time slot, reducing idle time slots caused by non-participating devices in traditional schemes, achieving time slot compression, and improving time slot utilization and overall wireless communication resource utilization. Furthermore, it reduces the risks of frequency overlap, channel conflict, and transmission interference in traditional discrete numbering scenarios through time slot allocation and channel allocation. In addition, since the acquisition mask bitmap of this invention corresponds to the physical group, the acquisition of multiple physical groups does not interfere with each other through independent group masks and group acquisition command issuance. Therefore, the method disclosed in this invention has good scalability and versatility.
[0031] In existing technologies, to selectively collect data from individual network-connected devices, either full data collection wastes time slot resources, or multiple complex instructions are issued to designate each network-connected device as a data collection device, wasting downlink communication bandwidth.
[0032] To achieve extremely high time slot utilization and accurately specify the network-connected devices participating in data acquisition with minimal downlink overhead, this invention further provides a detailed structure of the device addressing identifier and a method for generating the acquisition mask bitmap. In this application, the device addressing identifier includes the physical group identifier to which the network-connected device belongs and the device serial number; the device serial numbers of each network-connected device within the same physical group are consecutive. The device addressing identifier serves as the physical coordinate of the network-connected device in the entire acquisition system, typically represented by (G, S). Wherein, G is the physical group ID, ranging from 1 to 254 (1 byte); S is the device serial number within the group. Taking a group with 128 nodes as an example, S ranges from 0 to 127. As an optional implementation of the acquisition mask bitmap generation method in step S120, such as... Figure 2 As shown, the step of generating a data acquisition mask bitmap for each group based on the data acquisition status of the network-connected devices within each physical group and the corresponding device addressing identifier includes: In step S121, the length of the acquisition mask bitmap is determined based on the number of device serial numbers within the same physical group; wherein, the device serial number corresponds one-to-one with the bit index of the acquisition mask bitmap; In step S122, the bit value of the bit index in the acquisition mask bitmap is determined according to the acquisition status; In step S123, the acquisition mask bitmap is stored byte by byte.
[0033] It's important to note that the acquisition mask bitmap is a continuous byte sequence, with the total number of bytes depending on the maximum number of nodes in the corresponding physical group. Taking a default of 128 nodes as an example, the total length of the acquisition mask bitmap is ceil(128 / 8) = 16 bytes (128 bits). Each bit corresponds sequentially to a device within the group; for example, bit0 corresponds to S=0, bit1 to S=1, ..., bit127 to S=127. In the traditional method, specifying a single device requires 5 bytes, consisting of a 4-byte device identifier and a 1-byte instruction. Specifying 128 devices individually requires 128 * 5 = 640 bytes. Compared to the traditional method, using the acquisition mask bitmap to specify acquisition devices saves 97.5% of downlink overhead, calculated as (1 - 16 bytes / 640 bytes) * 100% = 97.5%.
[0034] As described in step S122, the bit values in the acquisition mask bitmap are used to represent the acquisition status of the corresponding network access device. In this invention, each network access device has two acquisition statuses: a first acquisition status indicating that the network access device does not participate in acquisition, and a second acquisition status indicating that the network access device participates in acquisition. Since the bit index of the acquisition mask bitmap is bound one-to-one with the device serial number within the group, the value of each bit can be used to mark whether the corresponding device participates in this acquisition. In this way, all devices to be acquired and non-acquisition devices in the group can be distinguished at once using a single acquisition mask bitmap. As an optional implementation of step S122, such as... Figure 3 As shown, determining the bit value of the bit index in the acquisition mask bitmap based on the acquisition state includes: In step S122a, the acquisition mask bitmap is initialized using the first acquisition state; In step S122b, the bit value of the bit index corresponding to the network access device participating in the acquisition is updated to the second acquisition state in the acquisition mask bitmap; wherein, the first acquisition state and the second acquisition state are different.
[0035] Specifically, the first acquisition state represents that the device is not participating in acquisition, and the corresponding bit is assigned a value of 0; the second acquisition state represents that the device is participating in acquisition, and the corresponding bit is assigned a value of 1. First, the entire acquisition mask bitmap is initialized with 0, assuming all network-connected devices in the group are in a non-acquisition state by default. Then, only the bits corresponding to the devices that need to be acquired are rewritten to 1. Continuing with an example of 128 devices in the group (S=0-127), this time only the subset of temperature sensors needs to be acquired: S=0,1,4,5,8,9,12,13, a total of 8 devices. When the server generates the acquisition mask bitmap, byte 0 is set to 0x33 (00110011), byte 1 is also set to 0x33 (00110011), and all other bytes are 0. The bit distribution of byte 0 is: S0=1, S1=1, S2=0, S3=0, S4=1, S5=1, S6=0, S7=0. Byte 1 is similarly assigned to S8-S15.
[0036] By relying on the acquisition mask bitmap, the traditional full polling mode is upgraded to a bitmap-based precise naming on-demand acquisition mode, which can quickly filter a subset of specified sensor devices, avoid the time slot waste caused by polling invalid devices, and can flexibly adapt to various on-demand acquisition scenarios.
[0037] The generation of the acquisition mask bitmap relies on the standardized device addressing identifier, which is assigned when the device joins the network. If the physical location of the device does not change, this device addressing identifier does not need to be repeatedly generated with each acquisition task. Therefore, as another embodiment of the present invention, such as... Figure 4 As shown, the IoT data acquisition method further includes: In step S110, a device addressing identifier is assigned to the network access device; In step S120, the data acquisition status of each network-connected device is determined; In step S130, a data acquisition mask bitmap corresponding to each group is generated based on the data acquisition status of the network-connected devices in each physical group and the corresponding device addressing identifier. In step S140, each of the acquisition mask bitmaps and the corresponding preset acquisition configuration information are encapsulated into acquisition instructions; In step S150, the acquisition command is sent to the gateway corresponding to the physical group identifier; In step S160, the collected data sent by the gateway is received.
[0038] The above implementation method is suitable for engineering scenarios involving the addition of sensors and the dynamic addition or removal of network-connected devices. After the new device completes the identifier allocation upon joining the network, the identifier can be directly reused in subsequent data collections without the need for repeated allocation.
[0039] It is necessary to explain the acquisition command format as shown in Table 1 below. The command consists of fields such as CMD_TYPE, GROUP_ID, SLOT_TIME, MASK, N_CHANNELS, and CHANNEL_LIST. Among them, MASK is the acquisition mask bitmap, and its byte length M adapts to the maximum number of nodes in the group, occupying only 16 bytes in a 128-node scenario. CMD_TYPE and GROUP_ID are command control fields. CMD_TYPE occupies one byte and is used to identify the current command as an acquisition command; GROUP_ID occupies one byte and is used to identify the target physical group number G, enabling targeted distribution of data to the group. The other fields are preset acquisition configuration information. SLOT_TIME occupies two bytes and is configured as the time slot duration for a single acquisition; N_CHANNELS occupies one byte and represents the number of channels, i.e., the number of devices that can transmit in parallel per time slot; CHANNEL_LIST occupies L bytes and identifies the channel index list, used to configure the available channel numbers. In some other implementations, the starting frequency and / or channel interval can be pre-stored locally on the network access device. Correspondingly, in the embodiment without the extended field, the total length of the acquisition instruction is 5 + M + L bytes; in the embodiment with the extended field, the total length of the acquisition instruction also includes the byte length of the corresponding extended field. It can be concluded that this application only needs to add a MASK bitmap field to complete batch device screening. The overhead added by the MASK is minimal. Taking a physical group of 128 network-connected devices as an example, the MASK only occupies 16 bytes. Compared with the traditional method of sending out messages one by one carrying the device number, this significantly reduces the downlink packet size and saves wireless bandwidth resources.
[0040] Table 1
[0041] In some implementations, the acquisition command may further include most valid acquisition bit information, used to indicate the position of the most valid bit in the acquisition mask bitmap that needs to participate in this round of parsing. The most valid acquisition bit information can be determined by the server based on the highest device serial number involved in this round of acquisition and then issued along with the acquisition command. By setting the most valid acquisition bit information, the network access device does not need to traverse invalid bits beyond the most valid acquisition bit when parsing the acquisition mask bitmap, thereby reducing parsing overhead and shortening local computation time.
[0042] After receiving the collection command from the server, the gateway forwards the data according to the GROUP_ID in the command, and sends the corresponding command to all network-connected devices in the group. The gateway receives the collection command and forwards it to the network-connected devices in the group according to the GROUP_ID. Therefore, as a second aspect of the present invention, an IoT data collection method based on the rearrangement of the collection mask bitmap and collection sequence number is provided for network-connected devices, such as… Figure 5 As shown, the IoT data acquisition method includes: In step S210, a data acquisition command is received; In step S220, the acquisition command is parsed to obtain the acquisition mask bitmap and preset acquisition configuration information; In step S230, it is determined whether the network access device participates in this data collection based on the data collection mask bitmap and the device serial number; In step S240, if it is determined that the network access device participates in this collection, the number of valid collection bits from the start bit of the collection mask bitmap to the corresponding bit of the network access device is counted, and the number minus one is used as the collection sequence number of the network access device participating in this collection. In step S250, if it is determined that the network access device does not participate in this data collection, the network access device that does not participate in this data collection will not generate a data collection sequence number; In step S260, time slot allocation and channel allocation are performed on the network access device according to the acquisition sequence number and preset acquisition configuration information; In step S270, data is acquired according to the allocated time slots and channels; In step S280, the collected data is sent to the gateway.
[0043] It should be noted that the above steps S210-S280 are not strictly executed in sequence. The judgment result of step S230 determines whether step S240 or step S250 is executed subsequently. The specific execution branch can be selected according to the actual data collection needs.
[0044] In some data acquisition scenarios, a single acquisition mask bitmap can distinguish all devices to be acquired from non-acquisition devices in a group at once. If time slots are directly allocated based on the discrete device serial numbers of the devices to be acquired, a large number of idle time slots are easily generated, resulting in wasted time slot fragmentation. Therefore, after parsing the acquisition mask bitmap, the network access device, through the arrangement operations in steps S230 to S250, arranges the consecutive serial numbers of all devices to be acquired, ensuring that the acquisition serial numbers of all devices are consecutive and concentrated in the early part of the time slots. This solves the problems of time slot fragmentation and excessive idle time slots commonly found in traditional solutions, thus achieving time slot compression. As an optional implementation of step S230, such as... Figure 6 As shown, determining whether the network access device participates in this data collection based on the data collection mask bitmap and the device serial number includes: In step S231, the bit index of the network access device in the acquisition mask bitmap is located according to the device serial number of the network access device; In step S232, the acquisition status of the network access device is determined according to the bit value of the bit index; In step S233, when the acquisition state is the second acquisition state, indicating that the network access device participates in this acquisition, the number of bits participating in the acquisition is counted from the starting bit of the acquisition mask bitmap to the corresponding bit of the network access device. The bit value represents the number of bits participating in the acquisition. The counted number minus one is used as the acquisition sequence number SessionSeq of the network access device. In step S234, when the collection state is the first collection state, it indicates that the network access device does not participate in this collection and does not generate a collection sequence number.
[0045] In some implementations, the acquisition command may also carry the most valid acquisition bit information. When parsing the acquisition mask bitmap, if the network access device's own bit index is higher than the most valid acquisition bit, it can directly determine that it will not participate in this round of acquisition; if its own bit index is not higher than the most valid acquisition bit, and its corresponding bit value indicates participation in acquisition, it only counts the number of bits indicating participation in acquisition from the start bit to its own bit index, and subtracts one from this count as the acquisition sequence number.
[0046] In other implementations, the highest valid acquisition bit information can also be determined autonomously by the network access device based on the acquisition mask bitmap. For example, the position of the last valid bit in the acquisition mask bitmap that represents the acquisition can be determined, and the parsing range can be limited accordingly.
[0047] Specifically, in step S231, the network-entering device deduces the bit index in the acquisition mask bitmap based on its own device serial number. The calculation method is to first determine which byte it is in based on its own device serial number, with byte offset = floor(S / 8); then calculate its position within that byte, with bit offset = Smod8. In step S232, the bit value of this bit index is calculated as bit = (Mask[byte offset] >> bit offset) & 0x01. During the generation of the preceding acquisition mask bitmap, the bit value represents the acquisition status of each network-entering device. If the bit value is 0, it is the first acquisition state, meaning the device does not participate in acquisition, does not enter the subsequent acquisition and transmission process, and maintains or returns to a low-power state; if the bit value is 1, it is the second acquisition state, meaning the device participates in acquisition. The network-entering device can determine whether it needs to participate in this acquisition based on the bit value. In step S233, the network-connected devices participating in this data collection traverse the data collection mask bitmap, starting from bit 0 and ending at its corresponding bit. The count of the bit values represents the number of bits participating in the data collection, and this count is subtracted by one to obtain the data collection sequence number, SessionSeq. The formula for calculating the data collection sequence number is: SessionSeq = count_of_1s_in_Mask[bit_0 ..bit_S] - 1. Where SessionSeq ranges from 0 to N_active-1, and N_active is the total number of devices participating in this data collection (the number of bits in the Mask that are 1).
[0048] In this way, by using the acquisition mask bitmap, the sparsely distributed device serial numbers (temperature sensor subset, S=0,1,4,5,8,9,12,13) that only need to be acquired this time are compressed into a compact continuous acquisition sequence starting from 0 (SessionSeq=0,1,2,3,4,5,6,7), eliminating the idle positions occupied by devices that do not participate in the acquisition in the time slot sequence, significantly improving the time slot utilization rate in selective acquisition scenarios, and simultaneously shortening the overall acquisition time.
[0049] It's important to clarify the differences between the device serial number S and the acquisition sequence number SessionSeq. The device serial number S is a fixed identifier for the device and is not updated with each acquisition. It is used for group ID matching and device addressing in the wake-up packet. The acquisition sequence number SessionSeq is a temporary sequence number generated based on the requirements of this acquisition. It is valid only within one acquisition cycle and is used for time slot allocation and channel allocation calculations for this acquisition. The device serial number and the acquisition sequence number are independent of each other; the arrangement of the acquisition sequence number does not affect the device's fixed identifier.
[0050] Considering that the traditional method of directly using discrete device serial numbers for time slot and channel allocation results in randomly scattered time slots and chaotic channel arrangements, it not only wastes time slot resources but also easily leads to co-channel conflicts between multiple devices. To address these issues, as one implementation of step S260, as follows... Figure 7 As shown, the step of allocating time slots and channels to the network access device based on the acquisition sequence number and preset acquisition configuration information includes: In step S261, the time slot offset and the intra-group offset within the same time slot are determined based on the acquisition sequence number and the number of channels; In step S262, the index position of the channel index list is determined according to the length of the channel index list, the time slot offset, and the intra-group offset; In step S263, the channel index of the channel index list at the index position is determined; In step S264, the actual operating frequency of the network access device is determined based on the channel index, starting frequency point, and channel interval.
[0051] In the above steps, the preset acquisition configuration information is divided into two parts. The first part is encapsulated in the acquisition command, which is the configuration parameters obtained by the device through parsing the command, including the number of channels, the channel index list, and the time slot duration. The second part consists of the inherent configuration parameters that are pre-fixed and stored locally on the network access device, including the channel spacing and the starting frequency.
[0052] Using the acquisition sequence number SessionSeq, the number of channels N_CHANNELS, the channel index list CHANNEL_LIST[], the length of the channel index list L, the starting frequency F_start, and the channel interval F_step, the calculation process of steps S261-264 above is given in detail. In step S261, the time slot offset t and the intra-group offset r satisfy formulas (1) and (2) respectively, and the value of r ranges from 0 to N_CHANNELS-1: t = floor(SessionSeq ÷ N_CHANNELS)(1) r = SessionSeq mod N_CHANNELS(2) After obtaining the time slot offset t and the intra-group offset r, the index position freq_idx of the channel index list in step S262 is determined using formula (3).
[0053] freq_idx = (t + r) mod L(3) Subsequently, the channel index (channel_index) at that index position is read from the channel index list according to formula (4), and step S263 is completed.
[0054] channel_index = CHANNEL_LIST[freq_idx](4) Finally, determine the actual usage frequency F_actual of the acquisition device according to formula (5) and complete step S264.
[0055] F_actual = F_start + channel_index × F_step (5) Within the same time slot, the r values of N_CHANNELS devices are 0, 1, ..., N_CHANNELS-1, and their corresponding freq_idx values are (t+0)%L, (t+1)%L, ..., (t+N_CHANNELS-1)%L. As long as N_CHANNELS≤L, i.e., the number of channels is less than or equal to the length of the channel index list, the N_CHANNELS freq_idx values are pairwise distinct, thus ensuring that the uplink frequency points of each device within the same time slot are not repeated. For devices in different time slots (different t values), the initial value of freq_idx changes with t, thus forming frequency rotation, which helps reduce the risk of cross-time slot interference. Both devices and gateways can independently calculate the same frequency mapping relationship based on MASK, N_CHANNELS, and CHANNEL_LIST, without the need for additional negotiation or the distribution of frequency hopping tables. That is, when the number of channels is less than or equal to the length of the channel index list, the actual usage frequency of each network access device in the same time slot does not overlap, and the risk of interference is reduced by rotating the channel index in different time slots.
[0056] When only some devices are being collected, the total number of time slots required is ceil(N_active÷N_CHANNELS). Compared to the number of time slots required for full collection based on the maximum number of devices in the group, which is ceil(N_max÷N_CHANNELS), the collection time slots can be compressed proportionally, reducing idle time slots caused by the locations of devices that are not participating in the collection and improving the utilization rate of time slots.
[0057] The following is a complete example of selective data acquisition from some devices. In this scenario, there are a total of 128 devices in a physical group (device serial numbers S0-127). This time, only the temperature sensor subset {S=0,1,4,5,8,9,12,13}, a total of 8 devices, needs to be acquired.
[0058] The relevant configuration parameters for the preset acquisition configuration information include: number of channels N_CHANNELS=4, channel index list CHANNEL_LIST[0,2,5,7,10,12,15,17], length of channel index list L=8, starting frequency F_start=470.1MHz, channel interval F_step=200kHz, and time slot duration Δt=300ms.
[0059] When the server generates the acquisition mask bitmap, byte 0 is set to 0x33 (00110011), byte 1 is also set to 0x33 (00110011), and the remaining bytes are all 0s. The bit distribution of byte 0 is: S0=1, S1=1, S2=0, S3=0, S4=1, S5=1, S6=0, S7=0. Byte 1 is similarly assigned to S8~S15.
[0060] The process of parsing the MASK and calculating the acquisition sequence number (SessionSeq) is as follows: The MASK is traversed starting from bit 0. The number of bits with a value of 1 up to the corresponding bit is counted, and this count is subtracted by one to obtain the SessionSeq. For example, when S=0, the corresponding bit is 1, the cumulative count is 1, and SessionSeq=0; when S=1, the corresponding bit is 1, the cumulative count is 2, and SessionSeq=1; when S=2, the corresponding bit is 0, it does not participate in this round of acquisition, does not enter the subsequent acquisition and transmission process, and maintains or returns to a low-power state; when S=4, the corresponding bit is 1, at this time there are 3 1s in the first 5 bits, and SessionSeq=2. And so on, finally, the participating devices with S=0,1,4,5,8,9,12,13 obtain SessionSeq=0,1,2,3,4,5,6,7 respectively.
[0061] Based on SessionSeq and the time slot and channel allocation algorithm of this application, the allocation results for each device are shown in Table 2 below. In Table 2, S is the device sequence number, SessionSeq is the acquisition sequence number, t is the time slot offset, r is the offset within the group, freq_idx is the index position, channel_index is the channel index, and F_actual is the actual frequency or uplink frequency.
[0062] Table 2
[0063] According to the allocation results in Table 2, multi-channel parallel transmission achieves time slot spatial multiplexing, and a single time slot can support multiple devices reporting simultaneously. The four devices in time slot 0 (S=0,1,4,5) report in parallel at time T_recv, using 470.1MHz, 470.5MHz, 471.1MHz, and 471.5MHz respectively. The four devices in time slot 1 (S=8,9,12,13) report in parallel at time T_recv+300ms, using 470.5MHz, 471.1MHz, 471.5MHz, and 472.1MHz respectively. Here, T_recv is the baseline start time when the network-connected device receives the batch collection command forwarded by the gateway. The gateway can open the corresponding receiving window based on this baseline start time. Devices not selected do not enter the subsequent collection and transmission process after completing the collection mask bitmap judgment and maintain or return to a low-power state. The allocation results show that the allocated frequencies within the same time slot are non-overlapping, avoiding uplink frequency conflicts within the same time slot; frequency rotation and reuse are achieved by varying the frequency t across different time slots, effectively mitigating cross-time slot interference. The total time for the 8 devices is 2 × 300 ms = 600 ms.
[0064] It should be noted that in the above embodiments, the channel index list is dynamically generated by the server based on real-time channel quality and interference environment, and is issued with the acquisition command. The network access device only looks up the table to obtain the channel index and does not participate in channel screening and interference calculation, thereby reducing the computing load of the network access device.
[0065] To further demonstrate the efficiency advantage of this application compared to traditional acquisition schemes, a comparative analysis of acquisition efficiency is conducted using the aforementioned acquisition scenario (only 8 devices need to be acquired from 128 devices) and preset acquisition configuration information. The traditional scheme using full time slot allocation requires... 128÷4 =32 time slots, total time consumption 32×300ms=9600ms. This method seems to occupy all time slots, but most time slots are only reported by a very small number of devices, resulting in a large number of channel slots being idle and wasted. This application relies on the acquisition mask bitmap and acquisition sequence number compression mechanism to map 8 discrete devices to a continuous SessionSeq=0 7. Only 2 time slots are needed to complete the acquisition, with a total time of 600ms. The time slot resources are fully utilized, and the overall acquisition time is reduced by 93.75%.
[0066] Continuing with the above data acquisition scenario as an example, the acquisition time described in this application is directly proportional to the number of participating devices, with the number of channels N_CHANNELS=4 and the single timeslot duration of 300ms remaining unchanged. Out of 128 devices, if there are 64 acquisition devices, 16 timeslots are required, with a total time consumption of 4800ms. Compared to the traditional full-data acquisition method with 32 timeslots and a time consumption of 9600ms, the acquisition time is reduced by 50%. If there are 32 acquisition devices, 8 timeslots are required, with a total time consumption of 2400ms. Compared to the traditional full-data acquisition method, the acquisition time is reduced by 75%. If there are 8 acquisition devices, only 2 timeslots are required, with a total time consumption of 600ms. Compared to the traditional full-data acquisition method, the acquisition time is reduced by 93.75%.
[0067] The above data demonstrates that this application, by relying on the selection of acquisition mask bitmaps and the continuous arrangement of acquisition sequence numbers, can allocate time slot resources on demand. The required number of time slots is determined solely by the actual number of devices requiring acquisition, and the acquisition time decreases synchronously with the number of acquisition devices. Compared to traditional full-volume acquisition, this scheme can allocate time slot resources according to the actual number of devices requiring acquisition, thereby reducing the waste of idle time slot and channel resources; it also helps improve time slot utilization under various selective acquisition conditions.
[0068] In addition to the aforementioned fixed number of single selective acquisitions, the acquisition scheme of this application can also adapt to the usage requirements of multi-cycle rotation acquisition in engineering sites. Within the same device group, different subsets of devices can be selected for different acquisition cycles. The acquisition mask bitmaps for each round are independent of each other, and each round of acquisition corresponds to an independently generated acquisition mask bitmap. The device only calculates the SessionSeq for the current round based on the acquisition mask bitmap of the current round and its own bit index, without retaining the SessionSeq of the previous round of acquisition. Furthermore, the server does not need to send the SessionSeq of each participating device in the current round individually. Therefore, the server only needs to send the acquisition mask bitmap and acquisition configuration parameters, so that each participating device can independently determine its acquisition sequence number in the current acquisition round.
[0069] In the first round, temperature sensors S=0, 1, 2, 3, 4, 5 are selected, and the corresponding bits 0~5 of the acquisition mask bitmap are set to 1, generating acquisition sequence numbers 0~5, which takes up 2 time slots. In the second round, the acquisition target is switched, and humidity sensors S=64, 65, 66, 67 are selected. Only bits 64~67 of the acquisition mask bitmap are set to 1, and acquisition sequence numbers 0~3 are regenerated, requiring only 1 time slot. In the third round, scattered alarm sensors S=0, 10, 20…120 are acquired, and acquisition sequence numbers 0~12 are reassigned based on the acquisition mask bitmap of this round, taking up 4 time slots. The device only relies on the current acquisition mask bitmap to calculate its own acquisition sequence number and does not need to store or know the acquisition parameters of other rounds.
[0070] As can be seen from this multi-round data collection embodiment, this application can also flexibly adjust the collection range as needed, and each round independently completes the collection sequence number compression. Even if the physical numbers of the devices are scattered and have a large span, they can be organized into continuous collection sequence numbers and time slots can be allocated as needed. Each collection round is independent of the others, and the terminal does not need to retain historical configurations. It can well adapt to the actual working conditions of time-based and classified collection of temperature, humidity, fault alarms, etc.
[0071] To visually demonstrate the technical advantages of this invention compared to existing acquisition schemes, a horizontal comparison is made on several key indicators, including selective acquisition, time slot compression, downlink communication overhead, time slot utilization, and frequency conflict protection. The specific data are shown in Table 3 below.
[0072] Table 3
[0073] As shown in Table 3 above, traditional full-volume acquisition cannot select acquisition devices on demand. While the one-by-one specification and mapping table schemes support selective acquisition, the downlink command data volume is relatively large, which is not conducive to compressing time slot resources and may require additional interaction and coordination to avoid frequency conflicts. The method of this invention not only supports selective acquisition but also has time slot compression capabilities. With minimal downlink overhead, it can improve time slot utilization in selective acquisition scenarios and reduce the risk of frequency conflicts within the same time slot through the allocation algorithm.
[0074] Based on the aforementioned multiple embodiments and measured data, the optimization of this solution compared to the traditional full-data acquisition solution is quantified from three dimensions: data acquisition time, downlink communication overhead, and power consumption of non-acquisition terminals. The quantified data is shown in Table 4.
[0075] Table 4
[0076] As shown in Table 4, under selective acquisition, the acquisition time can be shortened when the number of actual acquisition devices decreases. In the example scenario, the acquisition time for acquiring only 8 devices is reduced by 93.75% compared to the full acquisition scheme, and the acquisition time for acquiring half of the network devices is reduced by 50% compared to the full acquisition scheme. Regarding downlink overhead, traditional solutions require up to 640 bytes of data when specifying devices one by one on demand; this invention, by acquiring a mask bitmap, only requires 16 bytes of data to be sent in the example scenario, which helps save wireless channel resources and reduce downlink command overhead. Devices not selected for acquisition do not need to enter the subsequent acquisition and transmission process. After receiving and parsing the command, they can remain in sleep mode or return to sleep mode, which helps reduce terminal power consumption and extend sensor battery life.
[0077] As a third aspect of the present invention, an IoT data acquisition method based on the rearrangement of acquisition mask bitmap and acquisition sequence number is provided for a gateway, wherein the gateway governs at least one physical group, the physical group including multiple network-connected devices, such as... Figure 8 As shown, the IoT data acquisition method includes: In step S310, a data acquisition command sent by the server is received; In step S320, the acquisition command is sent to each network access device in the physical group corresponding to the acquisition command; In step S330, the corresponding collected data sent by each network access device is received; In step S340, each of the collected data is sent to the server.
[0078] Adaptive Figure 9 This application provides a system architecture diagram for an IoT data acquisition system based on an IoT data acquisition method using a data acquisition mask bitmap and data acquisition sequence number rearrangement. As shown in the diagram, the server generates an acquisition plan based on business requirements, determines the target devices to be acquired, generates a data acquisition mask bitmap according to the device's physical number, and simultaneously performs channel list optimization calculations based on channel quality. Finally, the generated acquisition command is sent to the gateway.
[0079] The SX1302 gateway first sends a WORK (Wake-up Preamble) code to enable devices in the target physical group to enter the receiving state, then forwards the acquisition instructions sent by the server, and finally receives the acquisition data returned by each terminal and sends it back to the server.
[0080] After receiving the instruction, the device parses the acquisition mask bitmap to determine whether it is within the acquisition range. Selected devices count the number of valid acquisition bits from the start bit to their corresponding bit, subtract one from the count value to obtain their acquisition sequence number, and then autonomously calculate the reporting time, time slot, and frequency based on the time slot and channel allocation method, and upload the acquisition data on the corresponding channel. Unselected devices do not enter the subsequent acquisition and transmission process after completing the acquisition instruction judgment, and maintain or return to a low-power state.
[0081] This three-tier architecture has a clear division of labor. Complex calculations such as acquisition planning, mask generation, and channel optimization are handled by the server. The gateway is responsible for issuing wake-up preambles, forwarding acquisition commands, and aggregating and transmitting data back to the terminals. The terminal only performs mask parsing, sequence number and frequency point calculation, effectively reducing the terminal hardware load; the terminal uses the mask to identify acquisition tasks, and devices not participating in the acquisition do not enter the subsequent acquisition and transmission process, and maintain or return to a low-power state, thus controlling device power consumption; the terminal autonomously staggers the reporting time slots and frequency bands, improving channel and time slot utilization and avoiding frequency point conflicts; the acquisition configuration is issued using masks, eliminating the need to fill in device numbers one by one, resulting in lower downlink transmission overhead. The server can flexibly adjust the acquisition range and generate independent masks round by round to adapt to changing business needs and support multi-round acquisition.
[0082] As a fourth aspect of the present invention, an electronic device is provided, wherein, as Figure 10 As shown, the electronic device includes: One or more processors 101; The memory 102 stores one or more computer programs that, when executed by the one or more processors 101, cause the one or more processors 101 to implement the Internet of Things data acquisition method based on the rearrangement of acquisition mask bitmap and acquisition sequence number according to the first, second, and third aspects of the present invention.
[0083] The electronic device may also include one or more I / O interfaces 103 connected between the processor 101 and the memory 102, configured to enable information interaction between the processor 101 and the memory 102.
[0084] The processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, enabling information exchange between the processor and the memory, including but not limited to a data bus (Bus).
[0085] In some embodiments, the processor 101, memory 102, and I / O interface 103 are interconnected via bus 104, and thus connected to other components of the electronic device.
[0086] As a fifth aspect of the present invention, such as Figure 11As shown, a computer-readable medium is provided having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the Internet of Things data acquisition method based on the rearrangement of acquisition mask bitmap and acquisition sequence number according to the first, second, and third aspects of the present invention.
[0087] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. Accordingly, the computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can implement the methods of any of the above embodiments. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0088] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes, but is not limited to, the contents described in the accompanying drawings and the specific embodiments above. Any modifications that do not depart from the functional and structural principles of the present invention will be included within the scope of the claims.
Claims
1. An IoT data acquisition method based on the rearrangement of acquisition mask bitmap and acquisition sequence number, used in a server, characterized in that, The IoT data acquisition method includes: Determine the data collection status of each network-connected device; Based on the acquisition status of the network-connected devices within each physical group and the corresponding device addressing identifier, a corresponding acquisition mask bitmap is generated for each group. The device addressing identifier consists of a physical group identifier G and a device serial number S within the group. The bit index in the acquisition mask bitmap corresponds to the device serial number of the network-connected devices in the same group, and the bit value is used to indicate whether the corresponding network-connected device participates in this acquisition. The device serial number is a fixed identifier for the network-connected device. The acquisition mask bitmaps and corresponding preset acquisition configuration information are encapsulated into acquisition instructions. The preset acquisition configuration information includes at least the number of channels, a channel index list, and a time slot duration. The acquisition instructions are used to enable the network access devices participating in this acquisition to count the number of valid acquisition bits from the start bit of the acquisition mask bitmap to their corresponding bit, based solely on the acquisition mask bitmap and their own corresponding bit index. The count result minus one is used as the continuous acquisition sequence number for this round of acquisition, and time slot allocation and channel allocation are performed based on the continuous acquisition sequence number. The server does not need to issue acquisition sequence numbers to each network access device individually. The acquisition sequence number is a temporary sequence number generated according to the acquisition requirements. The acquisition sequence numbers of multiple network access devices participating in this acquisition are consecutive. The value range of the acquisition sequence number is 0 to N_active-1, where N_active is the total number of devices participating in this acquisition. The acquisition command is sent to the gateway corresponding to the physical group identifier; Receive the collected data sent by the gateway.
2. The IoT data acquisition method according to claim 1, characterized in that, The device serial numbers S of each network-connected device within the same physical group are numbered consecutively; the generation of the acquisition mask bitmap corresponding to each group based on the acquisition status and corresponding device addressing identifier of the network-connected devices within each physical group includes: The length of the acquisition mask bitmap is determined based on the number of device serial numbers within the same physical group; wherein, the device serial number corresponds one-to-one with the bit index of the acquisition mask bitmap; The bit value of the bit index in the acquisition mask bitmap is determined based on the acquisition status; The acquisition mask bitmap is stored byte by byte.
3. The IoT data acquisition method according to claim 2, characterized in that, The collection status includes a first collection status indicating that the network access device does not participate in the collection and a second collection status indicating that the network access device participates in the collection. Determining the bit value of the bit index in the acquisition mask bitmap based on the acquisition state includes: The acquisition mask bitmap is initialized using the first acquisition state; The bit value of the bit index corresponding to the network access device participating in the acquisition is updated in the acquisition mask bitmap to the second acquisition state; wherein, the first acquisition state and the second acquisition state are different.
4. The Internet of Things (IoT) data acquisition method according to any one of claims 1 to 3, characterized in that, The IoT data acquisition method also includes: Assign device addressing identifiers to devices joining the network.
5. An IoT data acquisition method based on the rearrangement of acquisition mask bitmap and acquisition sequence number, used for network access devices, characterized in that, The IoT data acquisition method includes: Receive data collection instructions; The acquisition command is parsed to obtain the acquisition mask bitmap and preset acquisition configuration information; Determine whether the network access device participates in this data collection based on the data collection mask bitmap and the device serial number; If it is determined that the network access device participates in this data collection, the number of valid data collection bits from the start bit of the data collection mask bitmap to the corresponding bit of the network access device is counted, and the number minus one is used as the data collection sequence number of the network access device participating in this data collection. If it is determined that the network access device will not participate in this data collection, the network access device that does not participate in this data collection will not generate a data collection serial number; Time slots and channels are allocated to network access devices based on the acquisition sequence number and preset acquisition configuration information; Data is collected according to the allocated time slots and channels; The collected data is sent to the gateway.
6. The IoT data acquisition method according to claim 5, characterized in that, The step of determining whether the network access device participates in this data collection based on the data collection mask bitmap and the device serial number includes: Locate the bit index of the network access device in the acquisition mask bitmap based on the device serial number of the network access device; The acquisition status of the network access device is determined based on the bit value of the bit index; When the collection state is the second collection state, it indicates that the network access device participates in this collection. The number of bits participating in the collection is counted from the starting bit of the collection mask bitmap to the corresponding bit of the bit index. The number minus one is used as the collection sequence number of the network access device. When the collection state is the first collection state, it indicates that the network access device does not participate in this collection and does not generate a collection sequence number.
7. The IoT data acquisition method according to claim 5, characterized in that, The preset acquisition configuration information includes at least the number of channels, a channel index list, and the time slot duration; The step of allocating time slots and channels to network access devices based on the acquisition sequence number and preset acquisition configuration information includes: The time slot offset and the intra-group offset within the same time slot are determined based on the acquisition sequence number and the number of channels. The index position of the channel index list is determined based on the length of the channel index list, the time slot offset, and the intra-group offset; Determine the channel index of the channel index list at the index position; The actual operating frequency of the network access device is determined based on the channel index, starting frequency point, and channel interval. When the number of channels is less than or equal to the length of the channel index list, the actual usage frequency of each network access device in the same time slot does not overlap, and the interference risk is reduced by rotating the channel index in different time slots.
8. The IoT data acquisition method according to claim 5, characterized in that, The acquisition instruction also includes the highest valid acquisition bit information or the highest valid acquisition bit determined by the network access device according to the acquisition mask bitmap; when the network access device's own bit index is higher than the highest valid acquisition bit, it is determined that it will not participate in this acquisition; when the network access device's own bit index is not higher than the highest valid acquisition bit and the corresponding bit value indicates participation in acquisition, the number of bits indicating participation in acquisition from the start bit to its own bit index is counted, and the number of bits minus one is used as the acquisition sequence number.
9. The IoT data acquisition method according to claim 5, characterized in that, The serial numbers of network access devices that did not participate in this data collection will not occupy time slot positions in this round of time slot allocation. Network access devices that participated in this data collection will be mapped to consecutive time slot positions in sequence according to their consecutive data collection serial numbers, so as to compress the idle time slots caused by the positions of devices that did not participate in this data collection.
10. An electronic device, characterized in that, include: One or more processors; A memory having stored one or more computer programs thereon, which, when executed by the one or more processors, cause the one or more processors to implement the Internet of Things data acquisition method according to any one of claims 1 to 9.
11. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the Internet of Things data acquisition method according to any one of claims 1 to 9.
Citation Information
Patent Citations
A LORA data acquisition control system based on TDMA
CN109862068A
Centralized reading communication method of LoRa ad hoc network
CN113810870A
STA time-sharing reporting method and system based on central beacon bitmap
CN121509458A
