Wireless sensor network networking method for farmland environment monitoring

By optimizing the wireless sensor network for farmland environmental monitoring through hierarchical node management, dynamic routing algorithms, and blockchain technology, the problems of data redundancy, suboptimal transmission paths, and security risks have been solved, achieving efficient, reliable data transmission and security.

CN118803848BActive Publication Date: 2024-11-15ZHEJIANG FORESTRY UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411265961.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-11-15
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

Existing wireless sensor networks suffer from problems such as data redundancy, suboptimal transmission paths, security risks, and network congestion in farmland environmental monitoring, affecting the timeliness and data integrity of agricultural environmental monitoring.

Method used

By employing hierarchical node management, energy-aware dynamic routing algorithms, edge computing, and blockchain technology, data acquisition and processing are optimized through a hierarchical structure, and transmission paths are dynamically adjusted to ensure data security and integrity.

Benefits of technology

It improves data processing efficiency and transmission reliability, reduces network latency and data loss, enhances system security and adaptability, and ensures stable operation under different load and energy consumption conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118803848B_ABST
    Figure CN118803848B_ABST
Patent Text Reader

Abstract

The present invention provides a wireless sensor network networking method for farmland environment monitoring, which relates to the technical field of sensor network networking. The present invention classifies and places sensor nodes for processing, basic nodes collect data, advanced nodes aggregate data, edge computing nodes process data and generate path cost thresholds, and adopts energy-aware dynamic routing algorithms to select data transmission paths. Edge computing nodes receive data, perform data fusion and compression, control facilities in real time according to farmland environment models, generate control signals, use hash algorithms to process signals, and participate in consensus mechanisms. The network regularly evaluates control signals. If the node energy consumption is too high, the system will automatically adjust the node task volume to ensure that the network works effectively under different loads and energy consumption. The present invention effectively monitors the farmland environment in real time through hierarchical node distribution, dynamic routing optimization, edge computing data processing, and blockchain security mechanisms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of sensor network networking, and in particular to a wireless sensor network networking method for farmland environment monitoring. Background Art

[0002] Network networking technology is a network framework formed by the formation of network nodes, which involves the deployment of nodes, the design of topology structure, the selection of communication protocols, etc. In order to ensure the reliable transmission of data, specific routing protocols, data fusion algorithms and energy-saving mechanisms are usually adopted to enable the network to operate efficiently and with low energy consumption in the farmland environment. Networking technology has many significant advantages in farmland environmental monitoring, which helps to improve agricultural production efficiency, environmental protection and resource management. However, the current network networking technology is often affected by the terrain and the distribution of the number of equipment, resulting in weak signals or even incomplete coverage. If data processing cannot be processed and analyzed in real time, it may delay the response to changes in the agricultural environment and affect the timeliness of decision-making. Especially in network networking technology, wireless sensor networks and other network devices may have security vulnerabilities and are vulnerable to cyber attacks, data tampering or malware. The data collected in the agricultural environmental monitoring system may be very sensitive, involving information such as the growth status of crops and soil quality. Protecting this data from cyber attacks and unauthorized access is an important challenge.

[0003] In the prior art, publication number CN114554626A discloses a wireless sensor network networking method for Internet of Things data transmission. By obtaining the networking information of the wireless sensor network, using the networking information to connect to the wireless network, the wireless sensor network is grouped, and the wireless sensor network is divided into grids. There are several sensor nodes in each grid, which are grouped according to user needs. There is no need to add extra buttons to the sensor with limited space. By downloading the wireless sensor network data method, the defects of low data collection reliability and low data transmission efficiency in the prior art can be overcome, so as to achieve the characteristics of high data collection reliability and high data transmission efficiency.

[0004] Insufficient existing technology:

[0005] Although the existing network networking method solves the problem of insufficient sensor space by dividing the wireless sensor network into grids and placing sensor nodes in the grids, if all sensor nodes are at the same level or classification, they may collect and process duplicate or irrelevant data, thereby increasing data redundancy. In addition, different categories of nodes require different routing strategies. Unclassified nodes may result in suboptimal data transmission paths and uneven distribution of tasks among nodes.

