Data transmission method of soil temperature, humidity and salt integrated detection device

CN122891191APending Publication Date: 2026-10-09SHANDONG TRANSPORT VOCATIONAL COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610861622.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-15
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0005]因为电磁干扰的存在,数据信号在传输过程中,会出现一定概率的错误,导致中央处理器接收的数据不准确

Benefits of technology

可以在多层土壤剖面的温度、湿度、盐度海量数据传输过程中,对发送数据进行编码,对接收数据进行解码,并且判断接收过程中有无错码,对错码进行定位和纠错,解决了数据的丢位、多位和错误问题,提高了海量数据的传输效率和准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122891191A_ABST
    Figure CN122891191A_ABST
Patent Text Reader

Abstract

The application discloses a data transmission method of a soil temperature, humidity and salinity integrated detection device, the detection device comprises a soil sensor, an MCU module, a communication module, a power management module and a storage module, the power management module is used for providing power supply for each module, the MCU module is connected with the soil sensor, the communication module and the storage module. It has the following advantages: during the mass data transmission of temperature, humidity and salinity of multi-layer soil profile, the transmitted data can be encoded, the received data can be decoded, and it can be judged whether there is error code in the receiving process, the error code can be positioned and corrected, the problems of bit loss, multiple bits and errors of data are solved, and the transmission efficiency and accuracy of mass data are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a data transmission method for an integrated soil temperature, humidity, and salinity detection device, belonging to the field of soil testing technology. Background Technology

[0002] Soil sensors are used to monitor soil profile temperature, humidity, and electrical conductivity (salinity), and can be widely used in agricultural engineering fields such as smart greenhouses, smart orchards, and smart irrigation.

[0003] The soil sensor adopts a multi-layer design. Each layer of the sensor can independently measure temperature, humidity, and conductivity parameters. Different layers of the sensor contact the soil at different depths, and a single soil sensor can simultaneously measure and transmit soil parameter data from multiple depths.

[0004] The soil sensor can communicate data via 485, Modbus, RTU and other methods to transmit temperature, humidity and salinity data at different soil depths.

[0005] Due to the presence of electromagnetic interference, data signals may experience errors during transmission, leading to inaccurate data received by the central processing unit.

[0006] Existing communication technologies for soil sensors use comparison or verification methods to confirm the correctness of data.

[0007] Comparison method: The same set of data is sent repeatedly for comparison. If each digit of the two sets of data is the same, the data in this set is considered correct. If the data is different, the data is sent again. Each digit of the three sets of data is compared. According to the principle of majority rule, the data with the same value is considered correct.

[0008] Verification method: By adding a checksum to the sent data, if the checksum and the data match, the data is considered correct; if they do not match, the data is considered incorrect, and the data is resent for further verification. Summary of the Invention

[0009] The technical problem to be solved by the present invention is to provide a data transmission method for an integrated soil temperature, humidity and salinity detection device that addresses the above-mentioned shortcomings. In the process of transmitting massive amounts of temperature, humidity and salinity data from multi-layer soil profiles, the method encodes the transmitted data, decodes the received data, and determines whether there are any errors in the received data. Errors are located and corrected, thus solving the problems of data loss, extra bits and errors, and improving the transmission efficiency and accuracy of massive amounts of data.

[0010] To solve the above technical problems, the present invention adopts the following technical solution: A data transmission method for an integrated soil temperature, humidity, and salinity detection device, wherein the detection device includes a soil sensor, an MCU module, a communication module, a power management module, and a storage module. The power management module provides power to each module, and the MCU module is connected to the soil sensor, the communication module, and the storage module. Includes the following steps: Step 1: Soil sensors collect soil data; Step 2: The MCU module encodes the soil data collected by the soil sensor; Step 3: Convert to binary. The data transmission method uses a high-low level mode, where a high level represents 1 and a low level represents 0. Therefore, the soil parameter data encoding in Step 1 needs to be changed to binary. Step 4: Add parity check for the entire group; Step 5: Add regional parity checking; Step six: Send data via the communication module; Step 7: Data reception and error correction; Step 8: After the data parity check passes, the data is stored in the storage module.

