A sampling data transmission method based on multi-stage correction
Patent Information
- Application Number
- CN202310907576.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-24
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-07-24
AI Technical Summary
但是在采样间隔固定的情况下,重传次数受制于传输带宽,往往重传次数很有限,在电磁环境恶劣的条件下,多次重传很可能造成数据时延过大,甚至重传数据超过采样间隔影响后续数据传输,造成丢失的采样点严重等问题
[0031](1)在本发明中,接收侧使用三级修正的方法对数据进行解码和修正,每次修正数据失败后需要对数据进行存储;一级修正对首帧数据进行处理,使用汉明码分组修正可以对数据进行还原;二级修正对首帧和一次重发数据数据进行处理,使用汉明分组修正和穷举分组修正可以对整帧数据进行还原;三级修正对首帧、一次重发数据和二次重发数据进行处理,使用汉明分组修正和按位三取二修正的方法可以对整帧数据进行还原。接收侧每级修正失败的范围:一级修正无法还原数据的范围是:首帧数据的任何单组中出现多比特错误;二级修正无法还原数据的范围是:首帧数据和一次重发数据数据的任何相同单组中出现相同的数据位同时出错,且错误的数据位数量大于1;三级修正无法还原数据的范围是:首帧、一次重发数据和二次重发数据的任何相同单组中出现,相同的数据位在这三帧数据中有两帧以上同时出错,且错误的数据位数量大于1。
Smart Images