[0006] Although the method of directly downloading wireless sensor data can overcome the defects of low data collection and transmission efficiency, it is easy to cause network congestion during the download process due to the failure to select a suitable transmission path and a suitable node for processing data. In addition, directly downloading external wireless sensor data has security risks and can easily lead to malicious modification of data, causing economic losses.

[0007] Therefore, it is necessary to provide a wireless sensor network networking method for farmland environment monitoring to solve the above problem.

[0008] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention

[0009] The purpose of the present invention is to provide a wireless sensor network networking method for farmland environment monitoring to solve the problems raised in the above background technology.

[0010] To achieve the above object, the present invention provides the following technical solutions:

[0011] A wireless sensor network networking method for farmland environment monitoring, the specific steps include:

[0012] Step 1: Distribute sensor nodes in the farmland as needed and divide them into basic nodes, advanced nodes and edge computing nodes. Basic nodes are responsible for collecting basic data in the farmland, advanced nodes are responsible for data aggregation of multiple basic nodes, and edge computing nodes calculate the aggregated data to generate path cost thresholds.

[0013] Step 2: When each node is initialized, an energy-aware dynamic routing algorithm is used to select a data transmission path based on the current remaining energy of each node and the energy status of neighboring nodes. When the cost of a route exceeds the path cost threshold, the network will automatically find a new path alternative;

[0014] Step 3: Receive the data transmitted along the path through the edge computing node, fuse and compress the data, control the farmland facilities in real time according to the preset farmland environment model, calculate the entropy value of the fused data and generate a control signal with the expected median value of the model parameter;

[0015] Step 4: Before the control signal is written into the blockchain, the control signal is hashed using a hash algorithm, and the processed control signal is used to participate in the consensus mechanism to ensure the security of the process of writing the control signal into the blockchain;

[0016] Step 5: The network networking system regularly evaluates the processed control signals and sets the node energy consumption threshold. When the node energy consumption exceeds the threshold, the system will trigger the adjustment mechanism to reallocate the task volume to the node to ensure effective operation under different loads and energy consumption.

[0017] Furthermore, in step 1, the sensor nodes are distributed as needed, and the specific method is as follows: the basic nodes are set in the farmland according to the principle of uniform and equal spacing, and the node density should meet the full area coverage, and redundancy is ensured within the communication range of the sensor; the farmland is divided into multiple areas, and multiple high-level nodes are set one by one at the geometric center of each area. The position of the edge computing node is determined with the constraint condition of minimizing the sum of the distances between the edge computing node and each high-level node.

[0018] Furthermore, in step 1, the edge computing node calculates the aggregated data, and the specific method for generating the path cost threshold is based on: the energy consumption of the collected data transmitted between nodes, the computing resource consumption required by the node to process the data, and the power consumed by the node to complete the transmission and computing tasks. The path cost threshold is set based on the average cost and variance. The logic for generating the path cost threshold based on the number of all paths in the farmland is as follows:

[0019] ;

[0020] ;

[0021] ;

[0022] ;

[0023] in, , , Respectively represent the first The transmission cost, computing cost, and energy consumption cost of each node. , , They represent the proportion of transmission, computation and energy consumption in the path cost respectively. represents the comprehensive cost of the path, represents the average path cost, represents the variance of the comprehensive cost of the path, represents the number of nodes on the path, represents the number of all paths in the farmland, Indicates The combined cost of the paths, represents the path cost threshold, Indicates the adjustment coefficient, the value is between 1 and 2.

[0024] Furthermore, in step 2, an energy-aware dynamic routing algorithm is used in the network topology structure. Each node selects a data transmission path according to the current remaining energy and the energy status of neighboring nodes. The specific method is as follows: the next hop node is selected by the calculated routing cost. The current node selects the node with the smallest routing cost among the neighboring nodes as the next hop. When selecting a path, if the calculated routing cost exceeds the path cost threshold, the path is considered unsuitable for continued use. The node will recalculate other available paths. When the remaining energy of the node itself or the neighboring nodes is lower than the set energy threshold, the routing update will be triggered to find a new available path. The specific logic is as follows:

