Scheduling method for preferentially sending abnormal data in Internet of Things
By setting emergency sending thresholds and modifying the frame structure in the IEEE 802.15.4 network, the problem of abnormal data being unable to be sent in time is solved, and rapid data transmission in water quality monitoring is realized to ensure that the monitoring center handles abnormal data in a timely manner.
Patent Information
- Application Number
- CN202510622662.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-08-12
AI Technical Summary
In the IEEE 802.15.4 network, abnormal data cannot be sent to the monitoring center in time, resulting in the monitoring center being unable to deal with water quality problems in time. GTS allocation is based on the principle of first application and first allocation that affects the data transmission efficiency.
In the beacon enable working mode, the monitored indicator emergency sending threshold is set. When the indicator exceeds the threshold, the node prefers GTS, and ensures high priority allocation of abnormal data by modifying the GTS request frame and the GTS_ACK confirmation frame. If the requirements are not met, the competition time slot is sent in the CAP stage.
It realizes the rapid transmission of abnormal data, ensures that the monitoring center can take emergency measures in a timely manner, and improves the efficiency of data transmission.
Smart Images

Figure CN120475447A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things communication protocols, and in particular to a scheduling method for preferentially sending abnormal data in the Internet of Things. Background Art
[0002] As a low-speed, low-power, short-range communication protocol, IEEE 802.15.4 is widely used for data monitoring and collection in the Internet of Things. IEEE 802.15.4 networks operate in two modes: beacon-enabled and non-beacon-enabled. In beacon-enabled mode, the coordinator periodically broadcasts beacon frames, synchronizing relevant nodes and enabling data transmission using the corresponding protocol. In non-beacon-enabled mode, the coordinator does not periodically send beacon frames, but instead sends them based on requests from other nodes.
[0003] Since various nodes in the IEEE 802.15.4 network adopt a self-powered working mode, in order to reduce energy consumption and extend the node's service life, the node does not send data immediately after receiving it, but must meet certain trigger conditions (such as a specified time) before sending.
[0004] Therefore, when the traditional IEEE 802.15.4 network is applied to a certain field such as water quality monitoring, the abnormal data collected by the node is sometimes not sent to the monitoring center immediately, making it impossible for the monitoring center to detect the problem in time and take corresponding measures.
[0005] In addition, in IEEE 802.15.4 networks, nodes that want to send data during the CFP phase must send a GTS request frame in advance in the previous superframe. This GTS request frame needs to compete with other data frames for time slot transmission, and the coordinator allocates time slots in the GTS based on the first-come-first-served (FCFS) principle. This further affects the efficiency of sending abnormal data collected by nodes to the monitoring center as quickly as possible. Summary of the Invention
[0006] The purpose of the present invention is to provide a scheduling method for preferentially sending abnormal data in the Internet of Things to solve the problems raised in the above background technology.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A scheduling method for preferentially sending abnormal data in an Internet of Things, comprising:
[0009] Adopting node monitoring, setting the emergency sending threshold of the monitored indicator within the upper and lower limits of the monitored indicator. When the monitored indicator reaches the threshold, the node monitoring collects abnormal data;
[0010] The node that sends abnormal data applies for GTS from the coordinator. The coordinator receives the GTS request frame from the node that wants to send abnormal data.
[0011] The coordinator is required to enable the GTS_ACK confirmation frame to confirm the GTS request of the node that needs to send abnormal data, and indicate the number of time slots that can be allocated in the GTS_ACK confirmation frame, so that the node that needs to send abnormal data can determine whether the number of time slots allocated in the CFP phase of the superframe can meet the demand;
[0012] If possible, send the abnormal data through the assigned GTS;
[0013] If not, the node that needs to send abnormal data will also use time slot CSMA / CA to compete for the channel in the CAP phase to obtain enough time slots to send the abnormal data.
[0014] Furthermore, after receiving the GTS request frame from the node that intends to send abnormal data, the coordinator checks whether the number of allocated GTSs reaches 7;
[0015] If so, check whether there is one that meets the requirements among the allocated GTSs;
[0016] If not, check whether the idle GTS in the CFP meets the requirements.
[0017] Furthermore, when the number of allocated GTSs reaches 7:
[0018] If there are timeslots in the allocated GTS that meet the requirements, the coordinator releases the allocated GTS to the node that wants to send abnormal data, and sends a GTS_ACK confirmation frame to indicate the number of allocated timeslots;
[0019] If none of the allocated GTSs meet the demand, check whether the demand can be met after releasing some GTSs starting from the rightmost end of the superframe active period.
[0020] When the number of allocated GTSs does not reach 7:
[0021] If the idle GTS in the CFP meets the requirements, the coordinator allocates GTS to the node that wants to send abnormal data and sends a GTS_ACK confirmation frame to indicate the number of allocated time slots;
[0022] If the idle GTS in the CFP does not meet the requirements, check whether the idle time slots in the CFP meet the requirements after adjusting the CAP length to the minimum allowed value.
[0023] Furthermore, if GTSs are released one by one starting from the rightmost end of the superframe active period, and the demand can be met after releasing some GTSs, the coordinator releases the allocated GTSs to the node that wants to send abnormal data and sends a GTS_ACK confirmation frame to indicate the number of allocated time slots;
[0024] If GTSs are released one by one starting from the rightmost end of the superframe active period, and the demand cannot be met after releasing some GTSs, the coordinator releases all allocated GTSs and reallocates them to the node that wants to send abnormal data, and sends a GTS_ACK confirmation frame to indicate the number of allocated time slots.
[0025] Furthermore, if the idle time slots in the CFP meet the requirements after adjusting the CAP length to the minimum allowed value, the coordinator allocates GTS to the node that wants to send abnormal data and sends a GTS_ACK confirmation frame to indicate the number of allocated time slots;
[0026] If the idle time slots in the CFP do not meet the requirements after adjusting the CAP length to the minimum allowed value, check whether there are any that meet the requirements in the allocated GTS.
[0027] Furthermore, the structure of the GTS request frame includes, from left to right:
[0028] GTS Length: occupies 4 bits and indicates the requested GTS length, that is, the number of time slots in the superframe;
[0029] GTSDirection: occupies 1 bit and indicates the direction of GTS. Here, it is 0, indicating from the node to the coordinator.
[0030] Characteristics Type: occupies 1 bit and indicates whether to apply for GTS allocation or GTS deletion. Here, 1 indicates applying for GTS allocation;
[0031] Flag: occupies 2 bits and is used to indicate the priority of the current GTS request frame, set to 01.
[0032] The structure of the GTS_ACK confirmation frame includes from left to right:
[0033] Frame Control Field: 2 bytes in length, with the first 3 bits set to 100, indicating that it is an acknowledgment frame for a GTS request frame.
[0034] Data Sequence Number: 1 byte in length, indicating the frame number of the confirmed GTS request frame;
[0035] Address: 2 bytes in length, indicating the short address of the node receiving the GTS_ACK confirmation frame;
[0036] GTS Slots: 4 bits in length, indicating the number of time slots allocated by the coordinator;
[0037] PADDING: 4 bits in length, used to ensure that the frame length is an integer multiple of 8;
[0038] Frame Control Sequence: 1 byte long, used to check the frame.
[0039] To achieve the above object, the present invention further provides the following technical solutions:
[0040] A scheduling system for preferentially sending abnormal data in the Internet of Things, comprising:
[0041] The monitoring module is used to adopt node monitoring and set the emergency sending threshold of the monitored indicator within the upper and lower limit values of the monitored indicator. When the monitored indicator reaches the threshold, the node monitoring collects abnormal data;
[0042] The request module is used for the node sending abnormal data to apply for GTS from the coordinator. The coordinator receives the GTS request frame from the node that wants to send abnormal data.
[0043] The sending module is used to force the coordinator to enable the GTS_ACK confirmation frame to confirm the GTS request of the node that needs to send abnormal data, and indicate the number of time slots that can be allocated in the GTS_ACK confirmation frame, so that the node that needs to send abnormal data can determine whether the number of time slots allocated in the CFP phase of the superframe can meet the demand;
[0044] If possible, send the abnormal data through the assigned GTS;
[0045] If not, the node that needs to send abnormal data will also use time slot CSMA / CA to compete for the channel in the CAP phase to obtain enough time slots to send the abnormal data.
[0046] To achieve the above object, the present invention further provides the following technical solutions:
[0047] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
[0048] To achieve the above object, the present invention further provides the following technical solutions:
[0049] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of any one of the methods described above.
[0050] Compared with the prior art, the present invention has the following beneficial effects:
[0051] The present invention designs a scheduling algorithm that prioritizes the transmission of abnormal data in a beacon-enabled working mode. This algorithm sets an emergency transmission threshold for the monitored indicator within the upper and lower limits specified by the monitored indicator (the size of the threshold can be determined based on actual conditions). Once the monitored indicator reaches the threshold, the node applies for a time slot as quickly as possible and sends the data in the cache as quickly as possible, allowing the monitoring center to take appropriate emergency measures as soon as possible. At the same time, the process for nodes to apply for and use time slots in the IEEE 802.15.4 network, as well as some frame structures, are modified to ensure that abnormal data collected by node monitoring can be sent to the monitoring center as quickly as possible. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A schematic diagram of the superframe structure.
[0053] Figure 2 Schematic diagram of abnormal data of residual chlorine concentration and turbidity.
[0054] Figure 3 This is a diagram of the traditional GTS request frame format.
[0055] Figure 4 This is the GTS characteristics diagram before modification.
[0056] Figure 5 This is the modified GTS characteristics diagram.
[0057] Figure 6 This is the GTS allocation flow chart of the present invention.
[0058] Figure 7 Schematic diagram of the GTS_ACK confirmation frame structure.
[0059] Figure 8 This is a structural block diagram of the scheduling system for preferentially sending abnormal data in the Internet of Things of the present invention.
[0060] Figure 9 This is a diagram of the internal structure of the computer device of the present invention. DETAILED DESCRIPTION
[0061] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0062] See also Figures 1 to 9, the present invention provides a technical solution:
[0063] A scheduling algorithm that prioritizes the transmission of abnormal data in the Internet of Things (IoT). As a low-speed, low-power, short-range communication protocol, IEEE 802.15.4 is widely used for data monitoring and collection in the IoT. IEEE 802.15.4 networks define two types of nodes: Full-Function Device (FFD) nodes and Reduced-Function Device (RFD) nodes. Full-Function Device nodes act as coordinators in the network, enabling communication between FFD nodes and between FFD nodes and RFD nodes. RFD nodes cannot communicate directly with each other or forward data to the outside world; all communication must be accomplished through FFD nodes. IEEE 802.15.4 networks operate in two modes: beacon-enabled and non-beacon-enabled. In beacon-enabled mode, the coordinator periodically broadcasts beacon frames to synchronize relevant nodes and transmit data using the corresponding protocol. In non-beacon-enabled mode, the coordinator does not periodically send beacon frames, but instead sends beacon frames based on requests from other nodes.
[0064] In the beacon-enabled working mode, data transmission and reception are completed through superframes. Superframes consist of two parts: active period and inactive period. Figure 1 shown.
[0065] exist Figure 1In the IEEE 802.15.4 network, the active period in a superframe is divided into 16 time slots, consisting of a contention access period (CAP) and a non-contention access period (CFP). The CFP is further divided into multiple guaranteed time slots or simply "time slots" (GTS). Each GTS can contain one or more time slots. Nodes in an IEEE 802.15.4 network monitor superframes from the coordinator and determine whether they have been assigned a GTS by parsing beacon frames. If not, slotted CSMA / CA (slotted Carrier Sense Multiple Access with Collision Avoidance) is used to compete for the channel in the CAP phase. Time slots in a superframe can be allocated to up to seven nodes and can only be used for the transmission of data frames. Nodes that have been assigned time slots can still transmit data in the CAP. Since various nodes in the IEEE802.15.4 network adopt a self-powered working mode, in order to reduce energy consumption and extend the use time of the node, the node does not send the data immediately after receiving it, but must meet certain trigger conditions (such as the specified time) before sending it.
[0066] IEEE 802.15.4 is used to monitor the quality of tap water during pipeline transportation. Under normal circumstances, changes (increases or decreases) in various monitored indicators during pipeline transportation are relatively gradual, and the data collected by the nodes should not fluctuate significantly. However, any significant changes (increases or decreases) indicate that the tap water quality has been contaminated during transportation.
[0067] like Figure 2 As shown, T1~T tx is a data collection cycle of the node. The monitoring nodes in the pipe network are set at the time T i (i is a positive integer, and 1≤i≤tx) collects and caches data. The last collection T tx After completion, the data in the cache is sent. During the transportation of tap water that meets the standards for domestic drinking water in my country, the residual chlorine concentration and turbidity have become abnormal. tx When the lower and upper limits are exceeded, the tx , the collected data is still stored in the node cache, so that abnormal data (data exceeding the specified upper and lower limits) cannot be sent to the monitoring center in time.
[0068] It can be seen that when the traditional IEEE 802.15.4 network is applied to the field of water quality monitoring, the abnormal data collected by the node is sometimes not sent to the monitoring center immediately, making it impossible for the monitoring center to detect the problem in time and take corresponding measures.
[0069] In addition, in IEEE 802.15.4 networks, nodes that want to send data during the CFP phase must send a GTS request frame in advance in the previous superframe. This GTS request frame needs to compete with other data frames for time slot transmission, and the coordinator allocates time slots in the GTS based on the first-come-first-served (FCFS) principle, further affecting the efficiency of sending abnormal data collected by nodes to the monitoring center as quickly as possible.
[0070] In view of this, the present invention designs a scheduling algorithm for giving priority to sending abnormal data in a beacon-enabled working mode, by setting an emergency sending threshold of the monitored indicator within the upper and lower limit values specified by the monitored indicator (the size of the threshold can be determined by itself according to actual conditions). Once the monitored indicator reaches the threshold, the node applies for a time slot as soon as possible and sends out the data in the cache as soon as possible, so that the monitoring center can take corresponding emergency measures as soon as possible. At the same time, the process of node application and use of time slots in the IEEE802.15.4 network, as well as some frame structures, are modified to achieve the purpose of sending the abnormal data collected by node monitoring to the monitoring center as soon as possible.
[0071] In EEE 802.15.4 networks, beacon frames are sent directly into the channel at the start of a superframe, eliminating contention. By parsing beacon frames, a node can determine whether it has been allocated a time slot during the CFP phase. If so, it remains dormant until the corresponding time slot begins and transmits data. Otherwise, it must compete for a time slot during the CAP phase. The present invention involves three steps: determining and applying the emergency transmission threshold for monitored indicators, requesting a GTS when abnormal data is transmitted, and allocating a GTS when abnormal data is transmitted.
[0072] 1. Determination and application of emergency sending thresholds for monitored indicators
[0073] During the transportation of tap water through the pipeline network, multiple indicators need to be continuously monitored for changes in decreasing trends (such as residual chlorine concentration) or increasing trends (such as turbidity).
[0074] Under normal circumstances, when tap water is transported through the pipe network, the changes in various monitored indicators are very gradual and will not change significantly in a short period of time. However, once the pipe network is damaged or leaks (even if it is minor), the water quality is contaminated and the monitored indicators will change significantly in a short period of time.
[0075] Now assume that there are N monitoring nodes in the pipe network. The present invention will be described by taking the residual chlorine concentration at any node n (n∈N) as an example.
[0076] Combine Figure 2 , the residual chlorine concentration monitoring data table at any monitoring node n in the pipe network can be obtained, as shown in Table 1.
[0077] Table 1 is the residual chlorine concentration monitoring data table at any monitoring node n
[0078]
[0079] Table 1 Refers to the nth node in T i The instantaneous concentration of residual chlorine collected at the time.
[0080] For any monitoring node n in the pipe network, since its location is known, the distance between it and the factory node and the distance to the end user is also known. At the same time, the residual chlorine concentration has the characteristic of slowly decreasing with the increase of the transportation distance. Therefore, under normal circumstances, the roughly reasonable range of variation of the residual chlorine concentration monitored by the monitoring node n twice in a row is It can be derived from experience. The difference in residual chlorine concentration between two consecutive monitorings is recorded as ΔC. It can be determined that the change in residual chlorine concentration in tap water is abnormal.
[0081] 2. GTS application when abnormal data is sent
[0082] Appear To ensure that detected abnormal data is transmitted as quickly as possible, the coordinator must prioritize nodes sending abnormal data when requesting GTS from the coordinator. However, in traditional IEEE 802.15.4 networks, nodes use a uniform format for GTS request frames to request time slots, making it difficult for the coordinator to determine node priority based on the GTS request frames sent. Therefore, it is necessary to modify the traditional GTS request frame to facilitate the coordinator's determination of node priority, thereby enabling nodes to transmit abnormal data as quickly as possible.
[0083] The traditional GTS request frame format is as follows Figure 3 shown.
[0084] In order to distinguish the GTS request frame sent by the node that wants to send abnormal data, it is necessary to Figure 3 Modify the GTScharacteristics part in.
[0085] The GTS characteristics before modification are as follows Figure 4 shown.
[0086] Figure 4 middle,
[0087] ①GTS Length: occupies 4 bits and indicates the requested GTS length, that is, the number of time slots in the superframe;
[0088] ②GTSDirection: occupies 1 bit, indicating the direction of GTS. Here it is 0, indicating from the node to the coordinator;
[0089] ③Characteristics Type: occupies 1 bit, indicating whether to apply for allocation of GTS or application for deletion of GTS. Here, 1 indicates application for allocation of GTS.
[0090] ④Reserve: occupies 2 bits, reserved for use, and is set to 00.
[0091] The modified GTS characteristics section is as follows Figure 5 shown.
[0092] In order to distinguish the GTS request frames sent by the node that wants to send abnormal data, the present invention modifies bits 6 and 7. After the modification, these two bits are used to indicate the priority of the current GTS request frame, which is set to 01.
[0093] Once the coordinator receives a GTS request frame with the value of 01 in bits 6-7 of the GTS characteristics section, it immediately checks whether the number of GTSs currently in use has reached 7, and then checks whether there are enough idle time slots in the active period to allocate GTSs to meet the node's need to send abnormal data. At this time, one of the following three situations will occur:
[0094] (1) If the number of allocated GTSs does not reach 7, the idle time slots in the CFP can meet the GTS requirements of the node when sending abnormal data, and the length of the CAP in the beacon frame is not less than the minimum value allowed by IEEE 802.15.4, the coordinator directly allocates GTSs to the node, writes the allocation plan into the beacon frame to notify the nodes in the network, and updates the CAP length.
[0095] (2) The number of allocated GTSs does not reach 7. After adjusting the CAP length to the minimum value allowed by IEEE 802.15.4, the idle time slots in the CFP still cannot meet the GTS requirements when the node sends abnormal data.
[0096] (3) The number of allocated GTSs reaches 7, and the coordinator cannot meet the GTS requirements when the node sends abnormal data.
[0097] For the above-mentioned cases (2) and (3), IEEE 802.15.4 does not provide corresponding solutions. For these two cases, the present invention provides corresponding solutions.
[0098] 3. GTS allocation when abnormal data is sent
[0099] In order to solve the problem of sending abnormal data as quickly as possible, the present invention proposes two solutions for the cases where the idle time slots in the CFP of the superframe can meet the demand and the idle time slots in the CFP of the superframe cannot meet the demand, such as Figure 6 shown.
[0100] 3.1 CFP in superframe can meet the demand
[0101] After the coordinator receives the request frame to send abnormal data, it executes the following algorithm, as shown below:
[0102] ① Check if the number of allocated GTS has reached 7
[0103] If it reaches 7, check whether there is any GTS that can meet the demand.
[0104] If yes, release the GTS and reallocate it to the node that needs to send abnormal data, and send a GTS_ACK confirmation frame;
[0105] ◇If not, execute ⑥;
[0106] ●If it does not reach 7, go to ②;
[0107] ② Check whether the idle time slots in CFP can meet the demand
[0108] ●If it is satisfied, GTS is allocated to the node that wants to send abnormal data and a GTS_ACK confirmation frame is sent;
[0109] If not, proceed to step ③.
[0110] ③Reduce CAP length and increase CFP length
[0111] After adjusting the CAP and CFP lengths, if the idle time slots in the CFP can meet the demand, the GTS is allocated to the node that wants to send abnormal data, and a GTS_ACK confirmation frame is sent;
[0112] ●If not, proceed to step ④;
[0113] ④ After adjusting the CAP length to the minimum value allowed by IEEE 802.15.4
[0114] ●If the idle time slots in the CFP can meet the demand, GTS is allocated to the node that wants to send abnormal data and a GTS_ACK confirmation frame is sent;
[0115] ●If not, execute ⑤;
[0116] ⑤ If the CAP length is adjusted to the minimum value allowed by IEEE 802.15.4 and still cannot meet the requirements, check whether there is a GTS that can meet the requirements.
[0117] If yes, release the GTS, reallocate it to the node that needs to send abnormal data, and send a GTS_ACK confirmation frame;
[0118] ●If not, go to ⑥;
[0119] ⑥ Release GTS one by one from the rightmost end of the superframe active period. After releasing some GTS, can the demand be met?
[0120] If possible, allocate the released GTS to the node that wants to send abnormal data and send a GTS_ACK confirmation frame;
[0121] ●If not, execute ⑦;
[0122] ⑦ Release all GTS allocated to the node that wants to send abnormal data, send a GTS_ACK confirmation frame, and indicate the number of allocated time slots in the GTS_ACK confirmation frame.
[0123] In this invention, to ensure that exception data is transmitted as quickly as possible, the coordinator is required to enable the GTS_ACK confirmation frame to confirm the GTS request of the node that needs to send exception data. The GTS_ACK confirmation frame also indicates the number of time slots that can be allocated. This allows the node that needs to send exception data to determine whether the number of time slots allocated in the CFP phase of the superframe meets the requirement. If not, the node that needs to send exception data will also use the slotted CSMA / CA channel to compete for sufficient time slots to send the exception data during the CAP phase.
[0124] Different from the ACK confirmation frame in the traditional IEEE 802.15.4 standard, the present invention uses the GTS_ACK confirmation frame for the GTS request. The GTS_ACK confirmation frame structure is as follows: Figure 7 shown.
[0125] exist Figure 7 middle,
[0126] ①Frame Control Field: Length is 2 bytes, the first 3 bits are set to 100 (this value is not used in the traditional IEEE802.15.4 standard), indicating that it is an acknowledgment frame of a GTS request frame;
[0127] ②Data Sequence Number: 1 byte in length, indicating the frame number of the confirmed GTS request frame;
[0128] ③Address: Length is 2 bytes, indicating the short address of the node receiving the GTS_ACK confirmation frame;
[0129] ④GTS Slots: 4 bits in length, indicating the number of time slots allocated by the coordinator;
[0130] ⑤PADDING: Length is 4 bits, used to ensure that the frame length is an integer multiple of 8;
[0131] ⑥Frame Control Sequence: 1 byte in length, used to check the frame.
[0132] 3.2 CFP in superframe cannot meet the demand
[0133] After checking by the coordinator, if the CAP length is adjusted to the minimum value allowed by IEEE 802.15.4 and the CFP in the superframe still cannot meet the requirements, all allocated GTSs are released and reallocated to the node that wants to send abnormal data, and a GTS_ACK confirmation frame is sent to indicate the number of allocated time slots.
[0134] After receiving the GTS_ACK frame, the node intending to send abnormal data realizes that it has only successfully applied for some time slots in the CFP phase. It then uses slotted CSMA / CA to compete for the channel in the CAP phase of the superframe to obtain enough time slots to send the abnormal data. If the channel competition fails, it uses a priority GTS request frame to continue applying for the GTS in the subsequent superframe CFP.
[0135] To address the situation where abnormal data (data exceeding specified upper and lower limits) from monitored indicators during water supply network transmission cannot be promptly transmitted to the monitoring center, this paper proposes a scheduling algorithm based on the beacon-enabled operating mode of the IEEE 802.15.4 network that prioritizes the transmission of abnormal data. This algorithm is explained in detail using the monitored indicator residual chlorine as an example. This scheduling algorithm is also applicable to other monitored indicators in the water supply network and has excellent versatility.
[0136] like Figure 8 As shown, a scheduling system for preferentially sending abnormal data in the Internet of Things is proposed, including:
[0137] The monitoring module is used to adopt node monitoring and set the emergency sending threshold of the monitored indicator within the upper and lower limit values of the monitored indicator. When the monitored indicator reaches the threshold, the node monitoring collects abnormal data;
[0138] The request module is used for the node sending abnormal data to apply for GTS from the coordinator. The coordinator receives the GTS request frame from the node that wants to send abnormal data.
[0139] The sending module is used to force the coordinator to enable the GTS_ACK confirmation frame to confirm the GTS request of the node that needs to send abnormal data, and indicate the number of time slots that can be allocated in the GTS_ACK confirmation frame, so that the node that needs to send abnormal data can determine whether the number of time slots allocated in the CFP phase of the superframe can meet the demand;
[0140] If possible, send the abnormal data through the assigned GTS;
[0141] If not, the node that needs to send abnormal data will also use time slot CSMA / CA to compete for the channel in the CAP phase to obtain enough time GTS to send the abnormal data.
[0142] The computer device provided by the present invention may be a server, and its internal structure diagram may be as follows: Figure 9 As shown. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the above-mentioned optimization method is implemented.
[0143] Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0144] The present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0145] A computer program product is also provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0146] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0147] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0148] The present invention, the undescribed part is the prior art.
[0149] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A scheduling method for preferentially sending abnormal data in the Internet of Things, characterized in that: include: Adopting node monitoring, setting the emergency sending threshold of the monitored indicator within the upper and lower limits of the monitored indicator. When the monitored indicator reaches the threshold, the node monitoring collects abnormal data; The node that sends abnormal data applies for GTS from the coordinator. The coordinator receives the GTS request frame from the node that wants to send abnormal data. The coordinator is required to enable the GTS_ACK confirmation frame to confirm the GTS request of the node that needs to send abnormal data, and indicate the number of time slots that can be allocated in the GTS_ACK confirmation frame, so that the node that needs to send abnormal data can determine whether the number of time slots allocated in the CFP phase of the superframe can meet the demand; If possible, send the abnormal data through the assigned GTS; If not, the node that needs to send abnormal data will also use time slot CSMA / CA to compete for the channel in the CAP phase to obtain enough time slots to send the abnormal data.
2. The scheduling method according to claim 1, wherein: After receiving the GTS request frame from the node that wants to send abnormal data, the coordinator checks whether the number of allocated GTSs has reached 7; If so, check whether there is one that meets the requirements among the allocated GTSs; If not, check whether the idle GTS in the CFP meets the requirements.
3. The scheduling method according to claim 2, wherein: When the number of allocated GTSs reaches 7: If there are timeslots in the allocated GTS that meet the requirements, the coordinator releases the allocated GTS to the node that wants to send abnormal data, and sends a GTS_ACK confirmation frame to indicate the number of allocated timeslots; If none of the allocated GTSs meet the demand, check whether the demand can be met after releasing some GTSs starting from the rightmost end of the superframe active period. When the number of allocated GTSs does not reach 7: If the idle GTS in the CFP meets the requirements, the coordinator allocates GTS to the node that wants to send abnormal data and sends a GTS_ACK confirmation frame to indicate the number of allocated time slots; If the idle GTS in the CFP does not meet the requirements, check whether the idle time slots in the CFP meet the requirements after adjusting the CAP length to the minimum allowed value.
4. The scheduling method according to claim 3, wherein: If GTSs are released one by one starting from the rightmost end of the superframe active period, and the demand can be met after releasing some GTSs, the coordinator releases the allocated GTSs to the node that wants to send abnormal data and sends a GTS_ACK confirmation frame to indicate the number of allocated time slots; If GTSs are released one by one starting from the rightmost end of the superframe active period, and the demand cannot be met after releasing some GTSs, the coordinator releases all allocated GTSs and reallocates them to the node that wants to send abnormal data, and sends a GTS_ACK confirmation frame to indicate the number of allocated time slots.
5. The scheduling method according to claim 3, wherein: When the number of allocated GTSs does not reach 7: If the CAP length is adjusted to the minimum allowed value and the idle time slots in the CFP meet the requirements, the coordinator allocates GTS to the node that wants to send abnormal data and sends a GTS_ACK confirmation frame to indicate the number of allocated time slots; If the idle time slots in the CFP do not meet the requirements after adjusting the CAP length to the minimum allowed value, check whether there are any that meet the requirements in the allocated GTS.
6. The scheduling method according to claim 1, wherein: The structure of the GTS request frame includes from left to right: GTS Length: occupies 4 bits and indicates the requested GTS length, that is, the number of time slots in the superframe; GTSDirection: occupies 1 bit and indicates the direction of GTS. Here, it is 0, indicating from the node to the coordinator. Characteristics Type: occupies 1 bit and indicates whether to apply for GTS allocation or GTS deletion. Here, 1 indicates applying for GTS allocation; Flag: occupies 2 bits and is used to indicate the priority of the current GTS request frame, set to 01.
7. The scheduling method according to claim 1, wherein: The structure of the GTS_ACK confirmation frame includes from left to right: Frame Control Field: 2 bytes in length, with the first 3 bits set to 100, indicating that it is an acknowledgment frame for a GTS request frame. Data Sequence Number: 1 byte in length, indicating the frame number of the confirmed GTS request frame; Address: 2 bytes in length, indicating the short address of the node receiving the GTS_ACK confirmation frame; GTS Slots: 4 bits in length, indicating the number of time slots allocated by the coordinator; PADDING: 4 bits in length, used to ensure that the frame length is an integer multiple of 8; Frame Control Sequence: 1 byte long, used to check the frame.
8. A scheduling system for preferentially sending abnormal data in the Internet of Things, characterized by: include: The monitoring module is used to adopt node monitoring and set the emergency sending threshold of the monitored indicator within the upper and lower limit values of the monitored indicator. When the monitored indicator reaches the threshold, the node monitoring collects abnormal data; The request module is used for the node sending abnormal data to apply for GTS from the coordinator. The coordinator receives the GTS request frame from the node that wants to send abnormal data. The sending module is used to force the coordinator to enable the GTS_ACK confirmation frame to confirm the GTS request of the node that needs to send abnormal data, and indicate the number of time slots that can be allocated in the GTS_ACK confirmation frame, so that the node that needs to send abnormal data can determine whether the number of time slots allocated in the CFP phase of the superframe can meet the demand; If possible, send the abnormal data through the assigned GTS; If not, the node that needs to send abnormal data will also use time slot CSMA / CA to compete for the channel in the CAP phase to obtain enough time slots to send the abnormal data.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.