[0011] Furthermore, the encoding format for the soil data in step two is as follows: Total number of characters + number of layers + function code + numeric code + checksum; The total number of characters defines the number of characters sent, in decimal. After receiving the data, the data receiving device can determine whether any characters were missed or over-received based on the total number of characters. The number of layers specifies the depth of the soil being tested; The function code specifies the data type: temperature function code is 01, humidity function code is 02, and salinity function code is 03. The numeric code specifies the magnitude of the detected value; The checksum specifies the sum of adjacent data. If the sum of adjacent data in the received data does not match the checksum, it indicates an error in the data transmission, and data correction is required.

[0012] Furthermore, the implementation process of step four is as follows: By adding a parity check bit to the original data, it is possible to determine whether there is an error. When the total number of "1"s in a set of data is odd, the parity check code is set to "1"; when the total number of "1"s in a set of data is even, the parity check code is set to "0". Including the parity check code, the number of "1"s in this data set is always even. If, in the received data, a data point changes from 0 to 1, or from 1 to 0, the number of 1s in this data set will become odd. By counting the parity of the number of "1"s in a received set of data, it can be determined whether there is an error in the data set.

[0013] Furthermore, the implementation process of step five is as follows: A single parity check code for the entire set of data can only determine whether there are any errors, but cannot locate the errors. By adding regional parity check codes, and by setting the check codes so that the number of "1"s in the entire array and each region is even, the location of the errors can be located. If there are errors, according to the binary search principle, the array is divided into two regions. If there are no errors in one region, then the errors must exist in the other region. By dividing the data into binary regions with different rows and columns, and ensuring that there is overlap between the regions, parity checks, judgments, and filtering can be performed separately to locate the position of the bit error and determine whether there are multiple bit errors.

[0014] Furthermore, the implementation process of step seven is as follows: After the data is sent, it is received sequentially by the data receiving device in the form of an array. If, due to electromagnetic interference, one of the "1"s in a set of data becomes a "0", or a "0" becomes a "1", then according to the parity check principle in step five, the number of "1"s in the entire set of data is odd, and the region judgment continues.

[0015] The present invention adopts the above technical solution and has the following technical effects compared with the prior art: During the transmission of massive amounts of temperature, humidity, and salinity data from multi-layer soil profiles, the system can encode the transmitted data, decode the received data, and determine whether there are any errors during the reception process. It can also locate and correct errors, solving the problems of missing, extra, and incorrect data, and improving the transmission efficiency and accuracy of massive amounts of data. Attached Figure Description

[0016] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.

[0017] Figure 1 This is a flowchart of the data transmission method in this invention; Figure 2 This is a diagram showing the area check code settings in this invention; Figure 3 This is a diagram showing the division of region 1 in this invention; Figure 4 This is a diagram showing the division of region 2 in this invention; Figure 5 This is a diagram showing the division of region 3 in this invention; Figure 6 This is a diagram showing the division of region 4 in this invention; Figure 7 This is an example diagram of error correction in this invention. Detailed Implementation

[0018] An embodiment of a soil temperature, humidity, and salinity integrated detection device includes a soil sensor, an MCU module, a communication module, a power management module, and a storage module. The power management module provides power to each module. The MCU module is connected to the soil sensor, communication module, and storage module, and is responsible for coordinating the work of each module, parsing soil sensor data, performing data encoding and error correction, controlling the communication module to send data, and receiving instructions from the host computer. The storage module is used to temporarily store data that has not been transmitted in time (such as when communication is interrupted), and retransmit it after the link is restored to avoid data loss. It also stores historical data for local analysis or fault backtracking. The communication module is used for data transmission and supports switching between multiple communication methods, using LoRa+NB-IoT. For example, LoRa is used first in field environments to reduce power consumption, and automatically switches to NB-IoT for remote transmission when the coverage area is exceeded.