[0025] ;

[0026] ;

[0027] in, Indicates that from the current node To neighboring nodes The required transmission energy consumption, Indicates the current node The remaining energy, Represents neighboring nodes The remaining energy, Indicates the current node To neighboring nodes The transmission distance between , , They represent the corresponding transmission energy consumption, the remaining energy of the neighboring nodes, and the weight ratio of the transmission distance. Indicates the minimum energy threshold set. Indicates the path update judgment value. When , the routing update is triggered to find a new available path; when No routing update is triggered.

[0028] Furthermore, in step 3, the edge computing node receives the data transmitted along the path, and fuses and compresses the data. The specific method is as follows: after the edge computing node receives the data from the path sensor, it fuses the data using a weighted average mechanism, uses differential coding to reduce data redundancy, and then uses entropy coding to further compress the data volume. The specific logic is as follows:

[0029] ;

[0030] ;

[0031] in, Indicates Nodes in The fusion data at the moment, Indicates The weight of the node, Indicates Nodes at time The measured value of Indicates Nodes in The fusion data at the moment, express Differential data at time.

[0032] Furthermore, in step 3, the entropy value of the fused data is calculated and used to generate a control signal with the expected median value of the model parameter. The specific logic is as follows:

[0033] ;

[0034] ;

[0035] ;

[0036] ;

[0037] in, Indicates Nodes The entropy value of the differential data at time, Represents differential data The probability distribution of Represents the entropy value set of node differential data, represents the set of expected values ​​of parameters in the environmental model, represents the weighted sum of the differential data of the current node, represents the median expectation in the environmental model, represents the synthetically generated control signal, Indicates the expected quantity.

[0038] Furthermore, in step 4, before the control signal is written into the blockchain, the control signal is hashed using a hash algorithm, and the processed control signal is used to participate in the consensus mechanism to ensure the safety of the control signal writing process into the blockchain. The specific method is as follows: the control signal first passes through a secure hash function to calculate its hash value, and then is confirmed by the consensus mechanism, and the hash value is broadcast to other nodes in the network. Other nodes calculate and verify the hash value. If it is equal to the previously obtained hash value, it is confirmed that the data has not been tampered with. The specific logic is as follows:

[0039] ;

[0040] ;

[0041] ;

[0042] in, Indicates control signal Through hash algorithm The generated hash value, Indicates that the hash function processes a fixed-length 256-bit hash value. Indicates the hash value authenticated by other nodes. Indicates the judgment value of the hash value verification mechanism. When , it means that the hash value has not been tampered with, and the control signal is written into the blockchain; , it indicates that the hash value has been tampered with, preventing the control signal from being written into the blockchain.

[0043] Furthermore, in step 5, if it is detected that the node energy consumption is too high, the system will trigger the adjustment mechanism to reallocate the task amount to the node. The specific method is as follows: when it is detected that any path cost exceeds the path cost threshold or the energy consumption rate of a node is too fast, the network networking system uses dynamic task reallocation to migrate the high-energy consumption node tasks to the nodes with lower energy consumption. By using the inverse proportional relationship between the re-adjustment of tasks and energy consumption, the node with less remaining energy has a greater reduction in tasks; the node with more remaining energy has a smaller reduction in tasks. The specific logic is as follows:

[0044] ;

[0045] ;

[0046] in, Representation Node The energy consumption scheduling priority, Representation Node exist The remaining energy at the moment, Indicated in Time Node The amount of tasks assigned, Indicated in The amount of tasks assigned to the time node after adjustment, Represents the maximum remaining energy of the nodes in the system.

[0047] Compared with the prior art, the present invention has the following beneficial effects:

[0048] The present invention optimizes the process of data collection, aggregation and processing through hierarchical node management. This hierarchical structure not only improves data processing efficiency, but also reduces network congestion and data transmission delay. The dynamic routing algorithm improves the reliability and efficiency of data transmission and reduces data loss and delay through energy perception and real-time path adjustment.

