A cloud-edge collaborative intelligent environmental quality monitoring method and system
By constructing a topology map to identify faulty nodes and assessing the link quality of neighboring nodes, and reconstructing backup paths, the problem of the cloud being unable to monitor the on-site network status in real time was solved, enabling seamless takeover of environmental monitoring data and network self-healing.
Patent Information
- Application Number
- CN202611400347.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-11-17
AI Technical Summary
In existing environmental quality monitoring systems, the cloud cannot monitor the real-time network operation status, resulting in insufficient data continuity assurance due to faulty nodes and monitoring blind spots.
By constructing an initial topology map, analyzing heartbeat messages to identify faulty nodes, assessing the link quality of neighboring nodes, screening candidate nodes, reconstructing backup paths, and generating task takeover instructions, the continuity of data transmission and network self-healing are achieved.
It enables seamless takeover of environmental monitoring data after a faulty node goes offline, ensuring the continuity of data transmission and solving the problem of monitoring blind spots.
Smart Images

Figure CN123123968A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent environmental quality monitoring technology, and in particular to an intelligent environmental quality monitoring method and system based on cloud-edge collaboration. Background Technology
[0002] Currently, environmental quality monitoring has become a crucial support for urban governance and industrial park safety. Continuous collection of indicators such as temperature, humidity, and particulate matter is directly related to pollution early warning and production scheduling. As the monitoring scope expands, the requirements for data real-time performance and coverage completeness are constantly increasing; any data gaps in any area could delay the assessment of sudden environmental problems. However, the existing monitoring system lacks sufficient cloud-based collaboration capabilities, making it difficult for the cloud to monitor the real-time operational status of on-site networks.
[0003] In one existing technology, monitoring relies on fixed acquisition links and centralized data transmission, with the cloud only handling storage and display, lacking awareness of the wireless mesh connectivity between field sensor nodes. Once a node goes offline due to power failure, signal interference, or environmental obstruction, the data path through that node is immediately broken. While neighboring nodes can still collect and forward data, the cloud cannot obtain real-time network topology and neighbor relationships, thus failing to determine which nodes can take over or issue task redistribution commands. The original acquisition task is interrupted along with the failed node, resulting in continuous data loss in the surrounding area and causing gaps in the local environmental monitoring image.
[0004] In summary, existing technologies lack topology awareness and fault node task takeover mechanisms under cloud collaboration, resulting in insufficient data continuity assurance capabilities for faulty nodes. Summary of the Invention
[0005] This invention provides a cloud-edge collaborative intelligent environmental quality monitoring method and system to achieve continuous transmission of environmental monitoring data after a faulty node goes offline.
[0006] Firstly, in order to solve the above-mentioned technical problems, the present invention provides an intelligent environmental quality monitoring method based on cloud-edge collaboration, comprising: Obtain the node status and connection relationship of each sensing device, and construct an initial topology graph based on the node status and connection relationship; The sensor is monitored for messages based on the initial topology diagram to obtain heartbeat messages. The heartbeat status is analyzed based on the heartbeat messages to identify faulty nodes. The coordinates of the faulty node are obtained, and spatial distance is divided according to the coordinates of the faulty node to obtain a set of neighboring nodes. The radio frequency intensity of the sensing device in the set of neighboring nodes is collected, and the quality is evaluated according to the radio frequency intensity to obtain a link quality score. Based on the link quality score, sensor devices are screened to obtain a preliminary set of devices. The data forwarding capability of the preliminary set of devices is evaluated to obtain a sequence of candidate nodes. The candidate node sequence is reconstructed using the shortest path to obtain a backup path. The acquisition parameters of the faulty node are obtained. Based on the acquisition parameters and the backup path, task scheduling is performed to obtain a takeover instruction. The backup path is rebuilt according to the takeover command to obtain the rebuilt path.
[0007] Secondly, the present invention provides an intelligent environmental quality monitoring system based on cloud-edge collaboration, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described above.
[0008] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0009] Compared with the prior art, the present invention has the following beneficial effects: (1) This invention determines the node status and neighboring nodes by reading the operating power and signal strength of each sensing device, establishes the connection relationship through round-trip time and link delay analysis, constructs the initial network topology map, and predicts the expected arrival time based on the receiving timestamp and sequence number of the inner beat message in the historical time period. The number of consecutive loss is determined by the time deviation to identify the fault node, which solves the problem that the cloud cannot grasp the operating status and fault location of the on-site nodes in a timely manner, and realizes the accurate positioning of the fault node.
[0010] (2) This invention obtains the spatial coordinates of the faulty node and divides the normal sensing device into a set of neighboring nodes by spatial distance. It collects the radio frequency signal strength and calculates the signal attenuation and data packet reception rate after smoothing and noise removal. It determines the link quality score through the evaluation matrix. After removing low signal devices, it calculates the data forwarding capability score by combining the remaining energy, node connectivity, forwarding delay and routing hop count. Then, it optimizes the shortest path for the candidate nodes to obtain the backup communication path. This solves the problem of interrupted data path and lack of available forwarding path after the faulty node goes offline in the prior art, and ensures the continuity of data transmission.
[0011] (3) This invention obtains the data type and sampling frequency of the collected data by parsing the historical operation log of the fault node, calculates the estimated value of resource consumption and performs capability screening of candidate routing nodes, determines the protocol conversion rules and generates the message encapsulation format and scheduling and distribution queue, and finally generates the task takeover instruction, controls the candidate routing nodes on the backup communication path to start the data acquisition module and extract the link connectivity identifier to construct the topology mapping matrix, and reconstructs the data path covering the fault area. This solves the problem of the original acquisition task being interrupted synchronously after the fault node goes offline, causing the monitoring blind spot, and realizes seamless takeover of environmental monitoring data and network self-healing. Attached Figure Description
[0012] Figure 1 This is a schematic diagram of a cloud-edge collaborative intelligent environmental quality monitoring method provided in the first embodiment of the present invention. Detailed Implementation
[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0014] Reference Figure 1 The first embodiment of the present invention provides an intelligent environmental quality monitoring method based on cloud-edge collaboration, comprising the following steps: S11, Obtain the node status and connection relationship of each sensing device, and construct an initial topology graph based on the node status and connection relationship; S12, according to the initial topology map, the sensing device is monitored for messages to obtain heartbeat messages, and the heartbeat status is analyzed based on the heartbeat messages to obtain faulty nodes; S13, obtain the coordinates of the faulty node, divide the spatial distance according to the coordinates of the faulty node to obtain a set of neighboring nodes, collect the radio frequency strength of the sensing device in the set of neighboring nodes, and perform quality assessment according to the radio frequency strength to obtain a link quality score. S14, based on the link quality score, the sensing devices are screened to obtain a preliminary set of devices, and the data forwarding capability of the preliminary set of devices is evaluated to obtain a candidate node sequence; S15, perform shortest path reconstruction on the candidate node sequence to obtain backup paths, obtain the acquisition parameters of the faulty node, perform task scheduling based on the acquisition parameters and the backup paths, and obtain takeover instructions; S16, according to the takeover command, the backup path is rebuilt to obtain the rebuilt path.
[0015] In step S11, the node status and connection relationship of each sensing device are obtained, and an initial topology graph is constructed based on the node status and connection relationship, including: Obtain the node status of each sensing device, perform signal analysis between devices based on the node status, and obtain neighboring nodes; Delay time analysis is performed on the sensing device and the neighboring nodes to obtain the connection relationship; The initial topology graph is obtained by constructing topology relationships based on the node states and connection relationships.
[0016] It should be noted that each sensor device broadcasts a status notification frame via its local wireless transceiver module during power-on or network access. The payload fields include the device's unique identifier, two-dimensional installation coordinates, remaining battery percentage, transmit power level, and device type number. These fields combine to form the node status. When any sensor device receives a status notification frame broadcast by another sensor device, it parses the frame structure and stores the field values in its local node status table. The node status table uses a hash structure, with the device's unique identifier as the key. The corresponding values include the horizontal axis value, the vertical axis value, the remaining battery percentage, the transmit power level, and the time of the most recent status update. When the same device broadcasts a status notification repeatedly, only the latest field values are retained, and the status update time is updated.
[0017] Next, signal analysis between devices is performed based on node status to identify neighboring nodes. After each sensing device completes its status announcement, it sends link probe frames at fixed 2-second intervals, with the transmission power consistent with the transmit power level in the status announcement frame. The receiver reads the Received Signal Strength Indicator (RSSI) value after demodulation at the physical layer. The receiver sorts the RSSI of five consecutive probe frames from the same transmitting device in ascending order, and takes the third value after sorting as the estimated RSSI between that device and the transmitting device. The signal strength threshold is set to -80dBm, which is obtained by adding a minimum signal-to-noise ratio margin of 15dB required to guarantee a 1% packet error rate to a receiver sensitivity of -95dBm for the selected wireless transceiver chip. When the estimated RSSI value measured by a device is not less than -80dBm, that device is added to the neighbor candidate set. Only when the estimated RSSI values measured by two devices are both not less than -80dBm are they identified as neighboring nodes; otherwise, no neighbor relationship is established.
[0018] It should be further explained that before performing latency analysis on the sensing devices and neighbor nodes, a time synchronization is first performed between all sensing devices and the aggregation node. After synchronization, the clock deviation between nodes is controlled within 1ms. The aggregation node is the device in the environmental monitoring network responsible for collecting data from various sensing devices and uploading it to the cloud platform. Its deployment location is fixed, and the device type is marked as aggregation type in the status announcement frame. After synchronization, each sensing device sends a latency measurement frame to each neighbor node in its neighbor candidate set. The sending end hardware timestamps when it sends the first byte at the physical layer, and the receiving end also timestamps when it receives the first byte at the physical layer. The receiving end subtracts the two timestamps to obtain the one-way transmission latency. Each neighbor pair is measured three times consecutively, and the maximum value is removed. The arithmetic mean of the remaining two values is then used as the final one-way transmission latency. The latency threshold is set to 500ms. This threshold is determined based on the fact that the single-hop wireless physical transmission latency is usually no more than 10ms and takes into account the queuing and retransmission margin of multi-hop networks. When the final one-way transmission delay does not exceed 500ms, it is determined that there is a valid connection between the neighbor pairs, and the delay value is written into the connection record.
[0019] The initial topology is then stored in an adjacency list. During the initial topology construction, the sink node and all sensors meeting the connection criteria are written into the adjacency list. The sink node does not collect environmental data; it only receives and uploads data. Each entry corresponds to a sensor and includes its unique identifier, two-dimensional coordinates, remaining battery percentage, transmit power level, and a list of neighboring devices. Each entry in the neighboring device list includes the neighboring device's unique identifier, RSSI estimate, final one-way transmission delay, and connection establishment time. If two devices do not form a bidirectional neighbor relationship and do not meet the delay threshold, no connection is established in the adjacency list. After all entries are written, the adjacency list is serialized into a binary file. The file header records the total number of sensors, the total number of connection edges, and the topology generation timestamp. Subsequent reading of this file allows for the complete reconstruction of node attributes and link relationships.
[0020] In step S12, the sensing device is monitored for messages according to the initial topology map to obtain heartbeat messages. Heartbeat status analysis is performed based on the heartbeat messages to identify faulty nodes, including: The sensor devices in the initial topology diagram are monitored for messages to obtain heartbeat messages, and the reception time and sequence number of the heartbeat messages are extracted. Based on the receiving time and the sequence number, the arrival time is predicted to obtain the expected arrival time; The time deviation is obtained by calculating the difference between the expected arrival time and the receiving time; Based on the time deviation and the preset loss threshold, packet loss statistics are performed to obtain the number of consecutive losses; Fault determination is performed based on the number of consecutive data loss and the preset number of fault determinations to obtain the fault node.
[0021] It should be noted that the initial topology uses an adjacency list to store the number of neighbors for each sensor device. The connectivity is calculated by counting the number of neighbors for each device, and the device with the highest connectivity is designated as the heartbeat monitoring device. If multiple devices have the same connectivity, the one with the smallest unique identifier is selected; this device can also be the aggregation node. Simultaneously, the device with the second highest connectivity is selected as the backup heartbeat monitoring device. The backup heartbeat monitoring device continuously listens for heartbeat messages sent by the original heartbeat monitoring device every 5 seconds and maintains a receive timeout counter. Whenever the backup heartbeat monitoring device successfully receives a heartbeat message, the counter is reset to zero and the last received time is updated. If no heartbeat message is received from the original heartbeat monitoring device within three consecutive heartbeat cycles (15 seconds), the original heartbeat monitoring device is considered to have failed. At this point, the backup device automatically switches to the new heartbeat monitoring device, triggering a topology reconstruction process to replenish the backup device.
[0022] The heartbeat monitoring device reads the initial topology binary file, parses it to obtain the unique identifiers of all devices and their neighbor connections, and starts an independent monitoring timer for each device. After each sensor device joins the network, it sends a heartbeat message at a fixed interval of 5 seconds. The heartbeat interval is uniformly configured and distributed by the heartbeat monitoring device. The heartbeat message header sequentially carries the source device's unique identifier, sequence number, and transmission timestamp. The sequence number is a 16-bit unsigned integer, set to 0 for the first transmission and incremented by 1 with each successful transmission. The transmission timestamp is automatically entered by the device's local clock when the first byte is sent at the physical layer. Upon receiving a heartbeat message, the heartbeat monitoring device enters the reception time by its local clock when the first byte is received at the physical layer, and parses the source device's unique identifier and sequence number from the message header, writing them into the heartbeat record table. The heartbeat record table contains the source device's unique identifier, sequence number, reception time, and data reception signal-to-noise ratio.
[0023] Next, arrival time prediction is performed based on the reception time and sequence number. The heartbeat monitoring device maintains the three most recent successfully received heartbeat records for each sensor, extracts the reception time, and calculates the adjacent reception time intervals. If the sequence numbers of the three most recent records are consecutive, the average of two adjacent reception time intervals is taken as the expected interval. If there are fewer than three historical reception records, the heartbeat period of 5 seconds is used directly as the expected interval. If the sequence number of the currently received message is not consecutive with the sequence number of the previous successfully received message, the number of missing sequence numbers is multiplied by the expected interval, and then added to the previous reception time to obtain the expected arrival time of the current message. If the sequence numbers are consecutive, the expected arrival time is equal to the previous reception time plus the expected interval.
[0024] Subsequently, the time deviation is calculated by subtracting the expected arrival time from the received time. The heartbeat monitoring device starts timing at each expected arrival time, with a fixed timing length of 2.5 seconds. If a heartbeat message with the corresponding sequence number is received within 2.5 seconds, the actual reception time is recorded, and the expected arrival time is subtracted from the actual reception time to obtain the time deviation. If the actual reception time is earlier than the expected arrival time, the time deviation is negative; if it is later than the expected arrival time, the time deviation is positive. If the actual reception time exceeds the expected arrival time by 2.5 seconds, or if the message with the corresponding sequence number is not received by the end of the timing period, the heartbeat loss flag is set to 1. In this case, the time deviation is no longer the sole basis for subsequent loss statistics but is directly included in the continuous loss count. The time deviation is recorded in milliseconds, retaining the positive and negative signs for subsequent analysis of device clock drift and link delay variations.
[0025] It's worth noting that the loss threshold is set to 2.5 seconds, half the 5-second heartbeat cycle. If a device fails to arrive within half a cycle after its expected arrival, the value of the received message drops significantly because the device's next heartbeat cycle is imminent. This threshold tolerates single retransmissions and momentary channel congestion while preventing occasional delays from being misjudged as device loss. If widespread obstruction is confirmed in the field, causing a general increase in communication latency, this threshold can be adjusted within the range of 2.5 seconds to 4 seconds. During adjustment, the monitoring timers of all devices should be updated synchronously to maintain consistent judgment standards across the network. When an intermediate sequence number is missing, each missing sequence number is timed out according to its expected arrival time and lost independently, thus preventing the judgment of subsequent sequence numbers from being skewed due to the loss of a single heartbeat.
[0026] It's worth further explaining that the heartbeat monitoring device maintains a continuous loss counter for each sensor, initially set to 0. When the time deviation of a heartbeat record exceeds 2.5 seconds, or when no corresponding sequence number message is received by the end of the count, the continuous loss counter increments by 1. If subsequent heartbeat messages arrive normally within 2.5 seconds, the continuous loss counter resets to 0. If a sequence number is skipped, the number of missing sequence numbers is considered the corresponding message loss count. The continuous loss counter is first incremented by this count, and then reset to 0 or continue incrementing based on whether the currently received heartbeat is normal. The counter update is triggered synchronously when the heartbeat record table is written, ensuring record consistency.
[0027] Finally, fault determination is performed based on the number of consecutive heartbeat loss counts and the number of fault determination counts, with the fault determination count set to 4. This value indicates that the device has failed to report successfully for 4 consecutive heartbeat cycles, with a duration of 20 seconds. Four consecutive failures can rule out 1 to 2 heartbeat loss counts caused by a single sudden interference or momentary obstruction. If the consecutive heartbeat loss counter reaches 4, the heartbeat monitoring device marks the device's unique identifier as a fault node and writes the device's unique identifier, the number of consecutive heartbeat loss counts, the sequence number of the first lost heartbeat, and the expected arrival time of the last lost heartbeat into the fault node set. The fault node set is stored in text line format, with one device per line and fields separated by commas. If the consecutive heartbeat loss counter does not reach 4, the heartbeat monitoring device continues to monitor the device's next heartbeat cycle without marking it as faulty. Heartbeat monitoring of the device does not stop after the fault determination is completed and continues to record for subsequent recovery determination.
[0028] In step S13, the coordinates of the faulty node are obtained, spatial distance is divided according to the coordinates to obtain a set of neighboring nodes, the radio frequency strength of the sensing device within the set of neighboring nodes is collected, and a quality assessment is performed based on the radio frequency strength to obtain a link quality score, including: Obtain the coordinates of the faulty node, remove the faulty node from all the sensing devices to obtain the normal node, and obtain the coordinates of the normal node. Spatial clustering is performed based on the coordinates of the normal nodes to obtain a set of clusters; Calculate the distance between the center coordinates of the cluster set and the coordinates of the faulty node. If the distance does not exceed a preset distance threshold, then the cluster set is taken as the neighboring node set. Based on the set of neighboring nodes, the initial radio frequency strength between the sensing devices is collected and smoothed to obtain the target radio frequency strength; The target radio frequency intensity is subjected to noise removal to obtain a clean radio frequency intensity, and the signal attenuation and data packet reception rate are calculated based on the clean radio frequency intensity. The link quality score is obtained by weighting the signal attenuation and the data packet reception rate.
[0029] It should be noted that the heartbeat monitoring device reads the unique identifier of the faulty node from the set of faulty nodes and retrieves the corresponding two-dimensional installation coordinates from the adjacency list of the initial topology graph. The horizontal and vertical axis values are then used to construct the faulty node coordinates. Subsequently, the node list of the initial topology graph is traversed, faulty nodes are removed, and the remaining sensing devices are treated as normal nodes. The two-dimensional installation coordinates of each normal node are then read from the adjacency list to obtain the set of normal node coordinates.
[0030] Next, spatial clustering is performed based on the coordinates of normal nodes. An initial cluster is created for each normal node. Then, the Euclidean distance between all clusters is calculated. Each time, the two closest clusters are merged into a new cluster. This process is repeated until the minimum distance between any two clusters is greater than the intra-cluster merging distance threshold. The intra-cluster merging distance threshold is set to 15m, determined based on the current sensor deployment density. Deployment requires at least one device per 100m² area, with an average distance of approximately 10m between adjacent devices. Setting the threshold to 1.5 times the average distance (15m) allows for merging spatially adjacent devices within the same cluster while avoiding incorrectly grouping distant devices into the same cluster. After clustering, the device coordinates within each cluster are used to calculate the cluster's center coordinates. The horizontal and vertical axis values of the cluster center coordinates are taken as the average of the coordinates of all normal nodes within that cluster, forming a cluster set.
[0031] It is worth noting that if the distance from the center coordinates of a cluster to the coordinates of the faulty node does not exceed a preset distance threshold, all normal nodes within that cluster are assigned to the neighboring node set. The distance threshold is set to 20m. This threshold is based on the reference communication radius of the wireless transceiver module in an open outdoor environment being 50m. However, neighboring nodes need to provide sufficiently stable RF measurement data that is close to the location of the faulty node; therefore, 40% of the reference communication radius, i.e., 20m, is used as the boundary. This value can be adjusted within the range of 15m to 30m depending on the degree of obstruction on site. 15m is used when there are many metal obstructions, and 30m is used when the environment is open and equipment is sparse. This distance limitation ensures that the sensing devices within the neighboring node set are in a close spatial area to the faulty node, and their RF intensity changes can reflect the channel conditions near the faulty node, reducing irrelevant path loss introduced by distant nodes.
[0032] It is worth further explaining that the RF strength acquisition process is performed by each sensing device within the neighboring node set at its own node. Each device sends link probe frames to other devices in the same cluster at fixed 2-second intervals, and the receiving end reads the RSSI. The RSSI between each pair of nodes is continuously acquired 10 times, with an acquisition time of approximately 20 seconds. To reduce measurement fluctuations caused by multipath fast fading and transient interference, a moving average method is used to smooth the 10 consecutive RSSI values. The window length is 5, and the step size is 1. The arithmetic mean is calculated for the 1st to 5th values, the 2nd to 6th values, and so on up to the 6th to 10th values. Then, the arithmetic mean of all window averages is taken to obtain the target RF strength. The reason for using a window length of 5 is that local fluctuations in the 10 measurements will not change the overall trend, while retaining enough samples for subsequent outlier identification.
[0033] Noise removal begins by arranging all target RF intensities between the same pair of nodes in ascending order, calculating the first and third quartiles, and subtracting them to obtain the interquartile range. Target RF intensities below the first quartile minus 1.5 times the interquartile range or above the third quartile plus 1.5 times the interquartile range are identified as noise and removed, with the remaining values considered clean RF intensities. This decision boundary is derived from the 1.5 times interquartile range criterion commonly used in statistical anomaly detection, effectively removing extreme measurements caused by sudden co-channel interference or momentary obstruction, without requiring a preset noise amplitude. If the number of clean RF intensities for a pair of nodes is less than 5 after removal, a new round of acquisition and smoothing is performed until at least 5 valid values are obtained.
[0034] It's worth noting that signal attenuation is obtained by subtracting the clean RF intensity from the standard transmit power corresponding to the transmitting device's transmit power level. The transmit power level is read from the node status table, and the standard transmit power is the value corresponding to that level, in dBm. The packet reception rate is obtained through data transmission and reception statistics between nodes within the neighboring node set. The transmitting node sends link probe frames at fixed 2-second intervals within a 2-minute monitoring window, for a total of 60 transmissions. The receiving node records the actual number of valid probe frames received, divides the actual number received by the required number of 60 to obtain the packet reception rate, and rounds the result to two decimal places. If a pair of nodes does not achieve bidirectional valid reception, the reception rate is set to 0.
[0035] Subsequently, a weighted evaluation of signal attenuation and packet reception rate is performed to obtain a link quality score. First, the average and standard deviation of signal attenuation among all neighboring node pairs are calculated. The standard deviation is divided by the average to obtain the coefficient of variation of signal attenuation. Then, the average and standard deviation of all packet reception rates are calculated, similarly yielding the coefficient of variation of packet reception rate. The sum of the two coefficients of variation is used as the denominator, and the coefficient of variation of each indicator is divided by this denominator to obtain the corresponding weight. When the average value of an indicator is 0, the weight of that indicator is reset to 0, and the weight of another indicator is reset to 1. The smaller the signal attenuation value, the better the link. It is mapped to the 0-1 interval using minimum-maximum normalization, and then the positive score is obtained by subtracting the value from 1. The packet reception rate itself is in the 0-1 interval, so the original value is used directly. The positive score of signal attenuation is multiplied by the signal attenuation weight, and then the packet reception rate is multiplied by the packet reception rate weight to obtain a link quality score between 0 and 1.
[0036] In step S14, sensing devices are screened based on the link quality score to obtain a preliminary set of devices. The data forwarding capability of this preliminary set of devices is then evaluated to obtain a sequence of candidate nodes, including: The corresponding sensing devices whose link quality scores are lower than the preset link quality threshold are removed to obtain the initial screening set of devices; Extract the remaining energy and node connectivity of the initial screening device set, and perform fuzzy inference to obtain the node activity. Extract the forwarding delay and routing hop count of the initial screening device set, and score the data forwarding capability based on the node activity, forwarding delay, and routing hop count to obtain a data forwarding capability score; The initial screening device set is filtered based on the data forwarding capability score and sorted in descending order to obtain a candidate node sequence.
[0037] It should be noted that the link quality threshold is set to 0.6. This threshold is obtained by normalizing the link quality score based on the RF signal strength elimination threshold of -85dBm. The link quality score is between 0 and 1. A score of 0.6 indicates that the weighted result of the positive score of signal attenuation and the data packet reception rate is not lower than a moderate level, and the current RF signal strength is not lower than -85dBm to ensure that the data forwarding packet error rate is not higher than 1%. During elimination, if a device's link quality score is lower than 0.6, it will be removed from the subsequent evaluation. If a device has multiple sets of link quality score data with multiple neighbors, the lowest link quality score among all neighbors will be taken as the device's final link quality score to ensure that the device is no longer a reliable forwarding node if any link quality is too low. After elimination, the remaining devices form the initial screening device set.
[0038] It's worth noting that remaining energy is read from the node status table, which already records the remaining power percentage of each device when constructing the initial topology graph. Node connectivity is obtained by calculating the length of the neighbor device list corresponding to the device in the initial topology graph's adjacency table, i.e., the number of effective connected neighbors the device has. Remaining energy and node connectivity are used as two input variables for fuzzy inference. The value of remaining energy ranges from 0% to 100%, and the value of node connectivity ranges from 0 to the maximum number of neighbors in the device's network. Fuzzy inference uses the Mamdani inference structure and employs the centroid method for defuzzification, outputting a node activity value between 0 and 1.
[0039] Remaining energy is divided into three linguistic values: low, medium, and high. The membership function uses a triangular function. The vertices of the triangle with low remaining energy are 0%, 0%, and 40%; those with medium remaining energy are 20%, 50%, and 80%; and those with high remaining energy are 60%, 100%, and 100%. Node connectivity is also divided into three linguistic values: low, medium, and high. The membership function also uses a triangular function. The vertices of the triangle with low connectivity are 0, 0, and 4; those with medium connectivity are 2, 5, and 8; and those with high connectivity are 6, 10, and 10. Output node activity is divided into three linguistic values: low activity is 0, 0, and 0.4; medium activity is 0.3, 0.5, and 0.7; and high activity is 0.6, 1, and 1. There are nine fuzzy rules: If the remaining energy is low or the node connectivity is low, the node activity is low; if the remaining energy is low and the node connectivity is medium, the node activity is low; if the remaining energy is low and the node connectivity is high, the node activity is medium; if the remaining energy is medium and the node connectivity is low, the node activity is low; if the remaining energy is medium and the node connectivity is medium, the node activity is medium; if the remaining energy is medium and the node connectivity is high, the node activity is medium; if the remaining energy is high and the node connectivity is low, the node activity is medium; if the remaining energy is high and the node connectivity is medium, the node activity is medium; if the remaining energy is high and the node connectivity is high, the node activity is high.
[0040] In the above rules, activity tends to be low when at least one of the remaining energy and node connectivity is low, reflecting the constraints of limited energy and insufficient connectivity on node reliability; activity is highest when both indicators are high; other combinations take the middle value, reflecting the synergistic effect of the two factors. Rule weights can be started with equal weighting in the early stages of system operation, and subsequently fine-tuned online based on actual node takeover success rate and data packet loss rate. The inflection point parameter of the membership function is determined based on the device battery discharge curve and typical deployment density, and can be fine-tuned after a complete charge-discharge cycle in the field based on the actual energy decay rate and neighbor change frequency.
[0041] It's worth further explaining that the forwarding delay is obtained by reading the connection delay values between the device and all its neighbors from the adjacency table of the initial topology graph, and then calculating the arithmetic mean, in milliseconds (ms). The routing hop count is the shortest path hop count between the device and the aggregation node, calculated based on the initial topology graph according to the minimum hop count principle. Node activity, forwarding delay, and routing hop count are combined into a three-dimensional evaluation index, and each is normalized to the 0-1 range using minimum and maximum normalization. The original node activity value is already in the 0-1 range and is used directly. Forwarding delay and routing hop count are first normalized to a minimum, then subtracted from 1 to obtain a positive score. Weight allocation uses the coefficient of variation method. First, the mean and standard deviation of the three indicators are calculated. The standard deviation is divided by the mean to obtain the coefficient of variation for each indicator. The sum of the three coefficients of variation is used as the denominator. Each indicator's coefficient of variation is divided by this denominator to obtain the corresponding weight. When the mean of an indicator is 0, the weight is reset to 0. Finally, the node activity score of each device is multiplied by the node activity weight, plus the forwarding delay score multiplied by its weight, plus the routing hop count score multiplied by its weight, to obtain the data forwarding capability score, which is between 0 and 1.
[0042] Next, a data forwarding capability screening threshold of 0.5 is set. This threshold is determined based on the normalized average level of the three indicators. When the score reaches 0.5, it indicates that the device's overall forwarding capability is not lower than the average level, and it has the basic conditions to replace the faulty node and complete the data relay. This threshold can be adjusted within the range of 0.4 to 0.6 according to the network load. If the current network has high requirements for forwarding reliability, 0.6 is used; if it is necessary to expand the candidate range to ensure the number of candidates, 0.4 is used. During screening, devices with a data forwarding capability score of not lower than 0.5 are retained, and devices with a score lower than 0.5 are removed. After screening, the retained devices are arranged in descending order of data forwarding capability score to form a candidate node sequence. This sequence is stored directly with the device's unique identifier and corresponding data forwarding capability score. Subsequent steps can select takeover nodes sequentially based on this sequence.
[0043] In step S15, the candidate node sequence is reconstructed using the shortest path to obtain alternative pathways, including: Construct a candidate topology graph based on the candidate node sequence and the faulty node; The faulty nodes and connections are removed from the candidate topology graph to obtain an updated topology graph; The link communication cost is calculated based on the updated topology graph to obtain the adjacency matrix; Shortest path optimization is performed on the adjacency matrix to obtain the shortest path tree. Node sequences are extracted from the shortest path tree to obtain alternative paths.
[0044] It should be noted that when constructing the candidate topology graph, the unique identifiers of all devices in the candidate node sequence are extracted, and the unique identifiers of faulty node devices in the faulty node set are also read. Using these unique device identifiers as keys, the node attribute record and neighbor device list corresponding to each node are extracted from the adjacency table of the initial topology graph. Only the connecting edges whose two ends are both within the aforementioned set of unique device identifiers are retained; the connecting edges not retained are not included in subsequent path calculations. The retained node attribute records and connecting edges are written to a new adjacency table file. The header of the new adjacency table file records the current number of nodes, the number of connecting edges, and the construction timestamp. This new adjacency table serves as the candidate topology graph for path reconstruction.
[0045] It should be noted that the backup path reconstruction first reads all nodes and edges from the adjacency list of the candidate topology graph, and then removes the device unique identifier of the faulty node from the node list. Simultaneously, it iterates through each connection edge in the adjacency list; if one end of an edge is a faulty node, that edge is removed from the connection edge list. After removal, an updated topology graph is generated. The updated topology graph still uses the adjacency list for storage. Each item in the node list retains the device unique identifier, two-dimensional installation coordinates, remaining battery percentage, transmit power level, and a list of neighboring devices. The connection edge list only contains connections where both ends are normal nodes. The updated topology graph does not change the stored content of the candidate topology graph; instead, a separate copy is generated.
[0046] The link communication cost is taken as the final one-way transmission delay corresponding to each connection edge in the updated topology graph. This delay value has been calculated and written into the connection relationship record in the delay time analysis stage of step S11. The final one-way transmission delay of each edge in the updated topology graph is extracted and used as the communication cost of that edge in milliseconds (ms). If an edge has bidirectional delay values, the average of the delays in both directions is taken as the communication cost of that edge. If an edge lacks a delay record in the updated topology graph, a preset default value of 500ms is used to fill it in. When establishing the adjacency matrix, the nodes in the updated topology graph are arranged in ascending order according to their unique device identifiers, numbered sequentially from 0 to n-1, where n is the total number of nodes in the updated topology graph. An n x n two-dimensional matrix is created, where each element represents the link communication cost between two corresponding nodes. If there is a direct connection edge between two nodes, the matrix element is filled with the communication cost value of that edge. If there is no direct connection between two nodes, the matrix element is filled with a null value much larger than the normal communication cost, with the null value set to 10000ms. All diagonal elements of the matrix are set to 0, indicating that the communication cost from a node to itself is 0. This adjacency matrix is used as input for subsequent shortest path optimization algorithms.
[0047] Then, Dijkstra's algorithm is used for shortest path optimization. The source node is selected from the list of neighboring devices corresponding to the faulty node, which is read before the faulty node was deleted. The list of neighboring devices is matched with the candidate node sequence, and the node with the highest data forwarding capability score among the successfully matched neighboring nodes is selected as the source node. This source node is the takeover node that will subsequently undertake the data collection task for the faulty node. The target node is selected as the sink node, which is the aggregation device in this network responsible for uploading data to the cloud platform. The sink node already exists as a node in the initial topology graph, and its unique device identifier can be read from the adjacency list of the initial topology graph. Starting from the source node, the set of nodes with known distances is gradually expanded using the elements in the adjacency matrix as edge weights. Each time, the node closest to the source node is selected from the unprocessed nodes, and the cumulative distance of its neighboring nodes is updated. The process stops when the sink node has been visited. During the process, the predecessor node of each node is recorded. The predecessor node is used to trace back from the target node to the source node to form a complete path, which is the shortest path tree from the source node to the sink node.
[0048] Subsequently, starting from the sink node, the process backtracks step-by-step along the predecessor nodes until the source node, resulting in an ordered sequence of nodes from the source node to the sink node. This sequence is the backup path. The nodes in the backup path are arranged in the order they pass through each intermediate node, starting from the source node, and finally reaching the sink node. If, during the backtracking process, it is found that the sink node cannot reach the source node within a limited number of hops, the current source node is skipped, and the node with the second-highest data forwarding capability score from the faulty node's neighbors is selected as the new source node for recalculation. The backup path is stored in text line format, with each line recording the device's unique identifier sequentially, separated by commas. The heartbeat monitoring device writes this backup path into the link management record for subsequent task takeover.
[0049] In one possible implementation, the acquisition parameters of the faulty node are obtained, and task scheduling is performed based on the acquisition parameters and the backup path to obtain a takeover instruction, including: Obtain the historical operation logs of the faulty node, parse the historical operation logs to obtain the collection type and sampling frequency; Based on the acquisition type and the sampling frequency, resource consumption is estimated to obtain a resource consumption estimate. Based on the resource consumption estimate, the backup path is screened for takeover capability to obtain takeoverable nodes, and protocol conversion rules are generated based on the takeoverable nodes and the faulty nodes. The message encapsulation configuration is performed according to the protocol conversion rules and the sampling frequency to obtain the encapsulated message; The queue is configured according to the encapsulated message to obtain the scheduling queue, and a takeover instruction is generated according to the scheduling queue.
[0050] It should be noted that during normal operation, the faulty node writes the sampling type and sampling frequency of each sampling action to its local storage. The heartbeat monitoring device parses the sampling type and sampling frequency by reading the most recently successfully written record from this storage area. If the faulty node is no longer responding to read requests, the heartbeat monitoring device selects a neighboring node from the backup path. This neighboring node parses the header field of the last successfully sent data packet from the faulty node and reconstructs these two parameters based on the reserved sampling type and sampling frequency bits in the packet header. The sampling type bit is 1 byte, and the sampling frequency bit is 2 bytes. This ensures that the sampling parameters can still be obtained even when the faulty node is completely unreachable, without relying on an additional data source.
[0051] Next, resource consumption is estimated based on the acquisition type and sampling frequency. Each sampling point occupies a fixed 4 bytes of storage space, where 1 byte represents the acquisition type, 2 bytes represent the sampled value, and 1 byte is the checksum. The amount of data generated per unit time is equal to the sampling frequency multiplied by 4 bytes, with the result in bytes per second (B / s). This is then multiplied by 1.08 to obtain the actual number of bytes to be forwarded. The 1.08 comes from the additional overhead of the physical layer preamble and link layer address during transmission, which is fixed at 8% of the effective data according to the wireless protocol used in this network. Subsequently, the total amount of forwarded data is obtained by multiplying the actual number of forwarded bytes by the task duration, which is fixed at 2 hours. Then, the transmission and reception power consumption parameters obtained from the datasheet of the manageable node are converted. The transmission power consumption parameter is taken as 0.03 mAh / KB, and the reception power consumption parameter is taken as 0.01 mAh / KB. These two parameters are obtained from the current consumption specifications of the sensor device's wireless transceiver module and confirmed on-site through current monitoring equipment. The total forwarded data volume is divided by 1024 to convert it to KB, then multiplied by the transmission and reception power consumption parameters, and the two are added together to obtain the base energy consumption. Finally, the base energy consumption is multiplied by 1.05 to obtain the resource consumption estimate. The 1.05 is the additional energy consumption for reserving signal retransmission and queue management.
[0052] It should be noted that each node in the backup path records its remaining power percentage and device type. The remaining power percentage is read from the node status table, which is written when the initial topology is constructed. The remaining power percentage is multiplied by the device's rated battery capacity to obtain the current remaining power, in mAh. The estimated resource consumption is subtracted from the current remaining power to obtain the remaining power after takeover. If the remaining power after takeover is greater than 15% of the rated battery capacity, the node is considered to have basic power support capability. 15% is a minimum power threshold derived from the critical value at which the sensor device's battery may cause irreversible capacity loss during deep discharge. This value is given by the battery manufacturer at the time of device shipment and can be adjusted between 10% and 20% depending on the battery model on site. After power screening, the device type of the node is checked to see if it matches the device type of the faulty node. If they match, the node is directly retained. If they do not match, it is further determined whether the node's hardware contains a sensor module corresponding to the type collected by the faulty node. If it contains the same type of sensor module, the node is also retained; otherwise, it is discarded. The retained nodes form the set of takeover nodes.
[0053] Next, the protocol conversion rules describe how the original acquisition tasks of the failed node are mapped to the local execution configuration of the takeover node. The acquisition type and sampling frequency of the failed node are read, along with the local task identifier of the takeover node. The task identifier is a 16-bit number composed of the local hardware address and module number. In the conversion rules, the original task identifier and acquisition parameters of the failed node are used as keys, and the local task identifier and acquisition parameters of the takeover node are used as values, written to a text mapping file. If the takeover node and the failed node have the same device type, only the task identifier is replaced, while the sampling frequency and acquisition type remain unchanged. If the device types are different but contain the same acquisition module, the acquisition type is mapped to the actual module type used by the takeover node, while the sampling frequency remains unchanged. Each line in the text mapping file contains a key-value pair, with fields separated by commas.
[0054] It's worth further explaining that the encapsulated message header is fixed at 12 bytes, containing, in order, the unique identifier of the destination node, the unique identifier of the source node, the message type, the sequence number, the data length, and a checksum field. The unique identifier of the destination node is filled with the unique identifier of the aggregation node, and the unique identifier of the source node is filled with the unique identifier of the takeover node. The message type is set to 6, indicating a takeover data reporting frame. The sequence number starts at 0 and increments by 1 with each frame sent. The data length is determined based on the sampling frequency and the encapsulation period. The encapsulation period is set to 20ms. The number of sampled points within each encapsulation period is equal to the sampling frequency multiplied by 0.02 and rounded up. The data length is equal to this number multiplied by 4 bytes. The checksum field is calculated using the CRC16 algorithm on the first 11 bytes of the header. The message tail is filled with the corresponding number of sampled data bytes according to the data length. The resulting encapsulated message template is stored in the takeover node's transmission buffer.
[0055] The scheduling queue adopts a priority queue structure with a queue depth of 32 messages. Priorities are divided according to message type. Takeover data reporting messages have a priority of 2, status reporting messages have a priority of 1, and neighbor probe messages have a priority of 0. Each priority queue is scheduled in a first-in, first-out (FIFO) order. The transmission interval of takeover data reporting messages follows the period corresponding to the sampling frequency; multiple sampling points within the same encapsulation period are merged into the same message. Status reporting messages are sent every 5 seconds, and neighbor probe messages are sent every 2 seconds. The transmission clock of the scheduling queue is driven by a local timer on the takeover node, with a timer period of 1ms. At the beginning of each transmission slot, the priority 2 queue is checked first; if a message is available, it is sent immediately; otherwise, the priority 1 queue is checked, and finally, the priority 0 queue is checked.
[0056] The failover command packages the faulty node's parameters, protocol conversion rules, acquisition driver, and interface status into a single takeover instruction based on the configured scheduling queue. Scheduling queue parameters include queue depth, priority allocation, and transmission interval. Protocol conversion rules include the mapping relationship between the faulty node's acquisition task identifier and the takeoverable node's local task identifier. The acquisition driver includes the driver type number and sensor module number. Interface status includes the hardware interface address and interface enable flag. The takeover command is a fixed-length management frame. The frame header contains the total command length and command type fields, while the frame body stores the acquisition driver field, interface status field, scheduling queue parameter field, and protocol conversion rule field sequentially at a fixed offset. The takeover command is then sent to the takeoverable node. After parsing the command, the takeoverable node loads the corresponding acquisition driver, enables the interface, and starts the scheduling queue, thus continuously reporting data to the aggregation node at the faulty node's original sampling frequency.
[0057] In step S16, the backup path is rebuilt according to the takeover command to obtain a rebuilt path, including: The takeover command is parsed to obtain the acquisition driver field and the interface status field; Based on the acquisition driver field and the interface status field, the manageable node is controlled to start data acquisition, thereby obtaining the acquisition channel; Extract the link connectivity identifier of the acquisition channel, and construct a matrix based on the link connectivity identifier to obtain a topology mapping matrix; A path activation message is generated based on the topology mapping matrix, and the path is reconstructed based on the path activation message to obtain the reconstructed path.
[0058] It should be noted that the takeover command is a fixed-length management frame. The frame header contains the total command length and command type fields, while the frame body stores the acquisition driver field, interface status field, scheduling queue parameter field, and protocol conversion rule field sequentially at fixed offsets. During parsing, the total command length field in the frame header is read first to determine the readable range of the entire management frame. Then, the acquisition driver field is read from offset 0 in the frame body. The acquisition driver field is 8 bytes long, with the first 4 bytes being the driver type number and the last 4 bytes being the sensor module number. The driver type number has the same value as the acquisition type: 1 represents temperature acquisition driver, 2 represents vibration acquisition driver, and 3 represents humidity acquisition driver. The interface status field follows immediately after the acquisition driver field and is 8 bytes long. The first 4 bytes are the hardware interface address, and the last 4 bytes are the interface enable flag. A value of 1 indicates that the interface is enabled, and a value of 0 indicates that the interface is disabled. After parsing, two sets of data are obtained: the acquisition driver and the interface status, which are used to drive the specified sensor module on the takeover node.
[0059] Next, based on the acquisition driver and interface status, the takeover node initiates data acquisition to obtain the acquisition channel. The takeover node first loads the driver type number specified in the acquisition driver field from its local driver library and finds the corresponding hardware interface according to the sensor module number. If the driver type number or sensor module number does not exist locally, the takeover command is discarded and a failure response is returned to the aggregation node. If it exists, the enable flag of the corresponding hardware interface is set to 1 according to the interface status field, and the power supply and clock of the interface are started. Subsequently, the takeover node configures the sampling register of the sensor module according to the sampling frequency parameters in the takeover command, causing the hardware to generate sampling data at a specified period. The sampling data is encapsulated locally and then enters the scheduling queue to await transmission. The takeover node applies a uniform encapsulation rule to the acquired data, with each sampling point occupying a fixed 4 bytes, storing the acquisition type, sample value, and checksum in sequence. After being sent from the takeover node, this sampling data arrives at the aggregation node sequentially through each forwarding node in the backup path, forming a logical acquisition channel. The acquisition channel does not change the physical connection of the original backup path; it only binds a data flow from the takeover node to the aggregation node.
[0060] It's worth noting that the link connectivity identifier is composed of the unique identifiers of the two ends of each actual connection edge in the acquisition channel. The connection relationships between manageable nodes and their direct neighbors are read from the adjacency list of the initial topology graph, followed by the connection relationships between those direct neighbors and the next-hop nodes, and so on until the sink node. Each connection record includes the connection establishment time, RSSI estimate, and final one-way transmission delay. The link connectivity identifier is calculated by concatenating the unique identifiers of the two ends in ascending order and then calculating a 32-bit checksum. This checksum is calculated using the CRC32 algorithm on the concatenated byte string to ensure that the identifier calculated for the same connection edge is consistent at both ends. This process avoids the same connection edge being recorded as two different identifiers due to different device unique identifier orders. The link connectivity identifier is extracted from each connection edge traversed by the acquisition channel and stored in a linear list according to the data flow order. This linear list is the link connectivity identifier sequence corresponding to the acquisition channel, which is directly used in subsequent matrix construction.
[0061] Next, the link connectivity identifier sequence corresponding to all device nodes in the backup path and the acquisition channel is obtained. All nodes in the backup path are sorted in ascending order by their unique device identifiers and numbered sequentially from 0 to m minus 1, where m is the number of nodes in the backup path. The topology mapping matrix is an m x m square matrix. The matrix element values follow these rules: if there is a connection edge between two devices corresponding to two numbers belonging to the acquisition channel, the matrix element is filled with 1, indicating that there is a usable transmission connection between the two nodes. If there is no direct connection between two devices corresponding to two numbers, the matrix element is filled with 0. All diagonal elements of the matrix are filled with 0, because no transmission connection needs to be established between nodes and themselves. During construction, each identifier in the link connectivity identifier sequence is traversed, the unique identifiers of the two devices corresponding to that identifier are parsed, and then the corresponding number is found based on the unique device identifier. The corresponding row and column positions in the matrix are then filled with 1. Since the matrix is symmetric, both positions need to be updated simultaneously. The resulting topology mapping matrix can completely express the physical connection relationships and order between each node in the acquisition channel, providing a data foundation for the subsequent generation of path activation messages.
[0062] The generation of the path activation message is performed by the aggregation node. The aggregation node traverses the upper triangular portion of the topology mapping matrix. When it finds a matrix element that is 1, it reads the unique identifiers of the two devices corresponding to that position and generates a connection activation record. The connection activation record contains the unique identifiers of the upstream and downstream devices, an activation flag, and the effective time. The activation flag is always set to 1, and the effective time is the current aggregation node's local time plus 2 seconds. This 2 seconds is used to allow each node time to receive and update its forwarding table. Each connection activation record is presented as an independent field, and these fields are arranged sequentially to form the message body of the path activation message. The path activation message header contains the unique identifiers of the source and destination nodes, and the message type. The destination node's unique identifier is filled with the unique identifier of the downstream device in the connection activation record, and the source node's unique identifier is the aggregation node's unique identifier. The aggregation node generates the corresponding path activation message for each connection edge in the topology mapping matrix and sends it to the corresponding downstream node. Immediately after sending, it sends an acknowledgment request management frame to the downstream node, requesting a response regarding whether the activation flag was successfully set.
[0063] Finally, path reconstruction is performed based on the path activation message. Each downstream node receiving the path activation message parses the unique identifier of the upstream device and the effective time in the message and writes them into its local forwarding relationship table. Each record in the forwarding relationship table contains the unique identifier of the access direction device, the unique identifier of the forwarding direction device, the effective time, and the activation flag. If the downstream node has completed the local forwarding interface configuration by the time the effective time arrives, it replies with a success response to the aggregation node via a management frame. If the configuration fails, it replies with a failure response along with a failure reason field. After receiving responses from all downstream nodes, the aggregation node confirms all connection edges corresponding to successful responses. If all connection edges belonging to the topology mapping matrix receive successful responses, the aggregation node marks the current backup path as active and writes the backup path, its corresponding topology mapping matrix, and connection activation records into the path reconstruction record file. The path reconstruction record file is stored in text line format, with each record containing, in sequence, the unique identifier of the upstream device, the unique identifier of the downstream device, the effective time, and the activation flag. In this way, the reconstructed path completes the conversion from the original backup path to an actual usable transmission channel, and subsequent data can be continuously transmitted from the takeover node to the aggregation node along this reconstructed path.
[0064] In summary, this invention discloses an intelligent environmental quality monitoring method based on cloud-edge collaboration, comprising: acquiring the status and connection relationships of sensor device nodes to construct an initial topology map; listening to heartbeat messages and analyzing heartbeat status to identify faulty nodes; acquiring the coordinates of the faulty node and dividing it into spatial distances to obtain a set of neighboring nodes, and collecting radio frequency strength to evaluate link quality scores; filtering devices based on link quality scores to obtain a preliminary set of devices, and evaluating data forwarding capabilities to obtain a sequence of candidate nodes; reconstructing the candidate node sequence using the shortest path to obtain a backup path; acquiring the collected parameters of the faulty node, and combining them with the backup path for task scheduling to obtain a takeover command; and reconstructing the backup path based on the takeover command to obtain a reconstructed path. This invention, by constructing an initial topology to identify faulty nodes, filtering neighboring nodes to reconstruct backup paths, and generating takeover commands, achieves the integrity and continuous transmission of environmental monitoring data after a faulty node goes offline.
[0065] The second embodiment of the present invention provides an intelligent environmental quality monitoring system based on cloud-edge collaboration, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method described above.
[0066] It should be noted that the cloud-edge collaborative intelligent environmental quality monitoring system provided in this embodiment of the invention is used to execute all the process steps of the cloud-edge collaborative intelligent environmental quality monitoring method in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.
[0067] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0068] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A cloud-edge collaborative intelligent environmental quality monitoring method, characterized in that, include: Obtain the node status and connection relationship of each sensing device, and construct an initial topology graph based on the node status and connection relationship; The sensor is monitored for messages based on the initial topology diagram to obtain heartbeat messages. The heartbeat status is analyzed based on the heartbeat messages to identify faulty nodes. The coordinates of the faulty node are obtained, and spatial distance is divided according to the coordinates of the faulty node to obtain a set of neighboring nodes. The radio frequency intensity of the sensing device in the set of neighboring nodes is collected, and the quality is evaluated according to the radio frequency intensity to obtain a link quality score. Based on the link quality score, sensor devices are screened to obtain a preliminary set of devices. The data forwarding capability of the preliminary set of devices is evaluated to obtain a sequence of candidate nodes. The candidate node sequence is reconstructed using the shortest path to obtain a backup path. The acquisition parameters of the faulty node are obtained. Based on the acquisition parameters and the backup path, task scheduling is performed to obtain a takeover instruction. The backup path is rebuilt according to the takeover command to obtain the rebuilt path.
2. The intelligent environmental quality monitoring method based on cloud-edge collaboration according to claim 1, characterized in that, The step of acquiring the node status and connection relationship of each sensing device, and constructing an initial topology graph based on the node status and connection relationship, includes: Obtain the node status of each sensing device, perform signal analysis between devices based on the node status, and obtain neighboring nodes; Delay time analysis is performed on the sensing device and the neighboring nodes to obtain the connection relationship; The initial topology graph is obtained by constructing topology relationships based on the node states and connection relationships.
3. The intelligent environmental quality monitoring method based on cloud-edge collaboration according to claim 1, characterized in that, The step of listening to messages on the sensing device according to the initial topology map to obtain heartbeat messages, and performing heartbeat status analysis based on the heartbeat messages to identify faulty nodes includes: The sensor devices in the initial topology diagram are monitored for messages to obtain heartbeat messages, and the reception time and sequence number of the heartbeat messages are extracted. Based on the receiving time and the sequence number, the arrival time is predicted to obtain the expected arrival time; The time deviation is obtained by calculating the difference between the expected arrival time and the receiving time; Based on the time deviation and the preset loss threshold, packet loss statistics are performed to obtain the number of consecutive losses; Fault determination is performed based on the number of consecutive data loss and the preset number of fault determinations to obtain the fault node.
4. The intelligent environmental quality monitoring method based on cloud-edge collaboration according to claim 1, characterized in that, The process involves obtaining the coordinates of the faulty node, dividing the space based on the coordinates to obtain a set of neighboring nodes, collecting the radio frequency (RF) strength of the sensing devices within the set of neighboring nodes, and performing a quality assessment based on the RF strength to obtain a link quality score, including: Obtain the coordinates of the faulty node, remove the faulty node from all the sensing devices to obtain the normal node, and obtain the coordinates of the normal node. Spatial clustering is performed based on the coordinates of the normal nodes to obtain a set of clusters; Calculate the distance between the center coordinates of the cluster set and the coordinates of the faulty node. If the distance does not exceed a preset distance threshold, then the cluster set is taken as the neighboring node set. Based on the set of neighboring nodes, the initial radio frequency strength between the sensing devices is collected and smoothed to obtain the target radio frequency strength; The target radio frequency intensity is subjected to noise removal to obtain a clean radio frequency intensity, and the signal attenuation and data packet reception rate are calculated based on the clean radio frequency intensity. The link quality score is obtained by weighting the signal attenuation and the data packet reception rate.
5. The intelligent environmental quality monitoring method based on cloud-edge collaboration according to claim 1, characterized in that, The process involves screening sensing devices based on the link quality score to obtain a preliminary set of devices, and then evaluating the data forwarding capabilities of the preliminary set of devices to obtain a sequence of candidate nodes, including: The corresponding sensing devices whose link quality scores are lower than the preset link quality threshold are removed to obtain the initial screening set of devices; Extract the remaining energy and node connectivity of the initial screening device set, and perform fuzzy inference to obtain the node activity. Extract the forwarding delay and routing hop count of the initial screening device set, and score the data forwarding capability based on the node activity, forwarding delay, and routing hop count to obtain a data forwarding capability score; The initial screening device set is filtered based on the data forwarding capability score and sorted in descending order to obtain a candidate node sequence.
6. The intelligent environmental quality monitoring method based on cloud-edge collaboration according to claim 1, characterized in that, The step of reconstructing the shortest path from the candidate node sequence to obtain alternative pathways includes: Construct a candidate topology graph based on the candidate node sequence and the faulty node; The faulty nodes and connections are removed from the candidate topology graph to obtain an updated topology graph; The link communication cost is calculated based on the updated topology graph to obtain the adjacency matrix; Shortest path optimization is performed on the adjacency matrix to obtain the shortest path tree. Node sequences are extracted from the shortest path tree to obtain alternative paths.
7. The intelligent environmental quality monitoring method based on cloud-edge collaboration according to claim 1, characterized in that, The process of acquiring the collection parameters of the faulty node, performing task scheduling based on the collection parameters and the backup path, and obtaining a takeover instruction includes: Obtain the historical operation logs of the faulty node, parse the historical operation logs to obtain the collection type and sampling frequency; Based on the acquisition type and the sampling frequency, resource consumption is estimated to obtain a resource consumption estimate. Based on the resource consumption estimate, the backup path is screened for takeover capability to obtain takeoverable nodes, and protocol conversion rules are generated based on the takeoverable nodes and the faulty nodes. The message encapsulation configuration is performed according to the protocol conversion rules and the sampling frequency to obtain the encapsulated message; The queue is configured according to the encapsulated message to obtain the scheduling queue, and a takeover instruction is generated according to the scheduling queue.
8. The intelligent environmental quality monitoring method based on cloud-edge collaboration according to claim 7, characterized in that, The step of reconstructing the backup path according to the takeover instruction to obtain the reconstructed path includes: The takeover command is parsed to obtain the acquisition driver field and the interface status field; Based on the acquisition driver field and the interface status field, the manageable node is controlled to start data acquisition, thereby obtaining the acquisition channel; Extract the link connectivity identifier of the acquisition channel, and construct a matrix based on the link connectivity identifier to obtain a topology mapping matrix; A path activation message is generated based on the topology mapping matrix, and the path is reconstructed based on the path activation message to obtain the reconstructed path.
9. A cloud-edge collaborative intelligent environmental quality monitoring system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method described in any one of claims 1 to 8.
