A smart agriculture sensor layout optimization method based on improved ant colony algorithm
By improving the ant colony algorithm, combining data redundancy and network energy loss model, the layout of smart agricultural sensors is optimized, and the problems of high data redundancy and increased network energy consumption are solved, achieving energy saving and consumption reduction and cost optimization.
Patent Information
- Application Number
- CN202111440693.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2041-11-30
AI Technical Summary
The high redundancy of data acquisition in the soil moisture sensor in agricultural planting leads to increased network energy consumption and high sensor investment costs.
The improved ant colony algorithm is adopted to establish a data redundancy model and a network energy loss model, and introduce it into the heuristic function, optimize the sensor layout, and reduce data redundancy and network energy consumption.
The optimized sensor dot path saves energy, reduces data redundancy and sensor investment costs, and improves the efficiency of sensor layout.
Smart Images

Figure CN114339651B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wireless sensor networks, and in particular to a method for optimizing the layout of smart agricultural sensors by improving an ant colony algorithm. Background Art
[0002] Agricultural water-saving irrigation systems collect soil moisture information through sensors distributed in farmland. Reasonable sensor selection and layout play an important role in accurately obtaining soil moisture. At present, the focus of research on sensor layout is on coverage algorithm and positioning algorithm, that is, through different algorithm models, optimization research is carried out from the aspects of the number of base stations, network connectivity, minimum coverage and optimal placement in an environment with obstacles.
[0003] Research on the optimal layout of soil moisture sensors in farmland is relatively rare, and there is even less research on the problem of large-scale distribution of sensor nodes and high redundancy of detected data. Summary of the invention
[0004] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a smart agricultural sensor layout optimization method based on an improved ant colony algorithm, aiming to solve the problem of high redundancy of collected data in agricultural soil moisture sensors, while saving network energy consumption and reducing the number of sensors invested, thereby reducing the investment cost of sensors.
[0005] The present invention adopts the following technical solutions to solve the above technical problems:
[0006] A smart agricultural sensor layout optimization method based on an improved ant colony algorithm proposed in the present invention comprises the following steps:
[0007] Step 1: A plurality of sensor nodes are randomly arranged in the soil, and each sensor node collects soil moisture data and preprocesses the data; wherein the preprocessed soil moisture data is simply referred to as data;
[0008] Step 2: Establish a data redundancy model and a network energy loss model based on the soil moisture data preprocessed in step 1, add the data redundancy model and the network energy loss model to the heuristic function, thereby obtaining an improved heuristic function, and guide the ant colony to search for a sensor node distribution path that can reduce data redundancy and network energy loss;
[0009] Step 3: Use the improved probability transfer formula to guide the ants to move from the starting point to the end point to prevent detours in the process of searching for paths, so as to search for a sensor node deployment path that can reduce data redundancy and network energy loss; wherein, the improved probability transfer formula is: improving the heuristic function and pheromone concentration update formula in the probability transfer formula, and introducing a path trend wizard in the probability transfer formula; the heuristic function is the improved heuristic function in step 2, and the improvement in the pheromone concentration update formula is the introduction of a data redundancy influencing factor.
[0010] As a further optimization scheme of the smart agricultural sensor layout optimization method of the improved ant colony algorithm described in the present invention, in step 2, the data redundancy model is:
[0011] H ij =1 / O ij (1)
[0012] O ij =R i +R j (2)
[0013]
[0014] Among them, H ij represents the data redundancy between the i-th and j-th sensor nodes, O ij represents the difference between the i-th and j-th sensor nodes, R i It represents the sum of the squares of the differences between the data of the ith sensor node and the data of the remaining sensor nodes in the soil, and is used to represent the dissimilarity between the data of the ith sensor node and the data of the sensor nodes in the soil. j The sum of the squares of the differences between the data of the jth sensor node and the data of the remaining sensor nodes in the soil is used to represent the dissimilarity between the data of the jth sensor node and the data of the sensor nodes in the soil. i and m j Respectively represent the soil moisture data of the i-th and j-th sensor nodes, i, j = 1, 2, 3, ... n, n is the total number of sensor nodes;
[0015] Considering only the energy loss of the sensor nodes in sending, receiving and transmitting soil moisture data, a network energy loss model is established:
[0016] Energy consumption of sending data:
[0017]
[0018]
[0019] Among them, E s (l,Dz ) represents the energy loss in the process of the sensor node sending soil moisture data, l represents the length of the sent soil moisture data, D z represents the physical distance between two sensor nodes, E elec represents the energy consumed per unit of data processed, e fs Indicates the power amplification factor, D ij represents the distance between the i-th sensor node and the j-th sensor node, D z Equal to D in value ij , x i represents the horizontal coordinate of the i-th sensor node, y i represents the ordinate of the i-th sensor node; x j represents the horizontal coordinate of the jth sensor node, y j represents the ordinate of the jth sensor node;
[0020] Energy consumption of receiving data:
[0021] E r = l·E elec (6)
[0022] E r It represents the energy loss in the data receiving process, which is numerically equal to the length l of the received soil moisture data and the energy E consumed per unit of data processing. elec The product of
[0023] Energy loss during data transmission:
[0024]
[0025]
[0026] If the soil moisture data sent by a sensor node passes through n * After reaching the end point after sensor nodes, the energy loss of the whole process is as shown in formula (7). The energy loss of the whole process is equal to the sum of data sending and data receiving. represents the energy loss during data transmission, l represents the length of the soil moisture data transmitted, and d z It represents the sum of the distances between the sensor nodes passing from the starting sensor node to the end point, which is numerically equal to D z The cumulative sum of; where the starting sensor node is randomly selected by the ant colony, and the end point is pre-selected; Combining the above-mentioned receiving data loss formula (4) and the energy loss formula (6) and formula (8) for sending data, the energy loss during data transmission is converted into the form of formula (10);
[0027] The network energy loss model and data redundancy model are introduced into the heuristic function, and the calculated value of the heuristic function is used as the expected value for the ant to select the next sensor node;
[0028] The improved heuristic function is shown as follows:
[0029] η ij =λ1O ij +λ2 1 / E cost +λ31 / D ij (11)
[0030] Among them, λ1, λ2, and λ3 are proportional coefficients, λ1, λ2, and λ3 represent the proportion of soil moisture data dissimilarity, energy loss, and physical distance in the heuristic function, respectively, λ1+λ2+λ3=1, η ij Represents the heuristic function between the i-th sensor node and the j-th sensor node.
[0031] As a further optimization scheme of the smart agricultural sensor layout optimization method of the improved ant colony algorithm described in the present invention, a path trend guide is introduced into the probability transfer formula, G j It represents the guide for ants to transfer to the jth sensor node in the ant colony algorithm; the probability transfer formula of the improved ant colony algorithm is as follows:
[0032]
[0033]
[0034] represents the probability that the kth ant transfers from the ith sensor node to the jth sensor node at time t, where τ ij (t) represents the pheromone concentration value from the i-th sensor node to the j-th sensor node to be visited at time t; τ is (t) represents the pheromone concentration value from the i-th sensor node to the starting sensor node s at time t; η is (t) represents the heuristic function value from the i-th sensor node to the starting sensor node s at time t; η ij (t) represents the heuristic function value from the i-th sensor node to the j-th sensor node to be visited at time t; α and β both represent adjustment factors, α is used to adjust the influence of pheromone concentration on probability transfer, and β is used to adjust the influence of heuristic function on probability transfer; allowed k The node that the kth ant is going to visit is a table that is used to store sensor nodes that have not been visited yet, s∈allowed k The starting sensor node s is in the set of sensor nodes that the kth ant is allowed to go to next, j∈allowed kIt means that the jth sensor to be visited next is in the set of sensor nodes that the kth ant is allowed to visit next, that is, the jth sensor node has not been visited yet; D is represents the distance from the i-th sensor node to the starting sensor node s, D js represents the distance from the jth sensor node to be visited to the starting sensor node s; D id represents the distance from the i-th sensor node to the end point d; G j The sensor node with a value of 1 contributes to the probability transfer formula, and the jth sensor node becomes the sensor node on the optimal path, while G j If the sensor node is 0, the transfer probability is 0, and it will not be the next visited sensor node. j It can guide the ants to move from the starting sensor node to the end point, and R represents the communication radius of the sensor node.
[0035] As a further optimization scheme of the smart agricultural sensor layout optimization method of the improved ant colony algorithm described in the present invention, the pheromone concentration update formula is:
[0036]
[0037] represents the pheromone concentration update increment from the i-th sensor node to the j-th sensor node by the k-th ant at time t, L k represents the total length of the path taken by the kth ant in this path search process, H k It represents the data redundancy of the kth ant in the path search process, and Q represents the pheromone concentration in the ant colony algorithm, which is a constant.
[0038] As a further optimization scheme of the smart agricultural sensor layout optimization method of an improved ant colony algorithm described in the present invention, in step 1, the specific method of collecting soil moisture data is: randomly selecting multiple sensor nodes in the soil, collecting soil moisture data at a preset depth on the soil surface, collecting multiple soil moisture data for each sensor node and taking the average value as the soil moisture data of the sensor node, and preprocessing the collected soil moisture data.
[0039] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:
[0040] The present invention takes into account the redundancy of data collected by smart agricultural sensors, network energy consumption, the length of the layout path and the number of sensors invested, and proposes an improved ant colony algorithm for the optimal layout of smart agricultural sensors. The sensor layout path optimized by the method of the present invention saves energy, reduces data redundancy and the investment cost of sensors. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a test data collection device for a smart agricultural sensor layout optimization algorithm based on an improved ant colony algorithm provided by an embodiment of the present invention;
[0042] Figure 2 An initial layout of soil sensors provided by an embodiment of the present invention;
[0043] Figure 3 A structural block diagram of a smart agricultural sensor layout optimization algorithm based on an improved ant colony algorithm provided in an embodiment of the present invention;
[0044] Figure 4 A flowchart of an improved ant colony algorithm provided by an embodiment of the present invention;
[0045] Figure 5 A result diagram of the improved ant colony algorithm provided in an embodiment of the present invention in the optimization layout of smart agricultural sensors;
[0046] Figure 6 A result diagram of the basic ant colony algorithm provided by an embodiment of the present invention in the optimization layout of smart agricultural sensors;
[0047] Figure 7a , Figure 7b , Figure 7c The comparison diagrams of data redundancy, network energy consumption, and path length of the improved ant colony algorithm and the basic ant colony algorithm in the optimal layout of smart agricultural sensors are shown respectively;
[0048] Figure 8 A comparison diagram of soil moisture mean values between the improved ant colony algorithm and the basic ant colony algorithm provided in an embodiment of the present invention;
[0049] Fig. 9 Comparison chart of the results of optimizing the layout of smart agricultural sensors between the improved ant colony algorithm and the basic ant colony algorithm. DETAILED DESCRIPTION
[0050] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings:
[0051] Figure 1 A test data collection device provided in an embodiment of the present invention is a soil moisture sensor. The SWR-100W soil moisture sensor of Shijiazhuang Leiguang Electronic Technology Co., Ltd. is selected. The soil moisture sensor measures the moisture content of the soil based on the frequency domain reflection principle. The soil moisture of the present invention refers to the soil moisture content, and the soil moisture content refers to the ratio of the mass of water in the soil to the mass of dry soil.
[0052] Figure 2 It is the initial layout of smart agriculture sensors, such as Figure 2As shown, in one embodiment, an improved ant colony algorithm for smart agricultural sensor layout optimization algorithm is proposed, 25 collection points are randomly selected to collect soil moisture data 25 cm below the soil surface, and each sensor node collects data three times and takes the average value as the soil moisture data of the sensor node.
[0053] Figure 3 It is a system structure diagram of the present invention, describing the overall idea and implementation process of the whole invention, which may specifically include the following steps:
[0054] Step 1: Obtain soil moisture data.
[0055] 25 sensor nodes are randomly selected in the test soil to collect soil moisture data 25 cm below the soil surface. Each sensor node collects data three times, and the average value of the three data is taken as the soil moisture data of the sensor node. The collected soil moisture data is pre-processed and used in subsequent related experiments of the present invention.
[0056] Step 2: Improve the heuristic function of the ant colony algorithm. Specific steps:
[0057] First, a data redundancy model is established;
[0058] The sum of the dissimilarity values between the data of each sensor node and the data of other sensor nodes in the soil is calculated to reflect the degree of dissimilarity between each sensor node and the soil moisture in the entire soil. The dissimilarity formula is as follows:
[0059]
[0060] O ij =R i +R j ((i,j)∈1…n)
[0061] H ij =1 / O ij ((i,j)∈1…n)
[0062] Where n is the number of sensor nodes, m i and m j Represents the soil moisture content of the i-th and j-th sensor nodes. The larger the Ri value, the greater the difference between the soil moisture content at this point and the soil moisture content in the entire soil. ij represents the dissimilarity between the soil moisture data of sensor nodes, H ij represents the redundancy between the soil moisture data of sensor nodes, O ij The larger the value, the smaller the data redundancy between the i-th and j-th sensor nodes.
[0063] Secondly, it is to establish a network energy loss model;
[0064] The energy loss of sensor nodes in wireless sensor networks mainly occurs during the sending, receiving and transmission of data. To simplify the energy loss model, the present invention does not consider the specific routing transmission protocol in the network, but only considers the energy loss of sensor nodes sending, receiving and transmitting data.
[0065] Energy consumption of sending data:
[0066] E s (l, d) = lE elec +le fs D 2
[0067]
[0068] In the above formula: l represents the length of the data sent, E elec It represents the energy consumed to process each unit of data, e fs represents the power amplification factor, D represents the distance between two sensor nodes, which is numerically equal to D ij .
[0069] Energy consumption of receiving data:
[0070] E r =lE elec
[0071] If the data sent by a sensor node reaches the destination after passing through n nodes, the energy loss formula during data transmission is as follows:
[0072]
[0073] From the above formula (1), we can know that the energy loss in the wireless sensor network is mainly in the sensor node data transmission and sensor node data processing process. When the transmission data length is certain, the energy loss of sensor node data processing is (2n+1)lE elec , the size is determined by the number of sensor nodes; the energy loss during data transmission is The size is determined by the transmission distance; the longer the distance, the more energy is lost.
[0074] Finally, construct a new heuristic function;
[0075] The distance factor between two sensor nodes is considered in the heuristic function of the basic ant colony algorithm. In the actual layout of soil moisture sensors, not only the transmission distance problem should be considered, but also the network loss and data redundancy. The network loss and data redundancy are introduced into the heuristic function as the expected value of the ant's selection of the next sensor node. The heuristic function is shown as follows:
[0076] η ij =λ1O ij +λ2 1 / E cost +λ3 1 / D ij (λ1+λ2+λ3=1)
[0077] From the above formula, we can see that O ij The bigger, E cost The smaller, D ij The smaller the ij The larger the value is, the greater the possibility that the jth sensor node will be selected as the next sensor node. That is, the conditions for the ant to select the next-hop sensor node are small data redundancy, low network energy consumption, and short path length.
[0078] Where D ij Represents the distance between two sensor nodes, and the formula is as follows:
[0079]
[0080] The improved heuristic function can inspire the ant colony to search for sensor deployment paths with low data redundancy and low network loss.
[0081] Step three is to improve the probability transfer formula of the ant colony algorithm. The basic ant colony algorithm is not directional. In the process of path optimization, the next sensor node that the current sensor node is looking for may deviate from the end point, causing the path to become longer. The path trend guide G is introduced into the probability transfer formula. j , guide the ants to search for paths along the destination. The specific steps are:
[0082]
[0083]
[0084] represents the probability that the kth ant transfers from the ith sensor node to the jth sensor node at time t, where τ ij (t) represents the pheromone concentration value from the i-th sensor node to the j-th sensor node to be visited at time t; τ is (t) represents the pheromone concentration value from the i-th sensor node to the starting sensor node s at time t; η is (t) represents the heuristic function value from the i-th sensor node to the starting sensor node s at time t; η ij(t) represents the heuristic function value from the i-th sensor node to the j-th sensor node to be visited at time t. α and β both represent adjustment factors. α adjusts the effect of pheromone concentration on probability transfer. The larger its value, the greater the effect of pheromone concentration on probability transfer. Ants tend to choose neighboring sensor nodes with short path length and small data redundancy as the next visited sensor node. β adjusts the effect of the heuristic function on probability transfer. The larger its value, the greater the effect of the heuristic function on probability transfer. Ants tend to choose neighboring nodes with less energy consumption as the next visited sensor node.
[0085] The basic ant colony algorithm is non-directional. In the process of path optimization, the next sensor node that the current sensor node is looking for may deviate from the end point, resulting in a longer path. The improved algorithm proposed in this invention introduces a trend guide in the probability transfer, as shown in the above formula (2), which represents the trend guide G j , i represents the current sensor node, j represents the next hop sensor node, s represents the starting sensor node, d represents the destination, G j The sensor nodes with G=1 are more likely to become sensor nodes on the optimal path, while j The sensor node with a value of 0 leads to a transfer probability of 0, and the jth sensor node will not be the next visited sensor node. j It can guide ants to move from the starting sensor node to the end point, prevent detours, avoid increasing the path length and network energy loss, reduce the length of the sensor deployment path and the number of sensors invested, and reduce investment costs.
[0086] Step 4 is the specific process of improving the ant colony algorithm in the optimization layout of smart agricultural sensors, which includes:
[0087] (1) Experimental parameter settings of improved ant colony algorithm are shown in Table 1 below:
[0088]
[0089] The initial energy of sensor nodes is uniformly set to 50J; n represents the number of sensor nodes, which means the number of sensor nodes invested in the initial layout; m represents the number of ants, which is set to 50; N represents the maximum number of iterations of the ant colony algorithm, which is set to 200; α pheromone adjustment factor, which is set to 1; β heuristic function adjustment factor, which is set to 5; ρ represents the pheromone volatility factor, which is 0.1; λ1, λ2 and λ3 are proportional coefficients, which represent the proportion of data redundancy, network energy loss and the distance between sensor nodes in the heuristic function, and the values are 0.5, 0.2 and 0.3 respectively; R represents the communication radius of the sensor node, and the selected sensor communication radius is 70m; Q represents the initial pheromone strength, which is a constant and is 100.
[0090] (2) Set the end point of the ant colony algorithm path search, such as Figure 1 The terminal position is shown in FIG. 1 . In a general wireless sensor network, the routing aggregation node is selected at the boundary. Therefore, the terminal of the ant colony algorithm in the present invention is set as follows: Figure 1 as shown in .
[0091] (3) Read the data, bring the soil moisture data into the data redundancy model, and calculate the data redundancy between each sensor node, as follows:
[0092]
[0093] O ij =R i +R j ((i,j)∈1…n)
[0094] H ij =1 / O ij ((i,j)∈1…n)
[0095] Ri represents the sum of the differences between the data of the ith sensor node and all the remaining sensor nodes in the soil, which can reflect the difference between the data of the ith sensor node and the remaining sensor nodes in the soil. The larger the value, the greater the difference, and the smaller the value, the smaller the difference. ij represents the data difference between the i-th sensor node and the j-th sensor node, O ij The larger the value is, the greater the difference between the data of the two sensor nodes is, and vice versa. ij Represents the data redundancy between sensor nodes, which is numerically equal to O ij The reciprocal of H ij The smaller the data redundancy is, the better. The smaller the data redundancy is, the more representative the selected sensor nodes are.
[0096] Establish a network energy loss model:
[0097] E s (l, d) = lE elec +le fs D 2
[0098]
[0099] In the above formula: l represents the length of the data sent, E elec It represents the energy consumed to process each unit of data, e fs Indicates the power amplification factor, D ij Represents the distance between two sensor nodes.
[0100] Energy consumption of receiving data:
[0101] E r =lE elec
[0102] If the soil moisture data sent by a sensor node reaches the end point after passing through n sensor nodes, the energy loss formula during data transmission is as follows:
[0103]
[0104] From the above formula (3), we can know that the energy loss in the wireless sensor network is mainly in the process of sensor node data transmission and sensor node data processing. When the length of the sensor node data transmission is certain, the energy loss of sensor node data processing is (2n+1)lE elec , the size is determined by the number of sensor nodes; the energy loss during data transmission of sensor nodes is The size is determined by the transmission distance; the longer the distance, the more energy is lost.
[0105] Determine the heuristic function:
[0106] η ij =λ1O ij +λ2 1 / E cost +λ3 1 / D ij (λ1+λ2+λ3=1)
[0107] The heuristic function of the basic ant colony algorithm takes into account the distance factor between two sensor nodes, namely, D ij In the actual layout of soil moisture sensors, not only the transmission distance problem should be considered, but also the network loss and data redundancy. Data redundancy and network energy loss factors are added to the new heuristic function to inspire the ant colony to search for sensor node layout paths that can reduce data redundancy and network loss.
[0108] Calculate the probability transfer formula:
[0109]
[0110]
[0111] The basic ant colony algorithm is non-directional. In the process of path search, the next hop node that the current node is looking for may deviate from the end point, resulting in a longer path. The improved algorithm proposed in this invention introduces a trend guide in the probability transfer, as shown in the above formula (3), G j represents the trend guide, i represents the current sensor node, j represents the next hop sensor node, s represents the starting sensor node, d represents the end point, G jThe sensor nodes with G=1 are more likely to become sensor nodes on the optimal path, while j The sensor node with a value of 0 leads to a transfer probability of 0, and the jth sensor node will not be the next visited sensor node. j It can guide ants to move from the starting sensor node to the end point, preventing detours and increasing path length and network energy loss.
[0112] By calculating the transfer probability between sensor nodes, the sensor node with the largest transfer probability is used as the next hop node visited by the ant, and so on, until the ant colony searches for the end of the path.
[0113] Update pheromone concentration:
[0114] The pheromone concentration is determined by the path length and data redundancy. The shorter the distance between two sensor nodes and the smaller the data redundancy, the more pheromones the ants release on this path, and the more likely the subsequent ants are to choose this path. The update formula is as follows:
[0115]
[0116] L k H represents the total length of the path taken by the kth ant in this path search. k represents the data redundancy of the kth ant in this path search. From the above formula (5), we can see that the shorter the path, the smaller the data redundancy, and the higher the pheromone concentration released. Subsequent ants are more inclined to choose the path with high pheromone concentration to reach the end point. That is, the path selected by the ant can reduce data redundancy and has the shortest path length.
[0117] (4) Determine whether the maximum number of iterations has been reached. If so, the algorithm terminates and outputs the optimized sensor point distribution path. If not, continue searching for the path according to the above steps.
[0118] Figure 4 It is a specific implementation flow chart of the improved ant colony algorithm of the present invention.
[0119] Figure 5 is the result diagram of the sensor layout optimization by the improved ant colony algorithm proposed in this invention. Figure 5 It can be seen that only 6 sensors are needed for the output path, reducing the 25 sensors in the initial layout to 6, greatly reducing the number of sensors and investment costs.
[0120] Figure 6 This is the experimental result of the basic ant colony algorithm for soil sensor layout optimization. Figure 6 It can be seen that the output path requires 9 sensors, which is 3 more sensors than the improved ant colony algorithm.
[0121] Depend on Figure 7a , Figure 7b and Figure 7c It can be seen that the results of the improved ant colony algorithm are better than those of the basic ant colony algorithm in terms of data redundancy, network energy loss and path length.
[0122] Figure 8 It is a comparison between the mean of the data collected by the sensor nodes on the output path and the overall soil moisture conditions of smart agriculture after the improved ant colony algorithm and the basic ant colony algorithm are optimized. The smaller the difference between the mean of the data collection point and the overall mean, the better the data collected on the path can represent the overall soil moisture conditions of smart agriculture.
[0123] Depend on Figure 8 It can be seen that the difference between the mean of soil moisture data collected by the output path of the improved ant colony algorithm and the overall mean is small, so the data collected by the output path of the improved ant colony algorithm can better represent the overall soil moisture of smart agriculture. Figure 7a , Figure 7b and Figure 7c It can be seen that the redundancy of soil moisture data collected by the output path of the improved ant colony algorithm is small, which means that the soil moisture data collected by the output path after optimization by the improved ant colony algorithm can represent the integrity of the soil moisture data and reflect the differences of the soil moisture data.
[0124] Fig. 9 The test is conducted by selecting data from another day. The test results are as follows Fig. 9 As shown, the output path of the improved ant colony algorithm requires 6 sensors, and the output path of the basic ant colony algorithm requires 9 sensors. The test results are consistent with the test results of the present invention, which proves the reliability of the present invention and eliminates contingency.
[0125] The present invention solves the problem of high data redundancy in the optimized layout of sensors, and also optimizes network energy consumption, the number of sensors invested, and the length of the layout path. After the layout of smart agricultural sensors is optimized using the method of the present invention, network energy consumption can be saved, the redundancy of collected data is small, the number of sensors invested is reduced, and thus the investment cost is reduced.
[0126] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0127] The above-mentioned embodiments only express the implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
[0128] The above description is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a technician familiar with the technical field within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention.
Claims
1. A smart agricultural sensor layout optimization method based on an improved ant colony algorithm, characterized in that: The following steps are involved: Step 1: A plurality of sensor nodes are randomly arranged in the soil, and each sensor node collects soil moisture data and preprocesses the data; wherein the preprocessed soil moisture data is simply referred to as data; Step 2: Establish a data redundancy model and a network energy loss model based on the soil moisture data preprocessed in step 1, add the data redundancy model and the network energy loss model to the heuristic function, thereby obtaining an improved heuristic function, and guide the ant colony to search for a sensor node distribution path that can reduce data redundancy and network energy loss; Step 3: Use the improved probability transfer formula to guide the ants to move from the starting point to the end point to prevent detours in the process of searching for paths, so as to search for a sensor node deployment path that can reduce data redundancy and network energy loss; Among them, the improved probability transfer formula is: the heuristic function and the pheromone concentration update formula in the probability transfer formula are improved, and the path trend guide is introduced into the probability transfer formula; the heuristic function is the heuristic function improved in step 2, and the improvement of the pheromone concentration update formula is to introduce the data redundancy influencing factor; In step 2, the data redundancy model is: H ij =1 / O ij (1) O ij =R i +R j (2) Among them, H ij represents the data redundancy between the i-th and j-th sensor nodes, O ij represents the difference between the i-th and j-th sensor nodes, R i It represents the sum of the squares of the differences between the data of the i-th sensor node and the data of the remaining sensor nodes in the soil, and is used to represent the dissimilarity between the data of the i-th sensor node and the data of the sensor nodes in the soil. j The sum of the squares of the differences between the data of the jth sensor node and the data of the remaining sensor nodes in the soil is used to represent the dissimilarity between the data of the jth sensor node and the data of the sensor nodes in the soil. i and m j Respectively represent the soil moisture data of the i-th and j-th sensor nodes, i, j = 1, 2, 3, ... n, n is the total number of sensor nodes; Considering only the energy loss of the sensor nodes in sending, receiving and transmitting soil moisture data, a network energy loss model is established: Energy consumption of sending data: Among them, E s (l,D z ) represents the energy loss in the process of the sensor node sending soil moisture data, l represents the length of the sent soil moisture data, D z represents the physical distance between two sensor nodes, E elec represents the energy consumed per unit of data processed, e fs Indicates the power amplification factor, D ij represents the distance between the i-th sensor node and the j-th sensor node, D z Equal to D in value ij , x i represents the horizontal coordinate of the i-th sensor node, y i represents the ordinate of the i-th sensor node; x j represents the horizontal coordinate of the jth sensor node, y j represents the ordinate of the jth sensor node; Energy consumption of receiving data: AND r =l·E elec (6) E r It represents the energy loss in the data receiving process, which is numerically equal to the length l of the received soil moisture data and the energy E consumed per unit of data processing. elec The product of Energy loss during data transmission: If the soil moisture data sent by a sensor node passes through n * After reaching the end point after sensor nodes, the energy loss of the whole process is as shown in formula (7). The energy loss of the whole process is equal to the sum of data sending and data receiving. represents the energy loss during data transmission, l represents the length of the soil moisture data transmitted, and d z It represents the sum of the distances between the sensor nodes passing from the starting sensor node to the end point, which is numerically equal to D z The cumulative sum of; where the starting sensor node is randomly selected by the ant colony, and the end point is pre-selected; Combining the above-mentioned receiving data loss formula (4) and the energy loss formula (6) and formula (8) for sending data, the energy loss during data transmission is converted into the form of formula (10); The network energy loss model and data redundancy model are introduced into the heuristic function, and the calculated value of the heuristic function is used as the expected value for the ant to select the next sensor node; The improved heuristic function is shown as follows: or ij =λ1O ij +λ21 / E cost +λ31 / D ij (11) Among them, λ1, λ2, and λ3 are proportional coefficients, λ1, λ2, and λ3 represent the proportion of soil moisture data dissimilarity, energy loss, and physical distance in the heuristic function, respectively, λ1+λ2+λ3=1, η ij Represents the heuristic function between the i-th sensor node and the j-th sensor node.
2. According to the improved ant colony algorithm smart agriculture sensor layout optimization method of claim 1, it is characterized in that: Introducing the path trend guide in the probability transfer formula, G j It represents the guide for ants to transfer to the jth sensor node in the ant colony algorithm; the probability transfer formula of the improved ant colony algorithm is as follows: represents the probability that the kth ant transfers from the ith sensor node to the jth sensor node at time t, where τ ij (t) represents the pheromone concentration value from the i-th sensor node to the j-th sensor node to be visited at time t; τ is (t) represents the pheromone concentration value from the i-th sensor node to the starting sensor node s at time t; η is (t) represents the heuristic function value from the i-th sensor node to the starting sensor node s at time t; η ij (t) represents the heuristic function value from the i-th sensor node to the j-th sensor node to be visited at time t; α and β both represent adjustment factors, α is used to adjust the influence of pheromone concentration on probability transfer, and β is used to adjust the influence of heuristic function on probability transfer; allowed k The node that the kth ant is going to visit is a table that is used to store sensor nodes that have not been visited yet, s∈allowed k The starting sensor node s is in the set of sensor nodes that the kth ant is allowed to go to next, j∈allowed k It means that the jth sensor to be visited next is in the set of sensor nodes that the kth ant is allowed to visit next, that is, the jth sensor node has not been visited yet; D is represents the distance from the i-th sensor node to the starting sensor node s, D js represents the distance from the jth sensor node to be visited to the starting sensor node s; D id represents the distance from the i-th sensor node to the end point d; G j The sensor node with a value of 1 contributes to the probability transfer formula, and the jth sensor node becomes the sensor node on the optimal path, while G j If the sensor node is 0, the transfer probability is 0, and it will not be the next visited sensor node. j It can guide the ants to move from the starting sensor node to the end point, and R represents the communication radius of the sensor node.
3. The method for optimizing the layout of smart agricultural sensors based on an improved ant colony algorithm according to claim 2 is characterized in that: Pheromone concentration update formula: represents the pheromone concentration update increment from the i-th sensor node to the j-th sensor node by the k-th ant at time t, L k represents the total length of the path taken by the kth ant in this path search process, H k It represents the data redundancy of the kth ant in the path search process, and Q represents the pheromone concentration in the ant colony algorithm, which is a constant.
4. The method for optimizing the layout of smart agricultural sensors based on an improved ant colony algorithm according to claim 2 is characterized in that: In step 1, the specific method for collecting soil moisture data is: randomly select multiple sensor nodes in the soil, collect soil moisture data at a preset depth on the soil surface, collect multiple soil moisture data for each sensor node and take the average value as the soil moisture data of the sensor node, and pre-process the collected soil moisture data.
Citation Information
Patent Citations
Soil moisture content sensor optimal layout method based on APDJ algorithm
CN110717507A
Directional diffusion routing method based on improved ant colony algorithm in wireless sensor network
CN111385853A