[0049] The present invention also ensures the security and integrity of control signals during transmission and storage through the application of blockchain technology, hash algorithms and consensus mechanisms, prevents data tampering and forgery, and enhances the credibility of the system. In addition, the intelligent adjustment and load balancing mechanism enables the system to dynamically adjust task allocation according to changes in path costs and node energy consumption, ensuring stable operation under different load and energy consumption conditions, and improving the adaptability and long-term stability of the system.

[0050] The present invention significantly improves the data processing efficiency, transmission reliability, security and adaptability of the system through hierarchical node management, dynamic routing algorithm, blockchain technology and intelligent adjustment mechanism. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is a schematic diagram of the overall method flow of the present invention. DETAILED DESCRIPTION

[0052] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.

[0053] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0054] Example:

[0055] See also Figure 1 , a wireless sensor network networking method for farmland environment monitoring, the specific steps include:

[0056] Step 1: Distribute sensor nodes in the farmland as needed and divide them into basic nodes, advanced nodes and edge computing nodes. Basic nodes are responsible for collecting basic data in the farmland, advanced nodes are responsible for data aggregation of multiple basic nodes, and edge computing nodes calculate the aggregated data to generate path cost thresholds.

[0057] Step 2: When each node is initialized, an energy-aware dynamic routing algorithm is used to select a data transmission path based on the current remaining energy of each node and the energy status of neighboring nodes. When the cost of a route exceeds the path cost threshold, the network will automatically find a new path alternative;

[0058] Step 3: Receive the data transmitted along the path through the edge computing node, fuse and compress the data, control the farmland facilities in real time according to the preset farmland environment model, calculate the entropy value of the fused data and generate a control signal with the expected median value of the model parameter;

[0059] Step 4: Before the control signal is written into the blockchain, the control signal is hashed using a hash algorithm, and the processed control signal is used to participate in the consensus mechanism to ensure the security of the process of writing the control signal into the blockchain;

[0060] Step 5: The network networking system regularly evaluates the processed control signals and sets the node energy consumption threshold. When the node energy consumption exceeds the threshold, the system will trigger the adjustment mechanism to reallocate the task volume to the node to ensure effective operation under different loads and energy consumption.

[0061] It should be noted that the basic nodes focus on data collection, the advanced nodes are responsible for data aggregation, and the edge computing nodes perform complex data calculations and decision-making. This hierarchical structure optimizes the data flow and processing process, improves the overall efficiency and response speed of the system, and improves the overall efficiency and response speed of the system. Hierarchical management enables the system to effectively share the task load of different nodes, reduce data transmission and network congestion. At the same time, by clarifying the roles and responsibilities of each node, the system can quickly adjust and maintain stable operation when encountering node failures or energy consumption problems.

[0062] Therefore, it is necessary to distribute the sensor nodes as needed. The specific method is as follows: the basic nodes are set in the farmland according to the principle of uniform and equal spacing, and the node density should meet the full area coverage and ensure redundancy within the communication range of the sensor; the farmland is divided into multiple areas, and multiple advanced nodes are set one by one at the geometric center of each area. The position of the edge computing node is determined with the constraint of minimizing the sum of the distances between the edge computing node and each advanced node.

[0063] It should be noted that advanced nodes aggregate data from multiple basic nodes, reducing the complexity of data transmission. Edge computing nodes are responsible for calculating and generating path cost thresholds, making data processing and decision-making more efficient, thereby improving the overall response speed and processing capabilities of the system. The establishment of edge computing nodes can calculate and manage data more accurately and generate effective path cost thresholds, which helps to dynamically adjust data transmission paths in the network and optimize resource utilization and network performance.

[0064] Therefore, it is necessary to calculate the aggregated data on the edge computing nodes. The specific method for generating the path cost threshold is based on: the energy consumption of the collected data transmitted between nodes, the computing resource consumption required for the nodes to process the data, and the power consumed by the nodes to complete the transmission and computing tasks. The path cost threshold is set based on the average cost and variance. The logic for generating the path cost threshold based on the number of all paths in the farmland is as follows:

[0065] ;

[0066] ;

[0067] ;

[0068] ;

[0069] in, , , Respectively represent the first The transmission cost, computing cost, and energy consumption cost of each node. , , They represent the proportion of transmission, computation and energy consumption in the path cost respectively. represents the comprehensive cost of the path, represents the average path cost, represents the variance of the comprehensive cost of the path, represents the number of nodes on the path, represents the number of all paths in the farmland, Indicates The combined cost of the paths, represents the path cost threshold, Indicates the adjustment coefficient, the value is between 1-2. , , The size relationship is In the networking of farmland sensor networks, the battery life and energy consumption of nodes are crucial. High energy consumption not only reduces the service life of nodes, but may also lead to a decline in the overall performance of the system, so the weight accounts for the highest proportion; the data transmission cost directly affects the efficiency of data flow and network load, but the optimization of transmission paths can be improved to a certain extent through protocols and network design, so the weight of adjusting transmission accounts for the second; the computing cost involves the computing resources required for node data processing, but it can usually be alleviated by improving algorithms or using efficient processors, so the computing cost weight accounts for the lowest proportion.

[0070] It should be noted that in order to extend the life of the network, the network system must be optimized for energy conservation and reduce premature node failure. The energy-aware dynamic routing algorithm can optimize the data transmission path according to the remaining energy of each node and the energy status of the adjacent nodes. This approach helps to balance the energy consumption of each node in the network and prevent some nodes from prematurely exhausting their batteries due to frequent data transmission, thereby extending the service life of the entire network. By dynamically selecting paths, the repeated use of high-energy consumption paths is avoided, which can significantly reduce the risk of node failure due to excessive energy consumption.

[0071] Therefore, it is necessary to adopt an energy-aware dynamic routing algorithm in the network topology. Each node selects the data transmission path according to the current remaining energy and the energy status of the neighboring nodes. The specific method is as follows: the next hop node is selected by the calculated routing cost. The current node selects the node with the smallest routing cost among the neighboring nodes as the next hop. When selecting a path, if the calculated routing cost exceeds the path cost threshold, the path is considered unsuitable for continued use, and the node will recalculate other available paths. When the remaining energy of the node itself or the neighboring nodes is lower than the set energy threshold, the routing update will be triggered to find a new available path. The specific logic is as follows:

[0072] ;

[0073] ;

[0074] in, Indicates that from the current node To neighboring nodes The required transmission energy consumption, Indicates the current node The remaining energy, Represents neighboring nodes The remaining energy, Indicates the current node To neighboring nodes The transmission distance between , , They represent the corresponding transmission energy consumption, the remaining energy of the neighboring nodes, and the weight ratio of the transmission distance. Indicates the minimum energy threshold set. Indicates the path update judgment value. When , the routing update is triggered to find a new available path; when When , no routing update is triggered. , , The size relationship is , according to which the energy consumption of each data transmission must be considered when selecting a path for a node. Higher transmission energy consumption will quickly consume the energy of the node, thereby reducing the stability and life of the network. Therefore, the weight of transmission energy consumption should be the largest to ensure that the impact of energy consumption during transmission is minimized; the energy status of neighboring nodes is also important for path selection, because selecting neighboring nodes with sufficient energy helps to ensure the reliability and stability of the path. However, compared with the transmission energy consumption, the impact of the remaining energy of the neighboring nodes is secondary, so the weight Should be less than Although distance is a factor that affects energy consumption, transmission distance usually does not directly affect the battery life of the node as much as transmission energy consumption. Therefore, the weight of transmission distance is It should be minimal to balance other factors that more directly affect energy expenditure.

