Data verification methods, distributed systems and storage media
By employing a parity error detection code verification method in a distributed system, the problem of low efficiency in data transmission consistency verification is solved, achieving efficient data verification and system performance optimization.
Patent Information
- Application Number
- CN202211534487.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-02
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2042-12-02
AI Technical Summary
In existing technologies, consistency verification of data transmission in distributed systems is inefficient and burdensome on system performance. Ordinary encryption and signature verification methods cannot accurately determine the deviation of transmitted data, resulting in additional performance burden.
The parity error detection code verification method is adopted. The target data is converted into error detection information through a preset processing algorithm, and a parity error detection code is generated at the receiving end. The code is matched and verified to determine the consistency of data transmission. Parity verification can be performed on only a small amount of data to ensure the consistency of data transmission.
It improves the speed and efficiency of data verification, reduces the error correction cost caused by erroneous data being stored in the database, and enhances system performance.
Smart Images

Figure CN116170113B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data verification, and in particular to a data verification method, a distributed system, and a storage medium. Background Technology
[0002] A distributed system consists of a group of computer nodes that coordinate to complete a common task. These nodes communicate with each other over a network to transmit data. However, data transmission between nodes in a distributed system may experience deviations due to network fluctuations, leading to discrepancies between the sender and receiver. Current technologies typically use standard encryption and signature verification methods to ensure data consistency between computer nodes. However, these methods are inefficient and may not accurately pinpoint deviations in the transmitted data. Furthermore, verifying data after it has been stored in a database requires a massive amount of verification data, inevitably adding an extra performance burden to the system. Summary of the Invention
[0003] Based on this, the present invention provides a data verification method, a distributed system, and a storage medium to solve the problems of low efficiency and heavy system performance burden in existing data verification processing.
[0004] A data verification method is applied to a distributed system, the distributed system including a first server and a second server; the data verification method includes:
[0005] After receiving a first acquisition request from a second server to request the acquisition of target data, the first server converts the target data into first error detection information using a preset processing algorithm; the first error detection information includes a first parity error detection code.
[0006] The second server receives the first error detection information and the target data encapsulated and transmitted by the first server, and generates a second parity error detection code based on the received first error detection information.
[0007] The second server confirms whether the second parity detection code matches the first parity detection code.
[0008] When the second parity error detection code does not match the first parity error detection code, the second server determines that the target data transmission is erroneous and resends a second acquisition request to the first server to request new target data.
[0009] A data verification method is applied to a first server; the data verification method includes:
[0010] After receiving a first acquisition request from the second server to request the acquisition of target data, the target data is converted into first error detection information through a preset processing algorithm, and the first error detection information and the target data are encapsulated and transmitted to the second server; the first error detection information includes a first parity error detection code.
[0011] The system receives a second acquisition request resent by the second server to request the acquisition of new target data. The second acquisition request is generated when the second server determines that the target data transmission is erroneous after determining that the second parity error detection code does not match the first parity error detection code. The second parity error detection code is generated by the second server based on the received first error detection information.
[0012] A data verification method is applied to a second server; the data verification method includes:
[0013] A first acquisition request is sent to a first server to request the acquisition of target data, so that the first server can convert the target data into first error detection information through a preset processing algorithm; the first error detection information includes a first parity error detection code;
[0014] Receive the first error detection information and the target data encapsulated and transmitted by the first server, and generate a second parity error detection code based on the received first error detection information;
[0015] When the second parity error detection code does not match the first parity error detection code, it is determined that the target data transmission is erroneous, and a second acquisition request for requesting new target data is resent to the first server.
[0016] A distributed system includes a first server and a second server, the distributed system being used to execute the above-described data verification method.
[0017] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described data verification method.
[0018] The aforementioned data verification method, distributed system, and storage medium, in which the first server simultaneously sends the target data and first error detection information generated by transforming the target data using a preset processing algorithm to the second server, allows the second server to first perform parity checks on the relatively small amount of first error detection information. If the parity check of the first error detection information fails, it is not necessary to continue performing consistency checks on the target data (which is relatively large in volume). Instead, it can directly determine that the received target data has a consistency deviation, i.e., that the target data transmission is erroneous, and then resend a second acquisition request to the first server to request new target data. This invention only requires parity checks on a small amount of data to ensure data transmission consistency, improving data verification speed and efficiency, avoiding erroneous data from being stored in the database, and thus reducing a series of error correction costs caused by erroneous data being stored in the database. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention 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.
[0020] Figure 1 This is a schematic diagram of the application environment of the data verification method in one embodiment of the present invention;
[0021] Figure 2 This is a flowchart of a data verification method in one embodiment of the present invention;
[0022] Figure 3 This is a flowchart of step S100 of the data verification method in one embodiment of the present invention.
[0023] Figure 4 This is a flowchart of a data verification method in another embodiment of the present invention; Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] The data verification method provided in this application can be applied to, for example... Figure 1In the application environment, both the first server 100 and the second server 200 are servers in a distributed system (that is, the first server 100 and the second server 200 are two computer nodes in the distributed system); the first server 100 communicates with the second server 200 through a network. The first server 100 and the second server 200 include, but are not limited to, various computers, laptops, smartphones, tablets, portable wearable devices, and servers.
[0026] In one embodiment, such as Figure 1 and Figure 2 As shown, a data verification method is provided, which is applied to... Figure 1 Taking a distributed system as an example, the distributed system includes a first server 100 and a second server 200; the data verification method includes the following steps:
[0027] S100, after receiving a first acquisition request from the second server 200 for requesting target data, the first server 100 converts the target data into first error detection information using a preset processing algorithm; the first error detection information includes a first parity error detection code. Here, the first server 100 is the target data sender, and the second server 200 is the target data receiver. It can be understood that, in another embodiment, the first server 100 in the distributed system can also be the target data receiver, and the second server 200 can be the target data sender. The preset processing algorithm may include MD5 algorithm and binary algorithm, etc.
[0028] In one embodiment, such as Figure 3 As shown, in step S100, converting the target data into first error detection information using a preset processing algorithm includes:
[0029] S110, the target data is converted into first MD5 data using the MD5 algorithm. Understandably, after the first server 100 receives a first retrieval request from the second server 200 requesting the acquisition of target data, the first server 100 converts the target data into first MD5 data using the MD5 algorithm. The first MD5 data is a fixed-length string, including Arabic numerals and the 26 uppercase and lowercase English letters. Preferably, the first MD5 data is a 32-bit hexadecimal string. Compared to the inconsistent length of the target data, the fixed-length first MD5 data (and the second MD5 data mentioned later) can reduce the performance overhead of adding consistency algorithms while maintaining the uniqueness of the target data. Understandably, the first MD5 data is the unique MD5 value corresponding to the target data, used to verify the consistency of the target data during transmission and reception.
[0030] S120, the first MD5 data is converted into first binary data using a binary algorithm. In this embodiment, the conversion of the first MD5 data into first binary data is used for parity checking of the first binary data in the next step. In one embodiment, the length of the first binary data is 128 bits.
[0031] S130, confirm the first quantity of a preset number in the first binary data, and generate a first parity error detection code based on the parity of the first quantity. In one embodiment, the preset number is 1, and the first quantity is the number of 1s in the bits of the first binary data. Understandably, in another embodiment, the preset number can be 0, and the first quantity is the number of 0s in the bits of the first binary data. In one embodiment, the first parity error detection code is 1 or 0; for example, if the number of 1s in the bits of the first binary data is even (the parity of the first quantity is even), then the first parity error detection code is 0; if the number of 1s in the bits of the first binary data is odd (the parity of the first quantity is odd), then the first parity error detection code is 1. Understandably, in another embodiment, if the number of 1s in the bits of the first binary data is even (the parity of the first quantity is even), the first parity error detection code can also be 1; in this case, if the number of 1s in the bits of the first binary data is odd (the parity of the first quantity is odd), then the first parity error detection code is 0.
[0032] S140, generate the first error detection information based on the first parity detection code and the first binary data. Understandably, the first error detection information includes the first parity detection code and the first binary data. In one embodiment, the first parity detection code is added before the first binary data to generate the first error detection information. Understandably, in another embodiment, the first parity detection code can also be added after or in any position within the first binary data to generate the first error detection information.
[0033] S200, the second server 200 receives the first error detection information and the target data encapsulated and transmitted by the first server 100, and generates a second parity error detection code based on the received first error detection information. It can be understood that the first error detection information and the target data received by the second server 200 are encapsulated and transmitted by the first server 100 after receiving a first acquisition request sent by the second server 200 to request the acquisition of the target data. Generally, data may deviate during network communication transmission due to various factors, resulting in differences in the data sent from the data sender to the data receiver. Therefore, in this step and subsequent steps, the first error detection information and the target data are verified to ensure consistency in data transmission. In one embodiment, the second parity error detection code follows the same generation rule as the first parity error detection code, except that it is generated based on the received first error detection information (which may be complete or partially lost during transmission), and the second parity error detection code can also be 1 or 0.
[0034] In one embodiment, generating a second parity error detection code based on the received first error detection information includes: extracting the first binary data from the first error detection information received by the second server 200; confirming a second number of preset digits in the first binary data; and generating a second parity error detection code based on the parity of the second number. In one embodiment, the preset digit is 1, and the second number is the number of 1s in the bits of the first binary data. In one embodiment, if the number of 1s in the bits of the first binary data is even, the second parity error detection code is 0; if the number of 1s in the bits of the first binary data is odd, the second parity error detection code is 1.
[0035] In another embodiment, generating a second parity error detection code based on the received first error detection information includes: confirming a third number of preset digits in the first error detection information received by the second server 200, and generating a second parity error detection code based on the parity of the third number. In one embodiment, the preset digit is 1, and the third number is the number of 1s in the digits of the first error detection information. In one embodiment, if the number of 1s in the digits of the first error detection information is even, the second parity error detection code is 0; if the number of 1s in the digits of the first error detection information is odd, the second parity error detection code is 1.
[0036] S300, the second server confirms whether the second parity detection code matches the first parity detection code. Understandably, after the second server 200 generates the second parity detection code based on the received first error detection information, it also needs to confirm whether the second parity detection code matches the first parity detection code, that is, determine the matching relationship between the second parity detection code and the first parity detection code. Specifically, if the second parity detection code is generated based on the parity of the second number of parities in the first binary data generated from the first error detection information received by the second server 200, then: if the second parity detection code is the same as the first parity detection code, it indicates that the second parity detection code matches the first parity detection code; if the second parity detection code is different from the first parity detection code, it indicates that the second parity detection code does not match the first parity detection code.
[0037] If the second parity detection code is generated based on the first error detection information received by the second server 200, then: when the first parity detection code is 1 and the second parity detection code is different from the first parity detection code, it is indicated that the second parity detection code matches the first parity detection code; when the first parity detection code is 1 and the second parity detection code is the same as the first parity detection code, it is indicated that the second parity detection code does not match the first parity detection code; when the first parity detection code is 0 and the second parity detection code is the same as the first parity detection code, it is indicated that the second parity detection code matches the first parity detection code; when the first parity detection code is 0 and the second parity detection code is different from the first parity detection code, it is indicated that the second parity detection code does not match the first parity detection code.
[0038] S400, when the second parity detection code does not match the first parity detection code, the second server 200 determines that the target data transmission is erroneous and resends a second acquisition request to the first server 100 to request new target data. It can be understood that if the second parity detection code does not match the first parity detection code, it indicates that there may be a deviation in the transmission of the target data received by the second server 200. Therefore, the second server 200 resends a second acquisition request to the first server 100 to request new target data.
[0039] The data verification method provided by this invention involves a first server 100 simultaneously sending target data and first error detection information generated by transforming the target data using a preset processing algorithm to a second server 200. The second server 200 first performs parity checking on the relatively small amount of first error detection information. If the parity check fails, it can directly determine that the received target data has a consistency deviation, i.e., the target data transmission is erroneous, without needing to further verify the consistency of the target data (which is relatively large). It then resends a second request to the first server 100 to request new target data. This invention ensures data transmission consistency by performing parity checking on only a small amount of data, improving data verification speed and efficiency, preventing erroneous data from being stored in the database, and thus reducing the series of error correction costs caused by erroneous data being stored in the database.
[0040] Understandably, in this invention, the first server 100 converts the target data into fixed-length MD5 data and performs binary conversion on the MD5 data (binary comparison is more efficient than string comparison), so that the second server 200 can directly determine whether the data has deviated by checking the parity of the binary data. In the above process, the first error detection information is short in length, consumes less resources, and improves the efficiency of data verification.
[0041] In one embodiment, such as Figure 4 As shown, after step S300, that is, after the second server confirms whether the second parity detection code matches the first parity detection code, the method further includes:
[0042] S500, when the second parity error detection code matches the first parity error detection code, the second server 200 converts the received target data into first confirmation information using the preset processing algorithm. The preset processing algorithm may include MD5 and binary algorithms, etc. The preset processing algorithm is the same as the algorithm used by the first server 100 in step S100 to convert the target data into first error detection information, and will not be described further here. Understandably, the first server 100 converts the target data into first error detection information using the preset processing algorithm, and the second server 200 converts the received target data into first confirmation information using the same preset processing algorithm. If the first error detection information is the same as the first confirmation information, it means that the target data sent by the first server 100 to the second server 200 is the same as the target data received by the second server 200 from the first server 100, and the transmission is error-free. If the first error detection information is different from the first confirmation information, it means that the target data sent by the first server 100 to the second server 200 and the target data received by the second server 200 from the first server 100 may have deviated due to some reasons, and the transmission is erroneous.
[0043] In one embodiment, in step S500, the second server 200 converts the received target data into first confirmation information using the preset processing algorithm, including:
[0044] The target data received by the second server 200 is converted into second MD5 data using the MD5 algorithm. In one embodiment, the second MD5 data is a fixed-length string, including Arabic numerals and the 26 uppercase and lowercase English letters. Preferably, the second MD5 data is a 32-bit hexadecimal string. Understandably, the second MD5 data is the unique MD5 value corresponding to the target data received by the second server 200.
[0045] The second MD5 data is converted into second binary data using a binary algorithm. In this embodiment, the conversion of the second MD5 data into second binary data is used for parity checking of the second binary data in the next step. In one embodiment, the length of the second binary data is 128 bits.
[0046] The fourth quantity of the preset number in the second binary data is confirmed, and a third parity error detection code is generated based on the parity of the fourth quantity. In one embodiment, the third parity error detection code is 1 or 0; if the number of 1s in the second binary data is even, the third parity error detection code is 0; if the number of 1s in the second binary data is odd, the third parity error detection code is 1.
[0047] The first confirmation information is generated based on the third parity detection code and the second binary data. It is understood that the first confirmation information includes the third parity detection code and the second binary data. In one embodiment, the third parity detection code is added before the second binary data to generate the first confirmation information. It is understood that the positional relationship between the third parity detection code and the second binary data in the first confirmation information is the same as the positional relationship between the first parity detection code and the first binary data in the first error detection information, thereby facilitating a consistency comparison between the first confirmation information and the first error detection information.
[0048] S600, the second server 200 confirms whether the first confirmation information is consistent with the first error detection information. It can be understood that the first confirmation information includes the third parity detection code and the second binary data, and the first error detection information includes the first parity detection code and the first binary data. In the consistency comparison between the first confirmation information and the first error detection information, as long as the third parity detection code is consistent with the first parity detection code, and the second binary data is consistent with the first binary data, then the first confirmation information is considered consistent with the first error detection information.
[0049] S700, when the first confirmation information is consistent with the first error detection information, the second server 200 determines that the target data transmission is error-free and stores the target data. It can be understood that if the first confirmation information is consistent with the first error detection information, it indicates that the target data did not deviate during transmission, and the second server 200 can store the target data.
[0050] In one embodiment, such as Figure 4 As shown, in step S600, after the second server 200 confirms whether the first confirmation information and the first error detection information are consistent, the following further steps are taken:
[0051] S800, when the first confirmation information and the first error detection information are inconsistent, the second server 200 determines that the target data transmission is erroneous and resends a third acquisition request to the first server 100 to request new target data. Understandably, the first confirmation information includes the third parity error detection code and the second binary data, and the first error detection information includes the first parity error detection code and the first binary data. In the consistency comparison between the first confirmation information and the first error detection information, if the third parity error detection code is inconsistent with the first parity error detection code, or / and the second binary data is inconsistent with the first binary data, then the first confirmation information is considered inconsistent with the first error detection information. Understandably, if the first confirmation information is inconsistent with the first error detection information, it indicates that there may be a deviation in the target data transmission received by the second server 200. Therefore, the second server 200 resends a third acquisition request to the first server 100 to request new target data and repeats the steps corresponding to step S100 and thereafter.
[0052] In one embodiment, a data verification method is also provided. Taking the application of this method in the first server 100 of a distributed system as an example, the method includes the following steps:
[0053] After receiving a first acquisition request from the second server 200 for obtaining target data, the target data is converted into first error detection information using a preset processing algorithm. The first error detection information and the target data are then encapsulated and transmitted to the second server 200. The first error detection information includes a first parity error detection code. The first server 100 is the target data sender. The preset processing algorithm may include MD5 and binary algorithms, etc. The specific implementation steps for converting the target data into first error detection information using the preset processing algorithm have been described in the above embodiments and will not be repeated here.
[0054] The system receives a second acquisition request resent by the second server 200, requesting the acquisition of new target data. This second acquisition request is generated when the second server 200 determines that the target data transmission is erroneous after determining that the second parity detection code does not match the first parity detection code. The second parity detection code is generated by the second server 200 based on the received first error detection information. Understandably, the specific steps for determining the matching relationship between the second and first parity detection codes have been described in the above embodiments and will not be repeated here.
[0055] In one embodiment, after encapsulating and transmitting the first error detection information and the target data to the second server 200, the method further includes:
[0056] The system receives a third acquisition request resent by the second server 200 for requesting new target data. This third acquisition request is generated when the second server 200 confirms that the second parity check code matches the first parity check code, but confirms that the first confirmation information does not match the first error detection information, and determines that the target data transmission is erroneous. The first confirmation information is obtained by the second server 200 through a preset processing algorithm based on the received target data. Understandably, the first confirmation information includes the third parity check code and the second binary data, and the first error detection information includes the first parity check code and the first binary data. In the consistency comparison between the first confirmation information and the first error detection information, if the third parity check code does not match the first parity check code, or / and the second binary data does not match the first binary data, then the first confirmation information is considered inconsistent with the first error detection information. Understandably, if the first confirmation information does not match the first error detection information, it indicates that there may be a deviation in the target data transmission process received by the second server 200. Therefore, the second server 200 resends a third acquisition request to the first server 100 for requesting new target data. The specific steps for determining the consistency relationship between the first confirmation information and the first error detection information have been described in the above embodiments and will not be repeated here.
[0057] In one embodiment, a data verification method is also provided. Taking the application of this method in the second server 200 of a distributed system as an example, the method includes the following steps:
[0058] A first acquisition request for obtaining target data is sent to the first server 100, so that the first server 100 can convert the target data into first error detection information using a preset processing algorithm; the first error detection information includes a first parity error detection code. The second server 200 is the target data receiving end. The preset processing algorithm may include MD5 algorithm and binary algorithm, etc. The specific implementation steps of converting the target data into the first error detection information using the preset processing algorithm have been described in the above embodiments and will not be repeated here.
[0059] The system receives the first error detection information and the target data transmitted by the first server 100, and generates a second parity error detection code based on the received first error detection information. It is understood that the specific implementation steps for generating the second parity error detection code based on the received first error detection information have been described in the above embodiments and will not be repeated here.
[0060] When the second parity detection code does not match the first parity detection code, it is determined that the target data transmission is erroneous, and a second acquisition request for obtaining new target data is resent to the first server 100. Understandably, if the second parity detection code does not match the first parity detection code, it indicates that there may be a deviation in the target data transmission received by the second server 200. Therefore, the second server 200 resents a second acquisition request for obtaining new target data to the first server 100. The specific implementation steps for determining the matching relationship between the second parity detection code and the first parity detection code have been described in the above embodiments and will not be repeated here.
[0061] In one embodiment, after generating the second parity error detection code based on the received first error detection information, the method further includes:
[0062] When the second parity error detection code matches the first parity error detection code, the received target data is converted into first confirmation information using the preset processing algorithm. The preset processing algorithm may include MD5 and binary algorithms, etc. The preset processing algorithm is the algorithm used by the first server 100 in step S100 to convert the target data into the first error detection information, and will not be described in detail here.
[0063] The system confirms whether the first confirmation information and the first error detection information are consistent. Understandably, the first server 100 converts the target data into first error detection information using the preset processing algorithm, and the second server 200 converts the received target data into first confirmation information using the same preset processing algorithm. If the first error detection information and the first confirmation information are the same, it indicates that the target data sent by the first server 100 to the second server 200 is the same as the target data received by the second server 200 from the first server 100, and the transmission is error-free. If the first error detection information and the first confirmation information are different, it indicates that the target data sent by the first server 100 to the second server 200 and the target data received by the second server 200 from the first server 100 may have deviated due to some reason, and the transmission is erroneous.
[0064] When the first confirmation information matches the first error detection information, the target data transmission is determined to be error-free, and the target data is stored. It can be understood that if the first confirmation information matches the first error detection information, it indicates that the target data did not deviate during transmission, and the second server 200 can then store the target data.
[0065] When the first confirmation information and the first error detection information are inconsistent, it is determined that the target data transmission is erroneous, and a third acquisition request for obtaining new target data is resent to the first server 100. Understandably, the first confirmation information includes the third parity check code and the second binary data, and the first error detection information includes the first parity check code and the first binary data. In the consistency comparison between the first confirmation information and the first error detection information, if the third parity check code is inconsistent with the first parity check code, or / and the second binary data is inconsistent with the first binary data, then the first confirmation information is considered inconsistent with the first error detection information. Understandably, if the first confirmation information is inconsistent with the first error detection information, it indicates that there may be a deviation in the target data transmission received by the second server 200. Therefore, the second server 200 resents a third acquisition request for obtaining new target data to the first server 100.
[0066] In one embodiment, such as Figure 1 As shown, a distributed system is also provided, including a first server 100 and a second server 200, the distributed system being used to execute the above-described data verification method.
[0067] The specific limitations of the distributed system provided by this invention can be found in the limitations of the data verification method above, and will not be repeated here. Specifically, the first server 100 simultaneously sends the target data and first error detection information generated by transforming the target data using a preset processing algorithm to the second server 200. The second server 200 first performs parity checking on the relatively small amount of first error detection information. If the parity check of the first error detection information fails, it is not necessary to continue performing consistency checking on the target data (which has a relatively large amount of data). Instead, it directly determines that the received target data has a consistency deviation, that is, it determines that the target data transmission is erroneous, and then resends a second acquisition request to the first server 100 to request new target data. The distributed system provided by this invention only needs to perform parity checking on a small amount of data to ensure data transmission consistency, improving the speed and efficiency of data verification, avoiding erroneous data from being stored in the database, and thus reducing a series of error correction costs caused by erroneous data being stored in the database.
[0068] In one embodiment, a computer-readable storage medium is also provided, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described data verification method.
[0069] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0070] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0071] The above-described 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 data checking method, characterized by, The data verification method is applied to a distributed system including a first server and a second server, and comprises the following steps: After the first server receives a first acquisition request for requesting to acquire target data sent by the second server, the target data is converted into first error detection information by a preset processing algorithm; the first error detection information comprises a first parity error detection code; The second server receives the first error detection information and the target data encapsulated and transmitted by the first server, and generates a second parity error detection code according to the received first error detection information; The second server confirms whether the second parity error detection code matches the first parity error detection code; When the second parity error detection code does not match the first parity error detection code, the second server determines that the target data transmission is incorrect, and re-sends a second acquisition request for requesting to acquire new target data to the first server; The target data is converted into first error detection information by a preset processing algorithm, which comprises the following steps: The target data is converted into first MD5 data by an MD5 algorithm; The first MD5 data is converted into first binary data by a binary algorithm; The first quantity of preset numbers in the first binary data is confirmed, and a first parity error detection code is generated according to the parity of the first quantity; The first error detection information is generated according to the first parity error detection code and the first binary data.
2. The data check method of claim 1, wherein, After the second server confirms whether the second parity error detection code matches the first parity error detection code, the following steps are further included: When the second parity error detection code matches the first parity error detection code, the second server converts the received target data into first confirmation information by the preset processing algorithm; The second server confirms whether the first confirmation information is consistent with the first error detection information; When the first confirmation information is consistent with the first error detection information, the second server determines that the target data transmission is correct, and stores the target data.
3. The data check method of claim 2, wherein, After the second server confirms whether the first confirmation information is consistent with the first error detection information, the following steps are further included: When the first confirmation information is not consistent with the first error detection information, the second server determines that the target data transmission is incorrect, and re-sends a third acquisition request for requesting to acquire new target data to the first server.
4. A data checking method characterized by, The data verification method is applied to a first server, and comprises the following steps: After receiving a first acquisition request for requesting to acquire target data sent by a second server, the target data is converted into first error detection information by a preset processing algorithm, and the first error detection information and the target data are encapsulated and transmitted to the second server; the first error detection information comprises a first parity error detection code; A second acquisition request for requesting to acquire new target data is re-sent by the second server; wherein, the second acquisition request is generated when the second server determines that a second parity error detection code does not match the first parity error detection code, and the target data transmission is incorrect, the second parity error detection code is generated by the second server according to the received first error detection information; The target data is converted into first error detection information through a preset processing algorithm, including: The target data is converted into first MD5 data through an MD5 algorithm; The first MD5 data is converted into first binary data through a binary algorithm; A first quantity of preset numbers in the first binary data is confirmed, and a first parity error detection code is generated according to the parity of the first quantity; The first error detection information is generated according to the first parity error detection code and the first binary data.
5. The data check method of claim 4, wherein, After the first error detection information and the target data are encapsulated and transmitted to the second server, the method further includes: A third acquisition request for requesting to acquire new target data is received, which is generated when the second server confirms that the second parity error detection code matches the first parity error detection code, but confirms that the first confirmation information does not match the first error detection information after the target data transmission is determined to be incorrect; the first confirmation information is obtained by the second server through the preset processing algorithm according to the received target data.
6. A data checking method characterized by, The data verification method applied to the second server includes: A first acquisition request for requesting to acquire target data is sent to the first server, so that the first server converts the target data into first error detection information through a preset processing algorithm; the first error detection information includes a first parity error detection code; The first error detection information and the target data encapsulated and transmitted by the first server are received, and a second parity error detection code is generated according to the received first error detection information; When the second parity error detection code does not match the first parity error detection code, it is determined that the target data transmission is incorrect, and a second acquisition request for requesting to acquire new target data is sent to the first server again; The target data is converted into first error detection information through a preset processing algorithm, including: The target data is converted into first MD5 data through an MD5 algorithm; The first MD5 data is converted into first binary data through a binary algorithm; A first quantity of preset numbers in the first binary data is confirmed, and a first parity error detection code is generated according to the parity of the first quantity; The first error detection information is generated according to the first parity error detection code and the first binary data.
7. The data check method of claim 6, wherein, After the second parity error detection code is generated according to the received first error detection information, the method further includes: When the second parity error detection code matches the first parity error detection code, the received target data is converted into first confirmation information through the preset processing algorithm; It is confirmed whether the first confirmation information matches the first error detection information; When the first confirmation information matches the first error detection information, it is determined that the target data transmission is correct, and the target data is stored; When the first confirmation information does not match the first error detection information, it is determined that the target data transmission is incorrect, and a third acquisition request for requesting to acquire new target data is sent to the first server again.
8. A distributed system, characterized by The distributed system includes a first server and a second server, and is used to execute the data verification method of any one of claims 1 to 3.
9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. The computer program, when executed by a processor, implements the data checking method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for selecting an audio and / or video service received
CN101836436A
Error estimation method, base station and terminal
CN106817192A