Data processing method and system, electronic equipment and readable storage medium
By performing binary conversion and combination verification on the raw data through the acquisition device, a verification code is generated, and the server corrects the erroneous data. This solves the problem of data broadcast storms caused by data transmission errors in IoT devices, and reduces the operational pressure and downtime risk of the server.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING QDING INTERCONNECTION TECHNOLOGY CO LTD
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-21
AI Technical Summary
Data errors caused by environmental factors during data transmission in IoT devices can trigger data broadcast storms, increasing the operational pressure on the server and the risk of downtime.
The acquisition device performs binary conversion and combination verification on the raw data, generates multiple verification codes, and sends them to the server through the gateway device. The server corrects the erroneous data based on the verification codes.
Significantly reduces the number of data retransmissions, lowers the probability of data broadcast storms, and alleviates server-side operational pressure and downtime risk.
Smart Images

Figure CN121907401A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data processing method, system, electronic device, and readable storage medium. Background Technology
[0002] As shopping malls and property management become increasingly technologically advanced, more and more projects are introducing Internet of Things (IoT) technology, connecting various sensors, cameras, and controllers to the network. The introduction of IoT technology has greatly refined the management of shopping malls and properties, improved operational efficiency, and is a necessary hardware guarantee for future refined management.
[0003] With the adoption of various devices in the cloud, IoT data is experiencing exponential growth. The data processed by the server every day is measured in TB or PB, which puts enormous pressure on the server's operations and increases hardware costs. Many edge-collected data are transmitted incorrectly due to environmental factors, and the continuous retransmission of data causes data broadcast storms, which greatly increases the operational pressure on the server and increases the risk of server downtime.
[0004] In summary, how to reduce the probability of data broadcast storms in order to reduce server-side operational pressure and downtime risk is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide a data processing method, system, electronic device and readable storage medium to reduce the probability of data broadcast storms, thereby reducing server operational pressure and downtime risk.
[0006] To achieve the above objectives, this application provides the following technical solution: A data processing method, applied to a data acquisition device, includes: converting the acquired raw data into binary data to obtain raw binary data; combining the raw binary data and verifying each group of combined data to obtain multiple level-one checksums; obtaining target data based on the raw binary data and the multiple level-one checksums; sending the target data to a server through a gateway device; and having the server determine erroneous data in the valid binary data of the target data based on the received target data, and correcting the erroneous data.
[0007] Optionally, the original binary data is combined, and each group of combined data is verified to obtain multiple first-level check codes, including: obtaining the number of bits in the original binary data; taking the square root of the number of bits and rounding up to obtain a division step size; dividing the original binary data according to the division step size to obtain multiple first data groups; wherein, if there is a spare position in the last first data group, the spare position is filled with 0; verifying the data in each first data group to obtain a corresponding first check code; combining the data at the same position in each first data group into a second data group, and verifying the data in each second data group to obtain a corresponding second check code.
[0008] Optionally, it further includes: generating a secondary verification code based on the first verification code and the second verification code; wherein the target data further includes the secondary verification code.
[0009] Optionally, the server determines the erroneous data in the valid binary data of the target data based on the target data, and corrects the erroneous data, including: the server determines the number of erroneous data in the valid binary data based on the target data; if the number of erroneous data is determined to be one, then the server determines the erroneous data in the valid binary data based on the first check code and the second check code, and inverts the erroneous data; wherein the inversion process is: if the erroneous data is 0, then 0 is changed to 1, and if the erroneous data is 1, then 1 is changed to 0.
[0010] Optionally, it further includes: if it is determined that the number of erroneous data is greater than one, the server discards the target data and sends a notification to the gateway device to retransmit the target data.
[0011] A data processing method, applied on a server side, includes: receiving target data sent by a gateway device; the target data being sent to the gateway device by a collection device; the collection device performing binary conversion on the collected raw data to obtain raw binary data; combining the raw binary data and verifying each group of combined data to obtain multiple level-one checksums; obtaining the target data based on the raw binary data and the multiple level-one checksums; determining erroneous data in the valid binary data of the target data based on the received target data, and correcting the erroneous data.
[0012] Optionally, determining erroneous data in the valid binary data of the received target data and correcting the erroneous data includes: determining the number of erroneous data in the valid binary data based on the target data; if the number of erroneous data is determined to be one, then determining the erroneous data in the valid binary data based on a first check code and a second check code, and inverting the erroneous data; the inversion process is as follows: if the erroneous data is 0, then change 0 to 1; if the erroneous data is 1, then change 1 to 0; wherein, the first check code is the number of bits of the original binary data acquired by the acquisition device, the square root of the number of bits is taken and rounded up to obtain the division step size, the original binary data is divided according to the division step size to obtain multiple first data groups, wherein if there is a blank position in the last first data group, then the blank position is filled with 0; the corresponding check code is obtained by verifying the data in each first data group; the second check code is the corresponding check code obtained by combining the data at the same position in each first data group into a second data group, and verifying the data in each second data group.
[0013] A data processing system includes a data acquisition device, a gateway device, and a server. The data acquisition device is used to convert acquired raw data into binary data to obtain raw binary data; combine the raw binary data and verify each group of combined data to obtain multiple level-one checksums; obtain target data based on the raw binary data and the multiple level-one checksums, and send the target data to the gateway device; the gateway device sends the target data to the server; the server is used to determine erroneous data in the valid binary data within the target data based on the target data, and correct the erroneous data.
[0014] An electronic device includes: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of a data processing method applied to a data acquisition device as described in any of the preceding claims, or the steps of a data processing method applied to a server as described in any of the preceding claims.
[0015] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of a data processing method applied to an acquisition device as described in any of the preceding claims, or the steps of a data processing method applied to a server as described in any of the preceding claims.
[0016] This application provides a data processing method, system, electronic device, and readable storage medium. The method is applied to a data acquisition device and includes: converting the acquired raw data into binary data to obtain raw binary data; combining the raw binary data and verifying each group of combined data to obtain multiple level-one check codes; obtaining target data based on the raw binary data and the multiple level-one check codes; sending the target data to a server through a gateway device; and having the server determine erroneous data in the valid binary data of the target data based on the received target data and correct the erroneous data.
[0017] The technical solution disclosed in this application involves a data acquisition device converting the acquired raw data into binary data, combining and verifying the raw binary data to obtain multiple level-one checksums, and then obtaining target data based on the raw binary data and the level-one checksums. The target data is then sent to the server via a gateway device. If transmission errors occur during the transmission of the target data from the acquisition device to the gateway device due to environmental or other factors, the raw binary data will differ from the valid binary data received by the server. The server can determine the erroneous data within the valid binary data based on the level-one checksums and valid binary data in the received target data, and correct the erroneous data. This data checking and error correction significantly reduces the number of retransmissions due to data errors, lowers the probability of data broadcast storms, and reduces server operational pressure and downtime risk.
[0018] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0019] Figure 1 A flowchart illustrating a data processing method applied to an acquisition device, provided in some embodiments of this application; Figure 2 A schematic diagram of a data matrix provided for some embodiments of this application; Figure 3 This is a flowchart illustrating a data processing method applied to a server, provided for some embodiments of this application. Detailed Implementation
[0020] With the accelerating pace of technological innovation in the shopping mall and property management sectors, Internet of Things (IoT) technology is being widely applied in various projects, seamlessly connecting devices such as sensors, cameras, and controllers to the network. This integration of technology has not only greatly promoted the refinement of shopping mall and property management and significantly improved operational efficiency, but also laid a solid hardware foundation for efficient management in the future.
[0021] With more and more devices connecting to the network and transmitting data to the cloud, the amount of IoT data is exploding. Servers need to process terabytes (TB) or even petabytes (PB) of data daily, undoubtedly posing significant operational challenges and hardware cost pressures. Adding to the complexity, due to environmental and other factors, much edge-collected data is prone to errors during transmission, leading to continuous retransmissions and triggering data broadcast storms. This further increases the operational burden on servers and raises the potential risk of server downtime.
[0022] To address this, this application provides a data processing method, system, electronic device, and readable storage medium. The acquisition device performs binary conversion on the acquired raw data to obtain raw binary data, and then combines and verifies the raw binary data to obtain multiple level-one checksums. Based on the raw binary data and the level-one checksums, target data is obtained and sent to the server via a gateway device. If transmission errors occur during the transmission of target data from the acquisition device to the gateway device due to environmental or other factors, the raw binary data will differ from the valid binary data received by the server. The server can determine the erroneous data within the valid binary data based on the level-one checksums and valid binary data in the received target data, and correct the erroneous data. This achieves data checking and error correction, significantly reducing the number of retransmissions due to data errors, thereby lowering the probability of data broadcast storms and reducing server operational pressure and downtime risk. Therefore, this application cleverly adds redundant data to achieve data checking and error correction functions, significantly reducing the number of retransmissions due to data errors, thus greatly reducing the probability of data broadcast storms, effectively alleviating server operational pressure, and effectively reducing server downtime risk. This approach not only provides strong support for low-cost and highly stable operations, but also opens up new avenues for the widespread application of IoT technology in shopping malls and property management.
[0023] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0024] See Figure 1 The flowchart provided in some embodiments of this application illustrates a data processing method applied to a data acquisition device, which may include: S11: Perform binary conversion on the collected raw data to obtain raw binary data.
[0025] In some embodiments of this application, after acquiring raw data, the acquisition device (such as various sensors, cameras, and controllers) can perform binary conversion on the raw data to obtain the raw binary number.
[0026] If the raw data collected by the acquisition device is an integer, it can be directly converted to binary. If the raw data collected by the acquisition device is in decimal form, the raw data can be enlarged to obtain the raw data in integer form, and then the raw data in integer form can be converted to binary. Of course, if the raw data collected by the acquisition device is in decimal form, other methods can also be used for binary conversion.
[0027] S12: Combine the original binary data, verify each group of combined data, and obtain multiple level-one check codes.
[0028] After obtaining the raw binary data, the acquisition device can combine the raw binary data and verify each group of combined data to obtain multiple first-level check codes. The verification mentioned here can be parity checking, specifically odd parity (adding a check bit to the data bits to make the number of 1s in the entire data an odd number) or even parity (adding a check bit to the data bits to make the number of 1s in the entire data an even number). For example, if a data group is 011000100011001, if odd parity is used, the first check code corresponding to this data group will be 1; if even parity is used, the first check code corresponding to this data group will be 0.
[0029] Generating multiple first-level check codes facilitates the location of erroneous data and the determination of the number of erroneous data based on the check codes.
[0030] S13: Obtain the target data based on the original binary data and multiple first-level check codes, and send the target data to the server through the gateway device. The server determines the erroneous data in the valid binary data of the target data based on the received target data and corrects the erroneous data.
[0031] After obtaining multiple Level 1 check codes, the acquisition device can obtain the target data based on the original binary data and the multiple Level 1 check codes. Specifically, the target data can be composed of the original binary data and the multiple Level 1 check codes, that is, the target data can contain the original binary data and the multiple Level 1 check codes.
[0032] Subsequently, the acquisition device sends the target data to the gateway device via serial communication (such as RS-485 or RS-232 communication). During this process, the original binary data in the target data may experience transmission errors due to environmental factors. Some embodiments of this application can reduce data retransmission caused by transmission errors by obtaining multiple first-level checksums through the aforementioned binary conversion and verification, and by the server's location and correction of erroneous data. This reduces the risk of data broadcast storms, thereby alleviating the operational burden on the server and reducing the risk of server downtime. It should be noted that in serial communication, 99% (or more) of the data will not have transmission errors. The remaining 1% is essentially data with a one-bit error, data with two-bit errors is extremely rare, and data with three or more bits errors is almost impossible (i.e., the probability of three or more bits errors occurring in serial transmission can be considered an impossible event).
[0033] After receiving the target data, the gateway device can transmit the target data to the server via the network using the TCP / IP (Transmission Control Protocol / Internet Protocol) protocol. The target data sent by the gateway device includes valid binary data and multiple level-one checksums. The valid binary data is the binary data in the target data excluding the checksums. If no errors occur during the transmission from the acquisition device to the gateway device, the valid binary data is the same as the original binary data; if errors occur during the transmission, the valid binary data is different from the original binary data. Upon receiving the target data from the gateway device, the server can identify erroneous data within the valid binary data based on the received data and the level-one checksums. It can then correct these erroneous data to reduce data retransmissions, thereby lowering the probability of data broadcast storms, reducing the operational burden on the server, and mitigating the risk of server downtime.
[0034] The server can determine the number of erroneous data based on the valid binary data and level 1 checksum in the target data. If the number of erroneous data (it should be noted that in some embodiments of this application, the erroneous data refers to the number of erroneous bits, and the number of erroneous data is the same as the number of erroneous bits) is 1, the erroneous data can be corrected. If the number of erroneous data is greater than 1, in order to avoid data correction errors, a notification to retransmit the target data can be sent to the gateway device. After receiving the notification, the gateway device can instruct the acquisition device to retransmit the corresponding target data. Since transmission errors are basically one bit of data, by correcting one bit of data error without requiring the gateway device and acquisition device to retransmit, the number of data retransmissions can be reduced, significantly reducing the probability of data broadcast storms. This reduces the amount of data processed by the server, alleviating the operational pressure on the server and reducing the risk of server downtime. It also improves the reliability and stability of server operation, providing strong support for low-cost, high-stability operation.
[0035] This application provides a data processing method in some embodiments that combines original binary data, verifies each group of combined data, and obtains multiple first-level check codes, which may include: Obtain the number of bits in the original binary data, take the square root of the number of bits and round it up to get the partition step size; The original binary data is divided according to the division step size to obtain multiple first data groups; if there are empty positions in the last first data group, the empty positions are filled with 0; Verify the data in each first data group to obtain the corresponding first check code; The data at the same position in each of the first data groups are combined into a second data group. The data in each second data group are then verified to obtain the corresponding second check code.
[0036] In some embodiments of this application, the process of the acquisition device combining the original binary data and verifying each group of combined data to obtain multiple level-one check codes can be specifically as follows: (1) Obtain the number of bits of the original binary data (i.e. determine the data length of the original binary data), take the square root of the number of bits of the original binary data and round up to obtain the partition step size (i.e. how many original binary data are divided into a first data group); where, rounding up is to ensure that all original binary data can be partitioned into the first data group.
[0037] (2) Divide the original binary data according to the division step size to obtain multiple first data groups; specifically, each division step size of original binary data is divided into a first data group, and the first data group contains the division step size of original binary data.
[0038] In some embodiments of this application, when opening up the number of bits of the original binary data, if the number of bits of the original binary data is a perfect square, it is opened up to obtain an integer. In this case, the data contained in the last second data group are all the corresponding original binary data. If the number of bits of the original binary data is not a perfect square, it is opened up to obtain a decimal. By taking the square root and rounding up, the division step size can be made an integer. When dividing the original binary data according to the division step size, if the last first data group is not filled with the corresponding original binary data (i.e., it does not contain the corresponding original binary data of the division step size), the empty positions in the last first data group can be filled with 0 to facilitate verification processing and other processing.
[0039] (3) Verify the original binary data in each first data group to obtain the first check code corresponding to each first data group; wherein, the check mentioned here can be odd check or even check.
[0040] (4) Combine the original binary data at the same position in all the first data groups into a second data group, and verify the original binary data in each second data group to obtain the second check code corresponding to each second data group; wherein, the verification method mentioned here is the same as the verification method for the original binary data in the first data group. The aforementioned process is as follows: combine the first original binary data in all the first data groups into a first second data group, verify the second data group to obtain the corresponding second check code; combine the second original binary data in all the second data groups into a first second data group, verify the second data group to obtain the corresponding second check code... combine the last original binary data in all the second data groups into a first second data group, verify the second data group to obtain the corresponding second check code.
[0041] For example, if each first data group is treated as a row in a data matrix (or data cell), then the first checksum corresponding to each first data group can be considered as the row checksum of each row in the data matrix. In this case, the second data group can be considered as a column in the data matrix, and the second checksum corresponding to each second data group can be considered as the column checksum of the data matrix. See, for example: Figure 2This is a schematic diagram of a data matrix provided in some embodiments of this application. In the data matrix, the data at positions 5, 6, 7, 9, 10, 11, 13, 14, and 15 are raw binary data. The data at positions 5, 6, and 7 form the first first data group; the data at positions 9, 10, and 11 form the second first data group; and the data at positions 13, 14, and 15 form the third second data group. The data at position 4 is the first checksum corresponding to the first first data group; the data at position 8 is the first checksum corresponding to the second first data group; and the data at position 12 is the first checksum corresponding to the third first data group. Correspondingly, the data at positions 5, 9, and 13 form the first second data group; the data at position 1 is the second checksum corresponding to the first second data group; the data at positions 6, 10, and 14 form the second second data group; the data at position 2 is the second checksum corresponding to the second second data group; the data at positions 7, 11, and 15 form the third second data group; and the data at position 3 is the second checksum corresponding to the third second data group.
[0042] The above method allows for the combination of raw binary data across multiple dimensions. Each data group resulting from this combination is then verified to obtain a corresponding checksum. This enables the server to use the checksum to verify the valid binary data in the received target data, identify erroneous data, and perform subsequent processing. This improves the accuracy of identifying misaligned data, reduces the probability of data broadcast storms, and enhances the reliability and accuracy of data received by the server.
[0043] A data processing method provided in some embodiments of this application may further include: A secondary check code is generated based on the first and second check codes; the target data may also include the secondary check code.
[0044] In some embodiments of this application, after verifying the data in each first data group to obtain a corresponding first checksum, and combining the data at the same position in each first data group into a second data group, and verifying the data in each second data group to obtain a corresponding second checksum, a secondary checksum can be generated based on the first and second checksums. Specifically, the secondary checksum can be generated by verifying the first and second checksums, or by verifying the first checksum, the second checksum, and the original binary data. The method for generating the secondary checksum can be the same as or different from the method for generating the first and second checksums. For example, the first and second checksums can use odd parity, and the secondary checksum can use even parity; or both can use odd parity; or both can use even parity; or the first and second checksums can use even parity, and the secondary checksum can use odd parity, etc.
[0045] Based on this, the acquisition device obtains the target data according to the original binary data and multiple first-level check codes. Specifically, the acquisition device obtains the target data according to the original binary data, the first check code, the second check code, and the second-level check code. That is, the target data may also include the second-level check code. Therefore, the total number of bits of the target data is n×n + 2×n×1 + 1, where n is the division step size obtained by taking the square root of the number of bits of the original binary data and rounding it up, n×n is the total number of data in all first data groups, 2×n×1 is the total number of the first and second check codes, and 1 corresponds to the aforementioned second-level check code. Considering that network transmission usually uses 8 bits as 1 byte, after obtaining the total number of bits of the target data, the total number of bits can be rounded to the nearest multiple of 8 to obtain the final encoding length, and then error correction encoding can be performed. For example, as shown... Figure 2 As shown, the data at position 0 is the secondary check bit, meaning it serves as the secondary check bit for positions 1, 2, 3 and 4, 8, 12. When any bit in positions 5, 6, 7, 9, 10, 11, 13, 14, or 15 is incorrect, the column and row checks for parity will fail. Intersecting the erroneous row and column will uniquely locate a point; this bit is the check error bit (i.e., erroneous data). Inverting the erroneous bit (changing 0 to 1 or 1 to 0) will locate and correct the error. Position 0 is the check bit for positions 1, 2, 3 and 4, 8, 12 in the parity check table. When this bit is incorrect, the entire data frame is discarded.
[0046] By generating a secondary checksum, the server can determine the number of erroneous data based on the secondary checksum, the first checksum, and the second checksum, thereby improving the accuracy of erroneous data correction and target data retransmission decisions.
[0047] This application provides a data processing method in some embodiments, in which the server determines erroneous data in the valid binary data of the target data based on the target data, and corrects the erroneous data, which may include: The server determines the number of erroneous data in the valid binary data based on the target data; If the number of erroneous data is determined to be one, then the erroneous data in the valid binary data is determined according to the first check code and the second check code, and the erroneous data is inverted; wherein, the inversion process is as follows: if the erroneous data is 0, then 0 is changed to 1, and if the erroneous data is 1, then 1 is changed to 0.
[0048] In some embodiments of this application, the process by which the server determines erroneous data in the valid binary data of the target data based on the target data and corrects the erroneous data can be as follows: (1) The server determines the number of erroneous data in the valid binary data of the target data based on the target data; (2) If the number of erroneous data in the valid binary data is determined to be one, the erroneous data in the valid binary data can be determined based on the first check code and the second check code. Then, the erroneous data is inverted. The process of inverting the erroneous data can be: if the erroneous data is 0, change 0 to 1; if the erroneous data is 1, change 1 to 0, so as to correct the erroneous data. Specifically, the above process can be implemented using either of the following two methods: The first method: (a1) The server uses the same method as the acquisition device to generate the first and second check codes based on the original binary data, and generates the third and fourth check codes based on the valid binary data. Specifically, the server obtains the number of bits of the valid binary data, squares the valid binary data and rounds it up to obtain the partitioning step size (for distinction, the partitioning step size here can be called the second partitioning step size, and the partitioning step size obtained by the acquisition device by squares the number of bits of the original binary data and rounding it up can be called the first partitioning step size). The valid binary data is partitioned according to the second partitioning step size to obtain multiple third data groups. If there are empty positions in the last third data group, the empty positions are filled with 0. The data in each third data group is checked to obtain the corresponding third check code. The data at the same position in each third data group is combined into a fourth data group, and the data in each fourth data group is checked to obtain the corresponding fourth check code.
[0049] (a2) The server compares each third checksum with its corresponding first checksum and each fourth checksum with its corresponding second checksum. If each third checksum is the same as its corresponding first checksum and each fourth checksum is the same as its corresponding second checksum, then the valid binary data is determined to be the same as the original binary data, meaning the number of erroneous data in the valid binary data is 0. If there is a third checksum that is different from its corresponding first checksum and a fourth checksum that is different from its corresponding second checksum, then the number of erroneous data in the valid binary data is determined to be one. Furthermore, the erroneous data in the valid binary data can be determined based on the third checksum that is different from its corresponding first checksum and the fourth checksum that is different from its corresponding second checksum. Specifically, the data point where the third data group corresponding to the third checksum that is different from its corresponding first checksum and the fourth data group corresponding to the fourth checksum that is different from its corresponding second checksum intersects is the location of the erroneous data, and the data at that data point is the erroneous data. Then, the erroneous data is inverted to correct the erroneous data. If more than one third check code is different from the corresponding first check code, or more than one fourth check code is different from the corresponding second check code, then the number of erroneous data in the valid binary data is greater than one. In this case, the number of erroneous data cannot be located. To avoid false corrections, a notification to retransmit the target data can be sent to the gateway device. After receiving the notification, the gateway device can instruct the acquisition device to retransmit the corresponding target data.
[0050] The second method: The server can determine the number of erroneous data points in valid binary data based on Hamming codes. Specifically: (b1) The server generates the third and fourth verification codes in the same way as the data acquisition device generates the first and second verification codes; (b2) The server generates the second-level checksum in the same way as the acquisition device (to distinguish them, the second-level checksum generated by the acquisition device by verifying the first and second checksums is called the first-level checksum, and the second-level checksum generated by the server by verifying the third and fourth checksums is called the second-level checksum). For example, the acquisition device can generate the first-level checksum by verifying the first checksum, the second checksum, and the original binary data, and the server can generate the second-level checksum by verifying the third checksum, the fourth checksum, and the valid binary data.
[0051] (b3) The server can determine the number of erroneous data in the valid binary data based on the first and second level check codes, the second level check code, the first check code, and the second check code. Specifically, the server can compare whether the first and second level check codes are the same.
[0052] (b4) If the first and second level check codes are different, then it is determined that there is an erroneous data in the valid binary data. These can be numbered 0, 1, 2…(n+1). 2 The target data is arranged in a -1 manner, with the 0th bit being the second-level checksum, the 1st to nth bits being the first-level checksum, and the x×n+nth bits (x=1,2,3...,n) being the second-level checksum. The remaining bits are valid binary data. Alternatively, the target data can be arranged in a similar manner. Figure 2 The data is converted using a data matrix format (i.e., the second-level checksum is at position 0, the first element of each remaining row of the data matrix is the first-level checksum, and the first element of each remaining column of the data matrix is the second-level checksum; the data numbers are arranged according to the data matrix format). This is based on the check bit P in Hamming code. k (k=2) i-1 (i.e., P, i=1,2,3……) k The binary position number corresponds to the position number (P1 corresponds to the least significant bit of the binary position number = 1, P2 corresponds to the second bit from the right = 1, P4 corresponds to the third bit from the right = 1, P8 corresponds to the fourth bit from the right = 1, and so on), using the corresponding check bit P. k For the check bit P k The positions of all corresponding binary position numbers are checked to obtain the check results; then, based on the check results, the erroneous data in the valid binary data is determined, and the erroneous data is inverted.
[0053] For example, the target data is arranged in the order of numbered 0, 1, 2...15. The 0th bit is the first and second level check code, the 1st, 2nd, and 3rd bits are the first check code, the 4th, 8th, and 12th bits are the second check code, and the remaining numbered bits are valid binary data. The first check bit P1=2 is used. 0 =1 checks all positions where the least significant bit of the binary position number is 1: 1 (binary position number 0001), 3 (binary position number 0011), 5 (binary position number 0101), 7 (binary position number 0111), 9 (binary position number 1001), 11 (binary position number 1011), 13 (binary position number 1101), 15 (binary position number 1111). It is determined that the number of 1s in all positions where the least significant bit of the binary position number corresponding to the first check bit P1 is 1 is even (taking even check as an example). Therefore, the erroneous data is not in these positions (according to the data matrix arrangement, misplaced data is not in columns 2 and 4); using the second check bit P2=2... 1For all positions where the second bit from the right of the binary position number is 1 (2, 3, 6, 7, 10, 11, 14, 15), we check the second check bit P2. We find that the number of 1s in all positions where the second bit from the right of the binary position number corresponding to the second check bit P2 is odd. Therefore, the erroneous data is in these positions (according to the data matrix arrangement, misaligned data is in columns 3 and 4). Thus, we can determine that the erroneous data is in positions 2, 6, 10, and 14 (according to the data matrix arrangement, misaligned data is in column 3). Similarly, we use the fourth check bit P4 = 2... 2 =4 pairs of binary position numbers, including all positions where the third bit from the right is 1, and using the eighth parity bit P8=2 3 =8 verifies all positions where the 4th bit from the right of the binary position number is 1, thereby determining the position of the erroneous data. Then, the erroneous data at the corresponding position can be inverted (i.e., if the erroneous data is 0, change 0 to 1, and if the erroneous data is 1, change 1 to 0) to correct the erroneous data.
[0054] (b5) If the first and second level check codes are the same, and the target data is arranged in the manner described in (b4), the corresponding check bits P are used. k For the check bit P k When verifying the positions of all corresponding binary position numbers, if it is determined that there is an error in the verification result of the check bit, then the number of erroneous data is determined to be two.
[0055] (b6) If the first and second level check codes are the same, and the target data is arranged in the manner described in (b4), the corresponding check bits P are used. k For the check bit P k When verifying the positions of all corresponding binary position numbers, if it is determined that the verification results of all check bits are correct, then it is determined that there is no misaligned data in the valid binary data.
[0056] (b7) If the first and second level check codes are different, and the target data is arranged in the manner described in (b4), the corresponding check bits P are used. k For the check bit P k When verifying the positions of all corresponding binary position numbers, if it is determined that the verification results of all check bits are correct, then it is determined that the second and third level check codes are incorrect, and there is no erroneous data in the valid binary data.
[0057] The above method can accurately determine the number of erroneous data in valid binary data, and when the number of erroneous data in valid binary data is one, the erroneous data can be corrected by inverting it. This reduces the number of retransmissions caused by data errors, lowers the probability of data broadcast storms, and allows the server to use reliable and accurate data (i.e., the data collected by the acquisition device) for subsequent processing.
[0058] A data processing method provided in some embodiments of this application may further include: If the number of erroneous data points is determined to be greater than one, the server discards the target data and sends a notification to the gateway device to retransmit the target data.
[0059] In some embodiments of this application, when the server determines that the number of erroneous data in the valid binary data is greater than one (as can be seen from the above embodiments, in serial communication, if the number of erroneous data is greater than one, it almost certainly means there are two bits of erroneous data), the server can discard the corresponding target data and send a notification to the gateway device to retransmit the target data. After receiving the notification, the gateway device can send a notification to the acquisition device to retransmit the target data, so that the acquisition device can retransmit the target data to the gateway device, and the gateway device can then send the received target data to the server, so that the server can execute the relevant steps in the above embodiments, which will not be repeated here.
[0060] In addition, when the server determines that the number of erroneous data in the valid binary data is greater than one, it can also choose to issue a prompt indicating that the number of erroneous data is greater than one. This allows relevant personnel to be notified in a timely manner and take countermeasures such as inspection, thereby reducing the probability of errors occurring in the data collected by the acquisition device during transmission.
[0061] Some embodiments of this application also provide a data processing method applied to a server; see [link to relevant documentation]. Figure 3 The flowchart provided in some embodiments of this application illustrates a data processing method applied to a server, which may include: S31: Receive target data sent by the gateway device; the target data is sent from the acquisition device to the gateway device; the acquisition device performs binary conversion on the acquired raw data to obtain raw binary data; the raw binary data is combined, and each group of combined data is verified to obtain multiple first-level check codes; the target data is obtained based on the raw binary data and the multiple first-level check codes. S32: Determine the erroneous data in the valid binary data of the target data based on the received target data, and correct the erroneous data.
[0062] This application provides a data processing method in some embodiments that determines erroneous data in valid binary data within received target data and corrects the erroneous data, including: Determine the number of erroneous data in the valid binary data based on the target data; If the number of erroneous data is determined to be one, then the erroneous data in the valid binary data is determined according to the first check code and the second check code, and the erroneous data is inverted; the inversion process is as follows: if the erroneous data is 0, then 0 is changed to 1, and if the erroneous data is 1, then 1 is changed to 0; The first checksum is obtained by taking the square root of the original binary data acquired by the acquisition device and rounding it up to obtain the partitioning step size. The original binary data is then partitioned according to the partitioning step size to obtain multiple first data groups. If there are empty positions in the last first data group, the empty positions are filled with 0. The corresponding checksum is obtained by verifying the data in each first data group. The second checksum is obtained by combining the data at the same position in each first data group into a second data group and verifying the data in each second data group.
[0063] A data processing method provided in some embodiments of this application may further include: If the number of erroneous data is determined to be greater than one, the target data is discarded and a notification to retransmit the target data is sent to the gateway device.
[0064] Some embodiments of this application also provide a data processing system, which may include a data acquisition device, a gateway device, and a server, wherein: the data acquisition device is used to convert the acquired raw data into binary data to obtain raw binary data; combine the raw binary data, verify each group of combined data to obtain multiple level-one check codes; obtain target data based on the raw binary data and the multiple level-one check codes, and send the target data to the gateway device; the gateway device sends the target data to the server; the server is used to determine the erroneous data in the valid binary data of the target data based on the target data, and correct the erroneous data.
[0065] Some embodiments of this application also provide an electronic device that may include: Memory, used to store computer programs; The processor, when executing a computer program stored in memory, can implement the steps of any of the above-described data processing methods applied to an acquisition device or to a data processing method applied to a server.
[0066] Some embodiments of this application also provide a readable storage medium, which, when executed by a processor, can implement the steps of any of the data processing methods applied to an acquisition device or the steps of a data processing method applied to a server.
[0067] For a description of the relevant parts of the data processing method, data processing system, electronic device and readable storage medium applied to the server provided in some embodiments of this application, please refer to the detailed description of the corresponding parts of the data processing method applied to the acquisition device provided in some embodiments of this application, and will not be repeated here.
[0068] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0069] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0070] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0071] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0072] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "joining," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise expressly limited. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0073] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A data processing method, characterized in that, Applied to data acquisition devices, including: The collected raw data is converted into binary data to obtain raw binary data; The original binary data is combined, and each group of combined data is verified to obtain multiple first-level check codes. The target data is obtained based on the original binary data and multiple first-level check codes. The target data is then sent to the server through the gateway device. The server determines the erroneous data in the valid binary data of the target data based on the received target data and corrects the erroneous data.
2. The data processing method according to claim 1, characterized in that, The original binary data is combined, and each combined data group is verified to obtain multiple level-one check codes, including: Obtain the number of bits in the original binary data, take the square root of the number of bits and round it up to get the division step size; The original binary data is divided according to the division step size to obtain multiple first data groups; wherein, if there is a spare position in the last first data group, the spare position is filled with 0; Verify the data in each of the first data groups to obtain the corresponding first verification code; The data at the same position in each of the first data groups are combined into a second data group, and the data in each of the second data groups are verified to obtain the corresponding second verification code.
3. The data processing method according to claim 2, characterized in that, Also includes: A secondary check code is generated based on the first check code and the second check code; wherein, the target data also includes the secondary check code.
4. The data processing method according to claim 2 or 3, characterized in that, The server determines erroneous data within the valid binary data of the target data based on the target data, and corrects the erroneous data, including: The server determines the number of erroneous data in the valid binary data based on the target data; If the number of erroneous data is determined to be one, then the erroneous data in the valid binary data is determined according to the first check code and the second check code, and the erroneous data is inverted; wherein, the inversion process is: if the erroneous data is 0, then 0 is changed to 1, and if the erroneous data is 1, then 1 is changed to 0.
5. The data processing method according to claim 4, characterized in that, Also includes: If the number of erroneous data points is determined to be greater than one, the server discards the target data and sends a notification to the gateway device to retransmit the target data.
6. A data processing method, characterized in that, Applied to the server side, including: The system receives target data sent by a gateway device; the target data is sent to the gateway device by a data acquisition device; the data acquisition device performs binary conversion on the acquired raw data to obtain raw binary data; the raw binary data is combined, and each group of combined data is verified to obtain multiple first-level check codes; the target data is obtained based on the raw binary data and the multiple first-level check codes. Based on the received target data, identify erroneous data in the valid binary data of the target data, and correct the erroneous data.
7. The data processing method according to claim 6, characterized in that, Based on the received target data, erroneous data is identified in the valid binary data within the target data, and the erroneous data is corrected, including: Determine the number of erroneous data in the valid binary data based on the target data; If the number of erroneous data is determined to be one, then the erroneous data in the valid binary data is determined according to the first check code and the second check code, and the erroneous data is inverted; the inversion process is as follows: if the erroneous data is 0, then 0 is changed to 1, and if the erroneous data is 1, then 1 is changed to 0; Wherein, the first check code is the number of bits of the original binary data acquired by the acquisition device, the square root of the number of bits and rounded up to obtain the division step size, the original binary data is divided according to the division step size to obtain multiple first data groups, wherein if there is a blank position in the last first data group, the blank position is filled with 0; the corresponding check code is obtained by verifying the data in each first data group; the second check code is the corresponding check code obtained by combining the data at the same position in each first data group into a second data group, and verifying the data in each second data group.
8. A data processing system, characterized in that, This includes data acquisition devices, gateway devices, and server-side components, among which: The acquisition device is used to convert the acquired raw data into binary data to obtain raw binary data; combine the raw binary data, verify each group of combined data to obtain multiple first-level check codes; obtain target data based on the raw binary data and the multiple first-level check codes, and send the target data to the gateway device. The gateway device sends the target data to the server. The server is used to determine erroneous data in the valid binary data of the target data based on the target data, and to correct the erroneous data.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the data processing method applied to an acquisition device as described in any one of claims 1 to 5, or the steps of the data processing method applied to a server as described in any one of claims 6 to 7.
10. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the data processing method applied to an acquisition device as described in any one of claims 1 to 5, or the steps of the data processing method applied to a server as described in any one of claims 6 to 7.