[0075] It should be noted that edge computing nodes can significantly reduce the amount of data transmission, reduce bandwidth requirements and network burden by locally fusing and compressing data. By integrating data from multiple sensors, edge computing nodes can generate a more comprehensive and accurate view of the environment, while reducing duplicate data and redundant information, and improving data processing efficiency. Edge computing nodes can process data in real time at or near the source of data generation, without having to send all data to a central server. This processing method reduces latency and enables the system to respond quickly to environmental changes and achieve real-time control.

[0076] Therefore, it is necessary to receive the data transmitted along the path through the edge computing node, fuse and compress the data. The specific method is: after the edge computing node receives the data from the path sensor, it adopts the weighted average mechanism to fuse the data, uses differential coding to reduce the redundancy of the data, and then uses entropy coding to further compress the data volume. The specific logic is:

[0077] ;

[0078] ;

[0079] in, Indicates Nodes in The fusion data at the moment, Indicates The weight of the node, Indicates Nodes at time The measured value of Indicates Nodes in The fusion data at the moment, express Differential data at time.

[0080] It should be noted that entropy is an important indicator in information theory, which is used to measure the uncertainty or information content of data. By calculating the entropy of fused data, the complexity of the data and the stability of the system can be evaluated. This information can be used to adjust the system's control strategy to cope with environmental uncertainty and changes. Comparing the entropy value with the expected median value of the model parameters can help the system make adaptive adjustments in the face of environmental changes. If the entropy value deviates from the expected median value, it may indicate that environmental conditions have changed or the model prediction is inaccurate. The system can adjust the control strategy accordingly to maintain the best management effect.

[0081] Therefore, it is necessary to calculate the entropy value of the fused data and generate a control signal with the expected median value of the model parameters. The specific logic is as follows:

[0082] ;

[0083] ;

[0084] ;

[0085] ;

[0086] in, Indicates Nodes The entropy value of the differential data at time, Represents differential data The probability distribution of Represents the entropy value set of node differential data, represents the set of expected values ​​of parameters in the environmental model, represents the weighted sum of the differential data of the current node, represents the median expectation in the environmental model, represents the synthetically generated control signal, Indicates the expected quantity.

[0087] It should be noted that in order to ensure data integrity and non-tamperability, the control signal is hashed to generate a unique hash value, which can ensure data integrity. Any slight change in the hash value will result in a huge change in the hash result, which makes any tampering of the control signal detectable, thereby ensuring the non-tamperability of the data. In the blockchain, the storage and verification of the hash value can ensure that the control signal has not been tampered with or forged during the writing process. Any tampering attempt will result in a mismatch in the hash value, which will be detected and rejected by the nodes in the network. The use of hashed control signals to participate in the consensus mechanism can ensure the legitimacy and authenticity of the control signal by verifying the hash value through multiple nodes. The consensus mechanism ensures that all participating nodes reach an agreement on the validity of the data, thereby improving the system's trust in the control signal. By participating in the consensus mechanism, it can effectively prevent the malicious behavior of a single node or the impact of erroneous data on the entire system, ensuring that only legally verified control signals can be recorded in the blockchain.

[0088] Therefore, it is necessary to use a hash algorithm to hash the control signal before writing it into the blockchain, and use the processed control signal to participate in the consensus mechanism to ensure the safety of the control signal writing process into the blockchain. The specific method is as follows: the control signal first passes through a secure hash function to calculate its hash value, and then is confirmed by the consensus mechanism, and the hash value is broadcast to other nodes in the network. Other nodes calculate and verify the hash value. If it is equal to the previously obtained hash value, it is confirmed that the data has not been tampered with. The specific logic is as follows:

[0089] ;

[0090] ;

[0091] ;

[0092] in, Indicates control signal Through hash algorithm The generated hash value, Indicates that the hash function processes a fixed-length 256-bit hash value. Indicates the hash value authenticated by other nodes. Indicates the judgment value of the hash value verification mechanism. When , it means that the hash value has not been tampered with, and the control signal is written into the blockchain; , it indicates that the hash value has been tampered with, preventing the control signal from being written into the blockchain.