[0019] like Figure 1 As shown, a data transmission method for an integrated soil temperature, humidity, and salinity detection device includes the following steps: Step 1: Soil sensors collect soil data; Step 2: The MCU module encodes the soil data collected by the soil sensor; The soil sensor acquires parameter data of the soil profile, rounds the parameter data, converts the decimal data to hexadecimal, and finally encodes the soil parameter data. The encoding format is as follows: Total number of characters + number of layers + function code + numeric code + checksum; The total number of characters defines the number of characters sent, in decimal. After receiving the data, the data receiving device can determine whether any characters were missed or over-received based on the total number of characters. The number of layers specifies the depth of the soil being tested (the number of soil layers). The function codes (temperature function code is 01, humidity function code is 02, salinity function code is 03) specify the data type; The numerical code specifies the magnitude of the detected value; The checksum specifies the sum of adjacent data. If the sum of adjacent data in the received data does not match the checksum, it indicates an error in the data transmission, and data correction is required.

[0020] For example: The soil sensor obtained a soil temperature value of 29.62 for the third layer of soil, and this data is intended to be transmitted to the data receiving device.

[0021] To avoid the inconvenience of transmitting data in decimal places, the data is first multiplied by 100 and rounded down: 29.62 * 100 = 2962.

[0022] To facilitate binary data transmission, the decimal number 2962 is then converted to hexadecimal as 0B92.

[0023] According to the above encoding format, the data is encoded as follows: 0C 03 01 0B 92 AD; Since a total of 12 characters need to be sent, the total number of characters is 0C in decimal, the layer number is 03, the function code is 01 (temperature function code is 01, humidity function code is 02, salinity function code is 03), the numerical code is 0B92, and the checksum is 0C+03+01+0B+92=AD. Note that only the last two digits of the checksum are taken.

[0024] Step 3: Convert to binary; The data transmission method uses a high-low level mode, where a high level represents 1 and a low level represents 0. Therefore, the soil parameter data encoding in step one needs to be changed to binary.

[0025] Continuing with the example above: 0C 03 01 0B 92 AD converted to 8-bit binary is: 00001100 0000001100000001 00001011 10010010 10101101.

[0026] Step 4: Add parity check for the entire group; During data transmission, electromagnetic interference may occasionally cause errors in high and low level detection. In binary data, the error is manifested as "0" becoming "1" or "1" becoming "0". A set of data usually contains several to a dozen data points. During transmission, even if an error occurs, it is usually only one error. The probability of two errors occurring simultaneously in the same set of data is extremely low.

[0027] Let's first discuss a case of an incorrect character: By adding a parity check bit to the original data, it is possible to determine whether there is an error. When the total number of "1"s in a set of data is odd, the parity check code is set to "1"; when the total number of "1"s in a set of data is even, the parity check code is set to "0". Including the parity check code, the number of "1"s in this data set is always even. If, in the received data, a data point changes from 0 to 1, or from 1 to 0, the number of 1s in this data set will become odd. By counting the parity of the number of "1"s in a received set of data, it can be determined whether there is an error in the data set.

[0028] Continuing with the example above: Add a parity check code for the first and second positions: 000001100 000000011 100000001 100001011 110010010110101101 In the first group of data, there are two "1"s, so the first parity check code is set to "0". Similarly, in the last group of data, there are five "1"s, so the first parity check code is set to "1". In this way, the number of "1"s in each group of data is even.

[0029] Step 5: Add regional parity checking; A single parity check code for a complete set of data can only determine whether there are erroneous codes, but cannot locate the erroneous codes. By adding regional parity check codes, the location of erroneous codes can be located.

[0030] If there are errors, according to the binary search principle, the array is divided into two regions. If there are no errors in one region, then the errors must exist in the other region.

[0031] By dividing the data into binary regions with different rows and columns, and ensuring that there is overlap between the regions, parity checks, judgments, and filtering can be performed separately to locate the position of the bit error and determine whether there are multiple bit errors.