Figure CN116866451B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of relay protection technology for power systems, and specifically relates to a sampling data transmission method based on multi-level correction. Background Technology
[0002] Relay protection devices are crucial for the safe and stable operation of power systems. In a power system, relay protection devices collect data from primary equipment or indirectly through secondary equipment, calculate the operating status of the power system, and promptly implement effective control and isolation measures when faults occur, thus protecting the safety of the power system.
[0003] In relay protection devices, sampled data needs to be transmitted between multiple boards. In environments with severe electromagnetic interference, the transmitted data can be easily affected, causing errors in the data received by the receiver. Therefore, it is often necessary to verify the transmitted data. The verification method used is usually cyclic redundancy check (CRC), which discards data frames with verification errors and retransmits them. However, with a fixed sampling interval, the number of retransmissions is limited by the transmission bandwidth, and the number of retransmissions is often very limited. Under harsh electromagnetic conditions, multiple retransmissions may cause excessive data delays, or even exceed the sampling interval, affecting subsequent data transmission and causing serious problems such as lost sampling points. Summary of the Invention
[0004] To overcome the problems in the prior art, this invention proposes a sampling data transmission method based on multi-level correction.
[0005] The technical solution of the present invention to solve the above-mentioned technical problems is as follows:
[0006] This invention provides a sampling data transmission method based on multi-level correction, comprising the following steps:
[0007] Step 100. The sending side acquires the sampled data, encodes the sampled data as a whole using cyclic redundancy check, groups the encoded sampled data into groups, and then encodes the grouped data using Hamming code to form a transmission data frame.
[0008] Step 200. Receive the transmitted data frame on the receiving side and perform verification and correction on the received data frame. If the verification and correction fails, retransmit the data, up to two times.
[0009] Furthermore, step 100 specifically includes the following steps:
[0010] Step 101: The sending side obtains the data field, that is, obtains a set of sampled data;
[0011] Step 102: Cyclic Redundancy Check Calculation: Perform CRC operation on the sampled data to generate CRC check codes and form a cyclic redundancy check field;
[0012] Step 103: Group the data field and the cyclic redundancy check field as a whole;
[0013] Step 104: Calculate the Hamming check code for each group of data and arrange them sequentially to form the Hamming code check field;
[0014] Step 105: Combine the data field, cyclic redundancy check field, and Hamming code check field to form the final transmitted data frame and send it to the receiving side.
[0015] Furthermore, step 200 specifically includes the following steps:
[0016] Step 210: The receiving side receives the transmitted data frame and identifies the data field, cyclic redundancy check field, and Hamming code check field in the data frame according to the data length of the received data frame.
[0017] Step 221: Perform cyclic redundancy check on the received data frame; if the cyclic redundancy check is successful, the data frame is received correctly.
[0018] Step 222: If the cyclic redundancy check fails, perform Hamming code verification and Hamming correction on each packet in the received data frame; if the Hamming code verification passes, do not perform Hamming correction, otherwise perform Hamming correction; after Hamming correction, perform cyclic redundancy check on the corrected data frame.
[0019] Step 223: If the cyclic redundancy check is successful, the data correction is considered successful and the correct data is obtained; if the cyclic redundancy check fails, the data frame correction is considered failed and the sampled data is retransmitted.
[0020] Step 224: The receiving side receives the retransmitted data once and executes steps 210, 221, and 222. If the cyclic redundancy check passes, the data is considered correct, and the retransmitted data is considered correct. If the cyclic redundancy check fails, the first frame data and the retransmitted data are grouped and exhaustively corrected.
[0021] Step 225: Perform Hamming code verification and Hamming correction on the data obtained after grouped exhaustive search and correction. If Hamming code verification and Hamming correction fail, delete the group of data. If Hamming code verification and Hamming correction succeed, retain the group of data that has been verified correctly and the corrected data. Perform a second combination exhaustive search on the exhaustive data in all groups to obtain the second combination exhaustive data. Perform cyclic redundancy check on each group of exhaustive data. At most, one correct verification result can be obtained. If all group exhaustive search results fail the cyclic redundancy check, resend the sampled data.
[0022] Step 226: For the received second retransmission data, execute steps 210, 221, and 222 again. If the cyclic redundancy check passes, the data is considered correct. If the Hamming code check passes, no Hamming correction is performed. If the Hamming code check and correction fail, the first frame data, the first retransmission data, and the second retransmission data need to be corrected by taking two out of three groups.
[0023] Step 227: For the data corrected by taking two out of three groups, first perform cyclic redundancy check. If the cyclic redundancy check is successful, the correct data is obtained. If the cyclic redundancy check fails, perform Hamming code check and Hamming correction for each group to obtain the corrected data frame. Perform cyclic redundancy check again. If the cyclic redundancy check is successful, the correct data is obtained. If the cyclic redundancy check fails, the result of the correction by taking two out of three groups is considered to have failed, and the sampled data will not be retransmitted.
[0024] Furthermore, the cyclic redundancy check specifically includes: performing CRC operation on the received data frame using the CRC-32 algorithm to generate a CRC check code, comparing this CRC check code with the CRC check code of the sending data, and if they match, the data frame is considered to have been received correctly; otherwise, the cyclic redundancy check fails.
[0025] Further, the grouped exhaustive correction specifically includes: performing a bitwise XOR operation on the first frame data and the retransmitted data in groups, recording the number of data bits with a result of 1 in each group as {n1, n2, n3...}, exhaustively searching for 0s and 1s at the positions where the XOR result of the data bits is 1, and forming new data, with each group yielding {2...}. n1 ,2 n2 ,2 n3 ...} data frames.
[0026] Furthermore, a 2-out-of-3 grouping correction is performed on the first frame data, the first retransmitted data, and the second retransmitted data: the received three data are processed bit by bit, that is, if the results of the three data bits are inconsistent, the majority result is used to obtain a corrected data frame.
[0027] Furthermore, the Hamming code verification specifically involves: inserting the Hamming check bit into the packet data frame, performing an XOR operation between the Hamming check bit and the packet data frame for verification; if the verification result is 0, the Hamming code verification passes and the data is correct; if the verification result is not 0, it indicates that an error bit has occurred in the data.
[0028] Furthermore, the Hamming correction is: inverting the error bit to correct the error bit.
[0029] Furthermore, it also includes: if the group exhaustive search correction operation time exceeds the preset time, the data correction is considered to have failed and the data is directly resent.
[0030] Compared with the prior art, the present invention has the following technical effects:
[0031] (1) In this invention, the receiving side uses a three-level correction method to decode and correct the data. After each data correction failure, the data needs to be stored. The first-level correction processes the first frame data and uses Hamming code block correction to restore the data. The second-level correction processes the first frame and the first retransmitted data and uses Hamming block correction and exhaustive block correction to restore the entire frame data. The third-level correction processes the first frame, the first retransmitted data, and the second retransmitted data and uses Hamming block correction and bit-by-bit correction to restore the entire frame data. The range of failure for each level of correction on the receiving side is as follows: The range where the first-level correction cannot restore the data is: multiple bits are incorrect in any single group of the first frame data. The range where the second-level correction cannot restore the data is: the same data bits are incorrect in any single group of the first frame data and the first retransmitted data, and the number of incorrect data bits is greater than 1. The range where the third-level correction cannot restore the data is: the same data bits are incorrect in more than two of the three frames, and the number of incorrect data bits is greater than 1.
[0032] (2) In this invention, the Hamming code verification and Hamming correction of the first frame data, the first retransmitted data, and the second retransmitted data are not independent. As the number of retransmissions increases, the success rate of Hamming code verification and Hamming block correction also increases. Since the probability of errors occurring in the same block is low, block processing can effectively suppress the decrease in computational efficiency and the probability of errors as the data length increases. The CRC check encoding of the entire frame data can be corrected at multiple levels to prevent the data from failing the check due to correct data but CRC check encoding failure during transmission.
[0033] (3) In this invention, the sampling data transmission can adapt to various data lengths. The multi-level correction method can perform fast verification when there is less interference and fast data correction when there is severe interference. The data correction speed can have a positive gain with the increase of the number of retransmissions. It has a good effect on strong interference in a short period of time, and the probability that the data cannot be corrected even after multi-level correction is extremely low. Attached Figure Description
[0034] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This is a schematic diagram of the process of the present invention;
[0036] Figure 2 This is a schematic diagram of data framing on the transmitting side of the present invention;
[0037] Figure 3 This is a schematic diagram of the Hamming verification method of the present invention. Detailed Implementation
[0038] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the specific implementation methods, structures, features, and effects of the technical solutions proposed according to the present invention are described in detail below with reference to the accompanying drawings and preferred embodiments. Specific features, structures, or characteristics in one or more embodiments may be combined in any suitable form. Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0039] Existing relay protection devices first verify the transmitted data; if the data is incorrect, it is discarded and then retransmitted. In harsh environments, this can lead to multiple consecutive data packet drops and retransmissions, causing not only bandwidth loss but also excessive data delays. This invention proposes a multi-level correction-based sampling data transmission method. This method uses a multi-level correction approach, processing data step-by-step according to the degree of influence of the external electromagnetic environment, to restore the correct data.
[0040] Reference Figures 1-3 In one embodiment of the present invention, a sampling data transmission method based on multi-level correction is provided, comprising the following steps:
[0041] Step 100. The sending side acquires the sampled data, encodes the sampled data as a whole using cyclic redundancy check, groups the encoded sampled data into groups, and then encodes the grouped data using Hamming code to form a transmission data frame.
[0042] It is worth noting that Cyclic Redundancy Check (CRC) is a fast algorithm that generates a short, fixed-length check code based on data such as network packets or computer files. It is mainly used to detect or verify errors that may occur after data transmission or storage.
[0043] In this embodiment, a set of sampled data of length Ld is obtained, the sampled data is encoded as a whole using CRC, the encoded sampled data is grouped, and then Hamming code is used to encode the grouped data to form a transmission data frame.
[0044] In a specific embodiment, it includes:
[0045] Step 101: The sending side obtains the data field DATA: that is, obtains a set of sampled data with a length of Ld.
[0046] Step 102: Cyclic Redundancy Check Calculation: Perform CRC operation on the sampled data using the CRC-32 algorithm to generate a 4-byte CRC check code, forming a cyclic redundancy check field.
[0047] Step 103: Treat the data field and the cyclic redundancy check field as a whole, and group them into groups of 30 bytes each. If the last few bytes are less than 30 bytes, divide them into one group.
[0048] Step 104: Calculate the Hamming check code for each group of data and arrange them sequentially to form the Hamming check field HM;
[0049] According to the Hamming code check principle, the number of check bits k and the number of data bits n satisfy:
[0050] 2 k ≥n+k+1
[0051] In this embodiment, 8 parity bits are used to detect 240 bits of data. The 8 parity bits are: P1, P2, P3, P4, P5, P6, P7, P8, and the 240 bits of data are: D1, D2, D3, ... D 240 .
[0052] The Hamming check code is obtained using the following formula:
[0053]
[0054] Step 105: The data field, cyclic redundancy check (CRC) field, and Hamming code check field are combined to form the final transmitted data frame and sent to the receiving side. The data field (DATA) has a length of Ld, the CRC field has a length of Lc, and the Hamming code check field (HM) has a length of Lh.
[0055] Step 200: Receive and transmit data frames on the receiving side, and perform verification and correction on the received data frames. If the verification and correction fail, retransmit the data, up to two times.
[0056] Step 210: Receive the transmitted data frame on the receiving side, and identify the data field, cyclic redundancy check field, and Hamming code check field in the data frame according to the data length of the received data frame.
[0057] When receiving a data frame, the receiving side needs to parse out the data field length Ld, the cyclic redundancy check field length Lc, and the Hamming code check field length Lh.
[0058] Since the cyclic redundancy check (CRC) field length Lc = 4, therefore,
[0059] Lα=Ld+4+Lh
[0060]
[0061] get: Take the smallest integer value to get Lh, and then get Ld.
[0062] The data frame does not use length to represent the range of data fields or check fields to prevent length errors during transmission from causing the inability to identify the range of each data field and thus making calculation impossible. However, by performing calculations on the entire frame of data according to the formula in this method, the range of each data field can be obtained, which can better ensure the validity of the data.
[0063] Step 220: Perform cyclic redundancy check, Hamming code check, and correction on the received data frame, specifically including the following sub-steps:
[0064] Step 221: Perform cyclic redundancy check on the received data frame. If the cyclic redundancy check is successful, the data frame is received correctly.
[0065] The CRC-32 algorithm is used to perform CRC operation on the data frame to generate a 4-byte CRC checksum. This 4-byte CRC checksum is compared with the 4-byte CRC checksum of the data sent from the transmitting side. If they match, the data frame is considered to have been received correctly. If the cyclic redundancy check fails, it means that there are data bit errors in the data frame. Hamming code check and Hamming correction need to be performed on each packet in the received data frame.
[0066] It's worth noting that the CRC check principle essentially involves appending an r-bit check code (sequence) to a p-bit binary data sequence, thus forming a binary sequence of total length n = p + r bits. This check code appended to the data sequence has a specific relationship with the data content. If one or more bits in the data sequence become incorrect due to interference or other reasons, this specific relationship will be disrupted. Therefore, by checking this relationship, the correctness of the data can be verified.
[0067] CRC-32 Algorithm: The sending and receiving sides need to agree on a divisor beforehand for modulo-2 division. The divisor must satisfy the generator polynomial. The polynomial value of CRC32 is 0x4C11DB7. The process of generating the CRC-32 checksum is as follows: Shift the p bits of data to be sent left by 32 bits, perform modulo-2 division on the p+32 bits of data, with the divisor being 0x4C11DB7. The remainder R obtained is the CRC checksum.
[0068] Step 222: If the cyclic redundancy check fails, perform Hamming code verification and Hamming correction on each packet in the received data frame; if the Hamming code verification passes, no Hamming correction is performed, indicating that the data frame is correct; otherwise, Hamming correction is performed; after Hamming correction, perform cyclic redundancy check on the corrected data frame.
[0069] Perform Hamming code verification and Hamming correction on each packet in the received data frame;
[0070] The basic idea of Hamming code check and Hamming correction is to divide the data frame into several groups, arrange a check bit in each group for parity testing, generate multiple bits of detection information, and determine the specific error location from them. Finally, the error is corrected by inverting the error bits (if it was originally 1, it becomes 0, and if it was originally 0, it becomes 1).
[0071] The number of parity bits k and the number of data bits n satisfy the following formula:
[0072] 2 k ≥n+k+1
[0073] Table 1. Correspondence between the number of check bits and the number of data bits
[0074] Verification bit depth 2 3 4 5 6 7 8
[0075] During the calculation process, the checksum needs to be mixed with the data for encoding; that is, the checksum is inserted into the data. The checksum must be within the range of 2. k Location.
[0076] The parity bit uses P k Represented as: P1, P2, P3…P k Data uses D n Indicates: D1, D2, D3…D n .
[0077] Therefore, the encoding formed after inserting the check code into the data is shown in the table below.
[0078] Table 2 Hamming code grouping method
[0079]
[0080]
[0081] If even parity is used, then the k parity bits form k groups and k formulas:
[0082] All data positions corresponding to group P1 satisfy the condition that the first bit of the binary representation of the position is 1 from low to high.
[0083] All data positions corresponding to group P2 satisfy the condition that the second bit of the binary representation of the position is 1 from low to high.
[0084] All data positions corresponding to group P3 satisfy the condition that the third bit of the binary representation of the position is 1 from low to high.
[0085] ...
[0086] P k All data positions corresponding to a group satisfy the following condition: all data whose binary representation of the position is 1 at the k-th bit from low to high.
[0087] That is: the k-th formula satisfies that the encoded data position can be divided by 2. k XOR all divisible data; if the parity is even, the XOR result is 0.
[0088]
[0089] get
[0090]
[0091] The process of Hamming code check and Hamming correction is as follows: The check bits and data bits are calculated according to the above positional requirements to obtain the solution check bits G1, G2, G3…G… k .
[0092]
[0093] Arrange the parity bits from high to low in G. k …G3G2G1 yields binary data, which is the verification result. If the verification result is 0, it means the data verification is correct. If the verification result is not 0, it means there is an error in the data. If it is a single-bit error, the value of the verification result is the location of the erroneous data. Therefore, by inverting the corresponding position in the encoded data position, the corrected data can be obtained.
[0094] Step 223: After Hamming code verification and Hamming correction, perform cyclic redundancy check on the corrected data frame; if the cyclic redundancy check is successful, the data correction is considered successful and the correct data is obtained; if the cyclic redundancy check fails, the data frame correction is considered unsuccessful, indicating that more than one bit of data error has occurred in a single group, and the sampled data is retransmitted.
[0095] Step 224: The receiving side receives the retransmitted data once and executes steps 210, 221, and 222 to perform cyclic redundancy check on the corrected data frame. If the cyclic redundancy check is successful, the retransmitted data is considered correct. If the cyclic redundancy check fails, the first frame data and the retransmitted data are grouped and exhaustively corrected.
[0096] If both Hamming code verification and Hamming correction fail in the first frame and the first retransmitted data, a group-based exhaustive correction is performed. Specifically, the first frame and the first retransmitted data are XORed bit by bit in groups, and the number of bits with a 1 in each group is recorded as {n1, n2, n3...}. The positions with a 1 in the XOR result are then exhausted by searching for 0s and 1s to form new data. Each group yields {2...} n1 ,2 n2 ,2 n3 ...} data frames.
[0097] Step 225: For each group of exhaustive searches, correct the resulting {2} n1 ,2 n2 ,2 n3 ...} groups of data are subjected to Hamming code verification and Hamming correction respectively. If the Hamming code verification result in a group is not 0, the correction is considered to have failed, and the group of data is deleted. The {m1, m2, m3...} data frames that failed verification and cannot be corrected are deleted, and the correctly verified data and the corrected {2...} data frames are retained. n1 -m1,2 n2 -m2,2 n3 -m3……} correct data frames, then each group of data will obtain the exhaustive data according to the XOR result, and the exhaustive data in all groups will be combined twice to exhaustively enumerate, resulting in (2 n1 -m1)(2 n2 -m2)(2 n3 If we exhaustively enumerate the data of the complete package (-m3)......′ and perform cyclic redundancy check on each data, we can get at most one correct check result.
[0098] If all grouping exhaustive results fail the cyclic redundancy check, the sampled data will be resent.
[0099] In particular, since the computation time for grouped exhaustive search depends on the number of data bits whose XOR result is 1, a timeout needs to be set according to the actual situation. If the timeout occurs, the data correction is considered to have failed, and the data is resent directly.
[0100] Step 226: For the received retransmitted data, perform the cyclic redundancy check, Hamming code check, and Hamming correction as described in steps 210, 221, and 222 again. If the cyclic redundancy check passes, the data is considered correct. If the Hamming code check and correction both fail, the first frame data, the first retransmitted data, and the second retransmitted data need to be corrected by taking two out of three groups.
[0101] If the first frame, the first retransmitted frame, and the second retransmitted frame cannot be corrected, a 2-out-of-3 grouping correction is performed. Specifically, the received three data bits are processed by a 2-out-of-3 operation. That is, if the results of the three corresponding data bits are inconsistent, the majority result is used to obtain a corrected data frame.
[0102] Step 227: After correcting the data by taking two out of three groups, perform a cyclic redundancy check (CR) first. If the CR is successful, the correct data is obtained. If the CR fails, perform Hamming code verification and Hamming correction on each group to obtain a corrected data frame. Perform the CR again. If the CR is successful, the correct data is obtained. If the CR fails, the result of the two out of three group correction is considered to have failed, and the sampled data will not be retransmitted.
[0103] If the 3-out-of-2 result fails, it means that the external environment is too harsh to obtain the correct data through multi-level correction, and the data after retransmission has too much delay and is unusable. The correct data can only be obtained through software interpolation.
[0104] In this invention, the receiving side uses a three-level correction method to decode and correct the data. After each data correction failure, the data needs to be stored. The first-level correction processes the first frame data and uses Hamming code block correction to restore the data. The second-level correction processes the first frame and the first retransmitted data and uses Hamming block correction and exhaustive block correction to restore the entire frame data. The third-level correction processes the first frame, the first retransmitted data, and the second retransmitted data and uses Hamming block correction and bitwise 2-out-of-3 correction to restore the entire frame data.
[0105] The range of failure for each level of correction on the receiving side is as follows: Level 1 correction cannot restore data when multiple bits are incorrect in any single group of the first frame data; Level 2 correction cannot restore data when the same data bits are incorrect in any identical single group of the first frame data and the first retransmitted data, and the number of incorrect data bits is greater than 1; Level 3 correction cannot restore data when the same data bits are incorrect in any identical single group of the first frame, the first retransmitted data, and the second retransmitted data, and the same data bits are incorrect in more than two of these three frames, and the number of incorrect data bits is greater than 1.
[0106] The Hamming code verification and Hamming correction of the first frame, the first retransmitted data, and the second retransmitted data are not independent. As the number of retransmissions increases, the success rate of Hamming code verification and Hamming block correction also improves. Because the probability of errors occurring in the same block is low, block processing effectively suppresses the decrease in computational efficiency and the probability of errors as data length increases. The CRC checksum of the entire frame can be corrected at multiple levels to prevent data from failing verification due to correct data but CRC checksum failure during transmission.
[0107] This invention can adapt to the transmission of sampled data of various lengths. The multi-level correction method can perform fast verification when there is little interference, and can also perform fast data correction when there is severe interference. The data correction speed can have a positive gain with the increase of retransmission. It has a good effect on strong interference in a short period of time, and the probability that the data cannot be corrected even after multi-level correction is extremely low.
[0108] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A sampling data transmission method based on multi-level correction, characterized in that, Includes the following steps: Step 100. The sending side acquires the sampled data, encodes the sampled data as a whole using cyclic redundancy check, groups the encoded sampled data into groups, and then encodes the grouped data using Hamming code to form a transmission data frame. Step 100 specifically includes the following steps: Step 101: The sending side obtains the data field, that is, obtains a set of sampled data; Step 102: Cyclic Redundancy Check Calculation: Perform CRC operation on the sampled data to generate CRC check codes and form a cyclic redundancy check field; Step 103: Group the data field and the cyclic redundancy check field as a whole; Step 104: Calculate the Hamming check code for each group of data and arrange them sequentially to form the Hamming code check field; Step 105: Combine the data field, cyclic redundancy check field, and Hamming code check field to form the final transmitted data frame and send it to the receiving side; Step 200. Receive the transmitted data frame on the receiving side and perform verification and correction on the received data frame. If the verification and correction fails, retransmit the data, up to two times. Step 200 specifically includes the following steps: Step 210: The receiving side receives the transmitted data frame and identifies the data field, cyclic redundancy check field, and Hamming code check field in the data frame according to the data length of the received data frame. Step 221: Perform cyclic redundancy check on the received data frame; if the cyclic redundancy check is successful, the data frame is received correctly. Step 222: If the cyclic redundancy check fails, perform Hamming code verification and Hamming correction on each packet in the received data frame; if the Hamming code verification passes, do not perform Hamming correction, otherwise perform Hamming correction; after Hamming correction, perform cyclic redundancy check on the corrected data frame. Step 223: If the cyclic redundancy check is successful, the data correction is considered successful and the correct data is obtained; if the cyclic redundancy check fails, the data frame correction is considered failed and the sampled data is retransmitted. Step 224: The receiving side receives the retransmitted data and executes steps 210, 221, and 222. If the cyclic redundancy check passes, the data is considered correct, and the retransmitted data is considered correct. If the cyclic redundancy check fails, the first frame data and the retransmitted data are grouped and exhaustively corrected. Step 225: Perform Hamming code verification and Hamming correction on the data obtained after grouped exhaustive search and correction. If Hamming code verification and Hamming correction fail, delete the group of data. If Hamming code verification and Hamming correction succeed, keep the group of data that has been verified correctly and the corrected data. Perform a second combination exhaustive search on all the exhaustive data in all groups to obtain the second combination exhaustive data. Perform cyclic redundancy check on the second combination exhaustive data, and at most one correct verification result can be obtained. If all grouping exhaustive results fail the cyclic redundancy check, then resend the sampled data; Step 226: For the received second retransmission data, execute steps 210, 221, and 222 again. If the cyclic redundancy check passes, the data is considered correct. If the Hamming code check passes, no Hamming correction is performed. If the Hamming code check and correction fail, the first frame data, the first retransmission data, and the second retransmission data need to be corrected by taking two out of three groups. Step 227: For the data corrected by taking two out of three groups, first perform cyclic redundancy check. If the cyclic redundancy check is successful, the correct data is obtained. If the cyclic redundancy check fails, perform Hamming code check and Hamming correction for each group to obtain the corrected data frame. Perform cyclic redundancy check again. If the cyclic redundancy check is successful, the correct data is obtained. If the cyclic redundancy check fails, the result of the correction by taking two out of three groups is considered to have failed, and the sampled data will not be retransmitted.
2. The sampling data transmission method based on multi-level correction according to claim 1, characterized in that, The cyclic redundancy check specifically includes: performing CRC operation on the received data frame using the CRC-32 algorithm to generate a CRC check code, comparing this CRC check code with the CRC check code of the transmitted data. If they match, the data frame is considered to have been received correctly; otherwise, the cyclic redundancy check fails.
3. The sampling data transmission method based on multi-level correction according to claim 1, characterized in that, The grouped exhaustive correction specifically includes: performing a bitwise XOR operation on the first frame data and the retransmitted data in groups, recording the number of data bits with a result of 1 in each group as {n1, n2, n3...}, exhaustively searching for 0s and 1s at the positions where the XOR result of the data bits is 1, and forming new data, with each group yielding {2...}. n1 ,2 n2 ,2 n3 ...} data frames.
4. The sampling data transmission method based on multi-level correction according to claim 1, characterized in that, The first frame of data, the first retransmitted data, and the second retransmitted data are grouped into two groups of three for correction: the three received data are processed bit by bit, that is, if the results of the three corresponding data bits are inconsistent, the majority result is used to obtain a corrected data frame.
5. The sampling data transmission method based on multi-level correction according to claim 1, characterized in that, The Hamming code verification process specifically involves inserting a Hamming check bit into the data frame, performing an XOR operation between the Hamming check bit and the data frame, and verifying the data by performing an XOR operation. If the result is 0, the Hamming code verification passes and the data is correct. If the result is not 0, it indicates that an error bit has occurred in the data.
6. The sampling data transmission method based on multi-level correction according to claim 5, characterized in that, The Hamming correction is: inverting the erroneous bit to correct it.
7. The sampling data transmission method based on multi-level correction according to claim 1, characterized in that, Also includes: If the group exhaustive search correction operation time exceeds the preset time, the data correction is considered to have failed, and the data is directly resent.
Citation Information
Patent Citations
Oil field underground data transmission system and method
CN115842842A