[0093] It should be noted that monitoring node energy consumption and making adjustments can prevent some nodes from consuming energy too quickly, which helps to balance the energy consumption of nodes, extend the overall life of the network, and avoid node failures or network interruptions caused by excessive energy consumption. By dynamically adjusting task allocation, the network load can be effectively balanced to prevent some nodes from being overloaded while other nodes are idle. Good load balancing improves the reliability and stability of the network. The system can adjust strategies in real time according to changes in network status to adapt to different load and energy consumption conditions. This flexibility enables the network to cope with changing environments and demands and maintain efficient operation.

[0094] Therefore, when it is detected that the path cost is too high or the node energy consumption is too fast, the system will trigger the adjustment mechanism to reallocate the task amount to the node. The specific method is as follows: when it is detected that any path cost exceeds the path cost threshold or a node energy consumption rate is too fast, the network networking system uses dynamic task reallocation to migrate high energy consumption node tasks to nodes with lower energy consumption. By using the inverse proportional relationship between task reallocation and energy consumption, the node with less remaining energy has a greater task reduction; the node with more remaining energy has a smaller task reduction. The specific logic is as follows:

[0095] ;

[0096] ;

[0097] in, Representation Node The energy consumption scheduling priority, Representation Node exist The remaining energy at the moment, Indicated in Time Node The amount of tasks assigned, Indicated in The amount of tasks assigned to the time node after adjustment, Represents the maximum remaining energy of the nodes in the system.

[0098] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0099] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0100] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0101] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A wireless sensor network networking method for farmland environment monitoring, characterized in that: The specific steps include: Step 1: Distribute sensor nodes on demand in the farmland and divide them into basic nodes, advanced nodes, and edge computing nodes. Basic nodes are responsible for collecting basic data from the farmland, advanced nodes are responsible for aggregating data from multiple basic nodes, and edge computing nodes calculate the aggregated data to generate path cost thresholds. Step 2: When each node is initialized, an energy-aware dynamic routing algorithm is used to select a data transmission path based on the current remaining energy of each node and the energy status of neighboring nodes. When the cost of a route exceeds the path cost threshold, the network will automatically find a new path alternative; Step 3: The edge computing node receives data transmitted along the path, fuses and compresses the data, and controls farmland facilities in real time based on the preset farmland environment model. The entropy of the fused data is calculated and combined with the expected median value of the model parameters to generate a control signal. Step 4: Before the control signal is written into the blockchain, the control signal is hashed using a hash algorithm. The processed control signal is used to participate in the consensus mechanism to ensure the security of the control signal writing process into the blockchain. Step 5: The network system regularly evaluates the processed control signals and sets node energy consumption thresholds. When a node's energy consumption exceeds the threshold, the system triggers an adjustment mechanism to reallocate tasks to the node to ensure efficient operation under varying loads and energy consumption. The sensor nodes are distributed as needed, based on the following methods: Basic nodes are placed in the farmland at uniform and equidistant intervals, with a node density that ensures full coverage and redundancy within the sensor's communication range. The farmland is divided into multiple zones, and multiple advanced nodes are placed at the geometric center of each zone. The location of edge computing nodes is determined by minimizing the sum of the distances between the edge computing node and each advanced node. The edge computing node calculates the aggregated data and generates the path cost threshold based on the following method: The energy consumption of data transmission between nodes, the computing resource consumption required by nodes to process data, and the power consumed by nodes to complete transmission and computing tasks are collected. The path cost threshold is set based on the average cost and variance. The logic for generating the path cost threshold based on the number of all paths in the farmland is as follows: in, 、 、 Respectively represent the first The transmission cost, computing cost, and energy consumption cost of each node, 、 、 They represent the proportion of transmission, calculation and energy consumption in the path cost respectively. represents the comprehensive cost of the path, represents the average path cost, represents the variance of the comprehensive cost of the path, represents the number of nodes on the path, represents the number of all paths in the farmland, Indicates the The combined cost of the paths, represents the path cost threshold, Indicates the adjustment coefficient, the value is between 1-2; An energy-aware dynamic routing algorithm is used in the network topology. Each node selects a data transmission path based on the current remaining energy and the energy status of neighboring nodes. The specific method is as follows: The next hop node is selected based on the calculated routing cost. The current node selects the node with the smallest routing cost among the neighboring nodes as the next hop. When selecting a path, if the calculated routing cost exceeds the path cost threshold, the path is considered unsuitable for continued use and the node will recalculate other available paths. When the remaining energy of the node itself or the neighboring nodes falls below the set energy threshold, a routing update is triggered to find a new available path. The specific logic is as follows: in, Indicates that from the current node To neighboring nodes The required transmission energy consumption, Indicates the current node The remaining energy, Represents neighboring nodes The remaining energy, Indicates the current node To neighboring nodes The transmission distance between 、 、 They represent the corresponding transmission energy consumption, the remaining energy of the neighboring nodes, and the weight ratio of the transmission distance. Indicates the minimum energy threshold set. Indicates the path update judgment value. When , the routing update is triggered to find a new available path; when No routing update is triggered.