[0032] Let's take 16-bit binary as an example: like Figure 2 As shown: The 16-bit binary array is divided into 4 rows and 4 columns, forming 4 overlapping regions. A parity check code is added to each region. The number in the first row and first column (number 1) is the group check code, which is responsible for verifying the entire group of data; The number in the second column of the first row (number 2) is the check code for area 1, which is responsible for verifying the data in area 1 (columns 2 and 4); The number in the first row and third column (number 3) is the check code for area 2, which is responsible for verifying the data in area 2 (columns 3 and 4). The number in the first column of the second row (number 5) is the check code for area 3, which is responsible for verifying the data in area 3 (rows 2 and 4). The number in the first column of the third row (number 9) is the check code for area 4, which is responsible for verifying the data in area 4 (rows 3 and 4). By setting the checksum, the number of "1"s in the entire array and each region is made even.

[0033] Step six: Send data via the communication module; Step 7: Data reception and error correction; After the data is sent, it is received sequentially by the data receiving device in the form of an array. If, due to electromagnetic interference, one of the "1"s in a set of data becomes a "0", or a "0" becomes a "1", then according to the parity check principle above, the number of "1"s in the entire set of data is odd, and the region judgment continues.

[0034] like Figure 3 As shown, if the number of "1"s in the 8 data points of region 1 is odd, the error will be in column 2 or column 4; if the number of "1"s in the 8 data points of region 1 is even, the error will be in column 1 or column 3. like Figure 4 As shown, if the number of "1"s in the 8 data points of region 2 is odd, the error will be in column 3 or column 4; if the number of "1"s in the 8 data points of region 2 is even, the error will be in column 1 or column 2. By using parity checks in regions 1 and 2, bit errors can be located in a specific column.

[0035] like Figure 5 As shown, if the number of "1"s in the 8 data points of region 3 is odd, the error will occur in the 2nd or 4th row; if the number of "1"s in the 8 data points of region 1 is even, the error will occur in the 1st or 3rd row. like Figure 6 As shown, if the number of "1"s in the 8 data points of region 4 is odd, the error will occur in the 3rd or 4th row; if the number of "1"s in the 8 data points of region 2 is even, the error will occur in the 1st or 2nd row.

[0036] By using parity checks in regions 1 and 2, bit errors can be located in a specific row.

[0037] The intersection of rows and columns is the location of the error. By flipping the error (changing "1" to "0" or "0" to "1"), the error can be corrected.

[0038] Furthermore, in extremely low probability, if a "0" becomes a "1" and a "1" becomes a "0" simultaneously in the same set of data, although the number of "1"s in the 16-bit data is even, the number of "1"s in the area where the error occurs is odd. This results in a contradiction between the parity check of the entire set of data and the parity check of the area data, indicating that two errors occurred in the data set during transmission.

[0039] The probability of multiple errors occurring simultaneously in an array is extremely low, and the solution is to retransmit the data.

[0040] Specific implementation of error correction: like Figure 7 As shown, the transmitted data is 1011110100100100. According to the parity check rule, since the number of "1"s from the 2nd to the 7th bit is 7, the 1st bit is used as the parity check code for the whole group and is set to "1" so that the number of "1"s in the whole group is an even number of 8. Since the number of "1"s in columns 2 and 4 is 4, the second bit is set to "0" as the parity check code for region 1, so that the number of "1"s in region 1 is an even number of 4. Similarly, the third bit is used as the parity check code for region 2 and is set to "1" so that the number of "1"s in region 2 is an even number of 4. Similarly, the 5th bit is used as the parity check code for region 3, and is set to "1" so that the number of "1"s in region 3 is an even number of 4. Similarly, the 9th bit is used as the parity check code for region 4, and is set to "0" so that the number of "1"s in region 4 is an even number, 2. Suppose that during transmission, the 10th bit of data changes from "0" to "1", which makes the total number of "1"s in the group an odd number of 9, and the number of "1"s in region 1 an odd number of 5. The number of "1"s in region 1 remains unchanged. It is deduced that the error is in the 2nd or 4th column, not in the 3rd or 4th column. Therefore, the error is in the 2nd column. The number of "1"s in region 3 remains unchanged, while the number of "1"s in region 4 becomes an odd number of 3. Therefore, the error is not in the 2nd or 4th row, but in the 3rd or 4th row. So the error is in the 3rd row.

[0041] The intersection of the second column and the third row can be used to locate the error at position 10. The error correction can be completed by flipping the "1" in the data at position 10 to "0".

[0042] Step 8: After the data parity check passes, the data is stored in the storage module.

[0043] The description of this invention is given for illustrative and descriptive purposes only and is not intended to be exhaustive or to limit the invention to the forms disclosed. Many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described in order to better illustrate the principles and practical application of the invention and to enable those skilled in the art to understand the invention and design various embodiments with various modifications suitable for a particular purpose.

Claims

1. A data transmission method for an integrated soil temperature, humidity, and salinity detection device, characterized in that: The detection device includes a soil sensor, an MCU module, a communication module, a power management module, and a storage module. The power management module provides power to each module, and the MCU module is connected to the soil sensor, the communication module, and the storage module. Includes the following steps: Step 1: Soil sensors collect soil data; Step 2: The MCU module encodes the soil data collected by the soil sensor; Step 3: Convert to binary. The data transmission method uses a high-low level mode, where a high level represents 1 and a low level represents 0. Therefore, the soil parameter data encoding in Step 1 needs to be changed to binary. Step 4: Add parity check for the entire group; Step 5: Add regional parity checking; Step six: Send data via the communication module; Step 7: Data reception and error correction; Step 8: After the data parity check passes, the data is stored in the storage module.

2. The data transmission method of the integrated soil temperature, humidity, and salinity detection device as described in claim 1, characterized in that: The encoding format for the soil data in step two is as follows: Total number of characters + number of layers + function code + numeric code + checksum; The total number of characters defines the number of characters sent, using decimal. After receiving the data, the data receiving device can determine whether any characters were missed or over-received based on the total number of characters. The number of layers specifies the depth of the soil being tested; The function code specifies the data type: temperature function code is 01, humidity function code is 02, and salinity function code is 03. The numeric code specifies the magnitude of the detected value; The checksum specifies the sum of adjacent data. If the sum of adjacent data in the received data does not match the checksum, it indicates an error in the data transmission, and data correction is required.

3. The data transmission method of the integrated soil temperature, humidity, and salinity detection device as described in claim 1, characterized in that: The implementation process of step four is as follows: By adding a parity check bit to the original data, it is possible to determine whether there is an error. When the total number of "1"s in a set of data is odd, the parity check code is set to "1"; when the total number of "1"s in a set of data is even, the parity check code is set to "0". Including the parity check code, the number of "1"s in this data set is always even. If, in the received data, a data point changes from 0 to 1, or from 1 to 0, the number of 1s in this data set will become odd. By counting the parity of the number of "1"s in a received set of data, it can be determined whether there is an error in the data set.

4. The data transmission method of the integrated soil temperature, humidity, and salinity detection device as described in claim 1, characterized in that: The implementation process of step five is as follows: A single parity check code for the entire set of data can only determine whether there are erroneous codes, but cannot locate the erroneous codes. By adding regional parity check codes, and by setting the check codes so that the number of "1"s in the entire array and each region is even, the location of the erroneous codes can be located. If there are errors, according to the binary search principle, the array is divided into two regions. If there are no errors in one region, then the errors must exist in the other region. By dividing the data into binary regions with different rows and columns, and ensuring that there is overlap between the regions, parity checks, judgments, and filtering can be performed separately to locate the position of the bit error and determine whether there are multiple bit errors.

5. The data transmission method of the integrated soil temperature, humidity, and salinity detection device as described in claim 4, characterized in that: The implementation process of step seven is as follows: After the data is sent, it is received sequentially by the data receiving device in the form of an array. If, due to electromagnetic interference, one of the "1"s in a set of data becomes a "0", or a "0" becomes a "1", then according to the parity check principle in step five, the number of "1"s in the entire set of data is odd, and the region judgment continues.