2. A wireless sensor network networking method for farmland environment monitoring according to claim 1, characterized in that ,The edge computing node receives the data transmitted along the path, fuses and compresses the data, and the specific method is: After receiving data from path sensors, the edge computing node uses a weighted averaging mechanism to fuse the data, uses differential coding to reduce data redundancy, and then uses entropy coding to further compress the data volume. The specific logic is as follows: in, Indicates the Nodes in Fusion data at all times, Indicates the The weight of the node, Indicates the Nodes at time The measured value of Indicates the Nodes in Fusion data at all times, express Differential data at time.

3. A wireless sensor network networking method for farmland environment monitoring according to claim 2, characterized in that , calculate the entropy value of the fused data and generate the control signal with the expected median value of the model parameters. The specific logic is as follows: in, Indicates the nodes The entropy value of the differential data at the moment, Represents differential data The probability distribution of Represents the entropy value set of node differential data, represents the set of expected values ​​of parameters in the environmental model, Indicates the current node to the The weighted sum of the differential data of nodes, represents the median expectation in the environmental model, represents the synthetically generated control signal, Indicates the expected quantity.

4. A wireless sensor network networking method for farmland environment monitoring according to claim 1, characterized in that Before the control signal is written into the blockchain, the control signal is hashed using a hash algorithm. The processed control signal is used to participate in the consensus mechanism to ensure the security of the control signal writing process into the blockchain. The specific method is as follows: The control signal first passes through a secure hash function to calculate its hash value, which is then confirmed by the consensus mechanism and broadcast to other nodes in the network. Other nodes calculate and verify the hash value. If it is equal to the previously obtained hash value, it is confirmed that the data has not been tampered with. The specific logic is as follows: in, Indicates control signal Through hash algorithm The generated hash value, Indicates that the hash function processes a fixed-length 256-bit hash value. Indicates the hash value authenticated by other nodes. Indicates the judgment value of the hash value verification mechanism, When , it indicates that the hash value has not been tampered with, and the control signal is written into the blockchain; , it indicates that the hash value has been tampered with, preventing the control signal from being written into the blockchain.

5. A wireless sensor network networking method for farmland environment monitoring according to claim 1, characterized in that ,If it is detected that the energy consumption of a node is too high, the system will trigger the ,adjustment mechanism to reallocate the workload to the node. ,The specific method is as follows: When it is detected that any path cost exceeds the path cost threshold or the energy consumption rate of a node is too fast, the network system uses dynamic task redistribution to migrate the tasks of high-energy-consuming nodes to nodes with lower energy consumption. The task redistribution is inversely proportional to energy consumption. The nodes with less remaining energy have a greater reduction in tasks; the nodes with more remaining energy have a smaller reduction in tasks. The specific logic is as follows: in, Representation node The energy consumption scheduling priority, Representation node exist The remaining energy at the moment, Indicates Time Node The amount of tasks assigned, Indicates The amount of tasks assigned to the time node after adjustment, Indicates the maximum remaining energy of a node in the system.