Data verification method, terminal and storage medium
By generating an array of grouped random numbers, and using verification of grouped random numbers and targeted verification of random numbers for data verification, the problem of excessive random numbers in the prior art is solved, and data privacy protection and storage resource savings are achieved.
Patent Information
- Application Number
- CN202210603391.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-05-30
AI Technical Summary
The prior art requires a large number of random numbers to be encrypted during the data verification process, resulting in wasted storage resources and it is difficult to effectively protect data privacy.
By generating an array of grouped random numbers, the partner and initiator of data verification use the verification grouped random numbers and the target verification random numbers to achieve consistency verification of data, reducing the number of random numbers and reducing the storage space usage.
It effectively reduces the number of random numbers required during data verification, reduces the storage space occupied by random numbers, saves storage resources, and ensures data privacy protection.
Smart Images

Figure CN114785502B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data verification method, a terminal and a storage medium. Background Art
[0002] When different organizations or companies cooperate with each other, they may need to verify the consistency of user data in order to achieve joint business marketing for users in the same region or with the same attributes. However, in order to protect user data privacy, no organization or company can transmit data to other companies, that is, plain text data cannot be directly sent to the other party for verification. After the data is desensitized, both parties need to verify the desensitized data.
[0003] In the prior art, the data to be verified is usually encrypted with random numbers to complete the desensitization operation. In the actual comparison process, if the data to be compared contains m groups of data, and each group of data contains k bits of data, it is necessary to use a random number generator to obtain 2 k *m random numbers to implement data encryption operations.
[0004] Then, in order to ensure that the random number encryption is not cracked, the prior art usually needs to set the length of the random number to 256 bits, resulting in a large storage space occupied by the random number, causing a waste of storage resources. Summary of the invention
[0005] The present invention provides a data verification method, a terminal and a storage medium. A data verification cooperating party is set to generate a group random number array, so that the data verification cooperating party obtains a target verification random number according to the group random number array. The data verification cooperating party and the initiator are set to respectively use the verification group random number and the target verification random number to implement data consistency verification, thereby reducing the number of random numbers required in the data verification process, reducing the storage space occupied by the random number, and saving storage resources.
[0006] In a first aspect, the present invention provides a data verification method, applied to a first terminal, comprising:
[0007] Sending the obtained data verification instruction to the second terminal, so that the second terminal generates a group random number array in response to the data verification instruction, generates a verification random number array according to the data length of the pre-stored verification data block, determines the verification group random number corresponding to each verification data block according to the verification parameter corresponding to each verification data block and the verification random number array, and sorts all the verification group random numbers according to the sequence number corresponding to each verification data block to obtain the verification group random number array;
[0008] Receive the group random number array and the verification group random number array sent by the second terminal, determine the target group random number corresponding to each data block to be verified according to the pre-stored verification parameters corresponding to each data block to be verified and the group random number array, and determine the operation array corresponding to each data block to be verified according to the generated operation random number and the target group random number corresponding to each data block to be verified;
[0009] Sending all the operation arrays to the second terminal, so that the second terminal determines the target verification random number array corresponding to each data block to be verified according to the operation array corresponding to each data block to be verified, the grouping random number array and the verification random number array;
[0010] Receive all target verification random number arrays and sorted verification group random numbers sent by the second terminal, determine the target random number corresponding to each data block to be verified according to the target verification random number array corresponding to each data block to be verified, the calculated random number, and the verification parameter corresponding to each data block to be verified, and sort all target random numbers according to the sequence number corresponding to each data block to be verified to obtain a target random number array;
[0011] If it is determined that each random number in the verification group random number array is consistent with each random number in the target random number array in sequence, then the data verification is determined to be successful.
[0012] In a possible design, before sending the obtained data verification instruction to the second terminal, the method further includes:
[0013] generating a first order-preserving verification random number in response to the obtained data verification instruction, encrypting the first order-preserving verification random number and sending the encrypted first order-preserving verification random number to the second terminal, so that the second terminal decrypts the encrypted first order-preserving verification random number to obtain the first order-preserving verification random number, generating a second order-preserving verification random number, encrypting the second order-preserving verification random number and sending the encrypted second order-preserving verification random number, and generating an order-preserving verification random number according to the first order-preserving verification random number and the second order-preserving verification random number;
[0014] Receive the encrypted second order preservation verification random number sent by the second terminal, decrypt the encrypted second order preservation verification random number to obtain the second order preservation verification random number, and generate an order preservation verification random number according to the first order preservation verification random number and the second order preservation verification random number.
[0015] In a possible design, before sending the obtained data verification instruction to the second terminal, the method further includes:
[0016] Generate a data request instruction in response to the obtained data verification instruction, and send the data request instruction to a third-party random number generation server, so that the third-party random number generation server generates an order-preserving verification random number in response to the data request instruction;
[0017] Receive the order-preserving verification random number sent by the third-party random number generation server, send the data request instruction to the second terminal, so that the second terminal sends the data request instruction to the third-party random number generation server, so that the third-party random number generation server generates an order-preserving verification random number in response to the data request instruction, and receive the order-preserving verification random number sent by the third-party random number generation server.
[0018] In a possible design, after determining the target random number corresponding to each data block to be verified according to the target verification random number array corresponding to each data block to be verified, the calculated random number, and the verification parameter corresponding to each data block to be verified, the method further includes:
[0019] Obtaining first order-preserving data to be verified according to the sequence-preserving verification random number, the target random number corresponding to each data block to be verified, and the serial number corresponding to each data block to be verified according to a preset rule, generating a data operation instruction, and sending the data operation instruction to the second terminal, so that the second terminal obtains second order-preserving data to be verified according to the sequence-preserving verification random number, the verification group random number corresponding to each verification data block, and the serial number corresponding to each verification data block according to the preset rule in response to the data operation instruction;
[0020] The second order-preserving data to be verified sent by the second terminal is received, and if it is determined that the first order-preserving data to be verified is consistent with the second order-preserving data to be verified, it is determined that the data verification is successful.
[0021] In a possible design, the calculation formula of the preset rule is as follows:
[0022] Z=Z1+Z2*seq+Z3*seq 2 +...+Z m *seq m-1
[0023] Among them, Z is the order-preserving data to be verified, Z1 is the first data block, Z2 is the second data block, and Z m is the mth data block, seq is a random number for sequence verification, and m is a positive integer.
[0024] In a possible design, the group operation array corresponding to each data block to be checked is obtained by the second terminal through decryption according to the operation array corresponding to each data block to be checked and the difference between each group random number.
[0025] Accordingly, determining the operation array corresponding to each to-be-checked data block according to the generated operation random number and the target group random number corresponding to each to-be-checked data block includes:
[0026] Encrypting the operation random number to obtain an encrypted operation random number;
[0027] Obtaining in sequence the operation array corresponding to each data block to be checked according to the sum of the target group random number corresponding to each data block to be checked and the encryption operation random number;
[0028] Correspondingly, the step of determining the target random number corresponding to each data block to be verified according to the target verification random number array corresponding to each data block to be verified, the calculated random number, and the verification parameter corresponding to each data block to be verified includes:
[0029] Obtaining a target random number array corresponding to each data block to be verified according to a target verification random number array corresponding to each data block to be verified and a difference between the calculated random numbers;
[0030] A target random number corresponding to each data block to be checked is selected from a target random number array corresponding to each data block to be checked according to the to-be-checked parameter corresponding to each data block to be checked.
[0031] In a second aspect, the present invention provides a data verification method, applied to a second terminal, comprising:
[0032] Receive a data verification instruction sent by the first terminal, generate a group random number array according to the data verification instruction, generate a verification random number array according to the data length of the pre-stored verification data block, determine the verification group random number corresponding to each verification data block according to the verification parameter corresponding to each verification data block and the verification random number array, and sort all the verification group random numbers according to the sequence number corresponding to each verification data block to obtain the verification group random number array;
[0033] Sending the grouped random number array to the first terminal, so that the first terminal determines the target grouped random number corresponding to each data block to be checked according to the pre-stored to-be-checked parameters corresponding to each data block to be checked and the grouped random number array, and determines the operation array corresponding to each data block to be checked according to the generated operation random number and the target grouped random number corresponding to each data block to be checked;
[0034] Receive all operation arrays sent by the first terminal, and determine a target verification random number array corresponding to each data block to be verified according to the operation array corresponding to each data block to be verified, the grouping random number array, and the verification random number array;
[0035] All target verification random number arrays and sorted verification group random numbers are sent to the first terminal, so that the first terminal determines the target random number corresponding to each data block to be verified according to the target verification random number array corresponding to each data block to be verified, the calculated random number and the verification parameter corresponding to each data block to be verified, and sorts all the target random numbers according to the sequence number corresponding to each data block to be verified to obtain the target random number array, so that if the first terminal determines that each random number in the verification group random number array is respectively and sequentially consistent with each random number in the target random number array, then the data verification is determined to be successful.
[0036] In a possible design, determining a target verification random number array corresponding to each data block to be verified according to the operation array corresponding to each data block to be verified, the grouping random number array, and the verification random number array includes:
[0037] Decrypt the difference between the operation array corresponding to each data block to be verified and each group random number in the group random number array according to the preset key to obtain the decrypted random number array corresponding to each data block to be verified;
[0038] All target verification random numbers corresponding to the data block to be verified are obtained according to the decryption random number array corresponding to each data block to be verified and the verification random number array, and the target verification random number array corresponding to the data block to be verified is obtained according to all target verification random numbers corresponding to the data block to be verified.
[0039] In a third aspect, the present invention provides a terminal, comprising: at least one processor and a memory;
[0040] The memory stores computer-executable instructions;
[0041] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the data verification method described in the first aspect and various possible designs of the first aspect, or the second aspect and various possible designs of the second aspect.
[0042] In a fourth aspect, the present invention provides a computer storage medium storing computer execution instructions. When a processor executes the computer execution instructions, the data verification method described in the first aspect and various possible designs of the first aspect, or the second aspect and various possible designs of the second aspect is implemented.
[0043] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the data verification method described in the first aspect and various possible designs of the first aspect, or the second aspect and various possible designs of the second aspect.
[0044] The data verification method, terminal and storage medium provided by the present invention, by setting the data verification cooperating party to send the generated group random number array to the initiator of the data verification, so that the initiator of the data verification can determine the operation array corresponding to each data block to be verified according to the parameters to be verified of all the data blocks to be verified, the group random number array and the operation random number, and set the data verification cooperating party to obtain the target verification random number corresponding to each data block to be verified by using the operation array. The present invention proposes a method of using the group random number array to map the verification random number array of the data verification cooperating party to the data verification initiator, so that the data verification cooperating party obtains the target verification random number, and sets the data verification cooperating party and the initiator to respectively use the verification group random number and the target verification random number to realize the consistency verification of the data, thereby reducing the number of random numbers required in the data verification process, reducing the storage space occupied by the random number, and saving storage resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0046] Figure 1 It is a schematic diagram of an application scenario of the data verification method provided by an embodiment of the present invention;
[0047] Figure 2 Schematic diagram of the data verification method provided by the embodiment of the present invention Figure 1 ;
[0048] Figure 3 Schematic diagram of the data verification method provided by the embodiment of the present invention Figure 2 ;
[0049] Figure 4 Schematic diagram of the data verification method provided by the embodiment of the present invention Figure 3 ;
[0050] Figure 5 A schematic diagram of the structure of a data verification device provided by an embodiment of the present invention Figure 1 ;
[0051] Figure 6 A schematic diagram of the structure of a data verification device provided by an embodiment of the present invention Figure 2 ;
[0052] Figure 7 A schematic diagram of the hardware structure of a terminal provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.
[0055] In the prior art, when different institutions or companies cooperate with each other, they need to desensitize the data. After the desensitized data is verified, the two parties can conduct joint business marketing for users in the same region or with the same attributes. However, when the data to be compared contains m groups of data, and each group of data contains k bits of data, each group of data needs to use a random number generator to obtain 2k random numbers to complete the data encryption operation. In order to perform sequence verification on the encrypted m groups of data, 2 k *m random numbers are used to implement sequence verification. In order to ensure that random number encryption cannot be cracked, the length of the random number is usually set to 256 bits, resulting in 2 k *The storage space occupied by m random numbers is relatively large, resulting in a waste of storage resources.
[0056] In order to solve the above technical problems, the embodiment of the present invention proposes the following technical solutions: by setting the second terminal to generate a grouped random number array in response to the data verification instruction sent by the first terminal and sending it to the first terminal, the first terminal can determine the operation array corresponding to each data block to be verified according to the parameters to be verified, the grouped random number array and the operation random number of all the data blocks to be verified, and set the data verification cooperation party to use the operation array to obtain the target verification random number corresponding to each data block to be verified. The present invention proposes a method for mapping the verification random number array of the second terminal to the first terminal using the grouped random number array, so that the first terminal and the second terminal respectively use the target verification random number and the verification grouped random number to complete the consistency verification of the data, thereby reducing the number of random numbers used in the data verification process, reducing the storage space occupied by the random number, and saving storage resources. The following detailed embodiments are used for detailed description.
[0057] Figure 1 Schematic diagram of the application scenario of the data verification method provided by the embodiment of the present invention. Figure 1As shown, the first terminal stores the business data of Company A, and the second terminal stores the business data of Company B. In order to achieve business cooperation, Company A and Company B need to perform consistency check on the overlapping business data in order to achieve joint business marketing for users in the same region or with the same attributes. Specifically, the first terminal acts as the initiator of data verification, and the first terminal sends the obtained data verification instruction to the second terminal, which is the cooperating party of data verification, so that the second terminal sends the group random number array generated in response to the data verification instruction sent by the first terminal to the first terminal, so that the first terminal can determine the operation array corresponding to each data block to be verified according to the parameters to be verified, the group random number array and the operation random number of all the data blocks to be verified, and set the data verification cooperating party to use the operation array to obtain the target verification random number corresponding to each data block to be verified. By using the group random number array generated by the second terminal, the verification random number array of the second terminal is mapped to the first terminal, so that the first terminal obtains the target verification random number, so that the first terminal and the second terminal respectively use the target verification random number and the verification group random number to complete the consistency check of the data, thereby reducing the number of random numbers used in the data verification process, reducing the storage space occupied by the random number, and saving storage resources.
[0058] Figure 2 Schematic diagram of the data verification method provided by the embodiment of the present invention Figure 1 , the execution subject of this embodiment can be Figure 1 The first terminal in the illustrated embodiment is not particularly limited in this embodiment.
[0059] like Figure 2 As shown, the method includes:
[0060] S201: Send the obtained data verification instruction to the second terminal, so that the second terminal generates a group random number array in response to the data verification instruction, generates a verification random number array according to the data length of the pre-stored verification data block, determines the verification group random number corresponding to each verification data block according to the verification parameter corresponding to each verification data block and the verification random number array, and sorts all the verification group random numbers according to the sequence number corresponding to each verification data block to obtain the verification group random number array.
[0061] In the embodiment of the present invention, the first terminal acts as the initiator of data verification, and the second terminal acts as the cooperator of data verification. The first terminal starts to trigger the data verification process according to the received data verification instruction. Specifically, the first terminal transmits the data verification instruction to the second terminal. The second terminal responds to the data verification instruction and generates a group random number array using a random number generator with quantum-resistant characteristics.
[0062] Exemplarily, before the second terminal generates the grouped random number array, the second terminal groups the verification data to obtain m groups of verification data blocks and stores them. Each verification data block contains k bits of data. The second terminal sorts the m groups of verification data blocks to obtain the sequence number of each verification data block. In the embodiment of the present invention, the second terminal generates the verification random number array according to the k-bit contained in each verification data block.
[0063] In the embodiment of the present invention, the second terminal also obtains the verification parameter of each verification data block according to the parameter of the verification data block. For example, if each verification data block contains a 3-bit parameter, if the parameter corresponding to the verification data block numbered 3 is 101 in binary, and the corresponding decimal verification parameter is 5, then the verification parameter of the third verification data block is determined to be 5. The d5 in is determined as the random number D3 of the check group corresponding to the third check data block. According to the check parameter p corresponding to the jth check data block and the check random number array Determine the random number D of the check group corresponding to each check data block j is d p Then, all the random numbers of the verification groups are sorted according to the serial number corresponding to each verification data block to obtain the random number array of the verification group {D1, D2, ..., D m}, where j is a positive integer less than or equal to m.
[0064] Exemplarily, in the process of grouping the verification data at the second terminal, the verification data may be padded so that the padded verification data is an integer multiple of k. Exemplarily, the verification data may be padded using a PKCS7 padding algorithm.
[0065] S202: Receive the group random number array and the verification group random number array sent by the second terminal, determine the target group random number corresponding to each data block to be verified according to the pre-stored parameters to be verified corresponding to each data block to be verified and the group random number array, and determine the operation array corresponding to each data block to be verified according to the generated operation random number and the target group random number corresponding to each data block to be verified.
[0066] In the embodiment of the present invention, at least one data block to be checked is stored in the first terminal, wherein the data block to be checked is obtained by the first terminal grouping the data to be checked, and accordingly, the first terminal also stores the sequence number and the parameter to be checked corresponding to each data block to be checked. The specific method of grouping and obtaining the parameter to be checked is consistent with the method implemented by the second terminal in S201, and will not be repeated here.
[0067] In the embodiment of the present invention, the first terminal determines the target group random number corresponding to each data block to be checked according to the pre-stored parameters to be checked corresponding to each data block to be checked and the group random number array r. Specifically, the first terminal selects the target group random number corresponding to each data block to be checked from the group random number array r according to the stored parameters to be checked corresponding to each data block to be checked For example, if each data block to be checked contains a 3-bit parameter, if the parameter corresponding to the data block to be checked with sequence number 3 is 101 in binary, and the corresponding decimal check parameter is 5, then the check parameter of the third data block to be checked is determined to be 5. The r5 in is determined as the target group random number corresponding to the third verification data block.
[0068] In the embodiment of the present invention, the first terminal pre-stores a random number for operation, wherein the random number for operation is generated by the first terminal using a random number generator with quantum resistance. The first terminal determines the operation array V corresponding to each data block to be checked according to the random number for operation and the target group random number corresponding to each data block to be checked. In the embodiment of the present invention, the first terminal encrypts the random number for operation using the public key of the second terminal, and calculates the random number according to the encrypted random number for operation and the target group random number r corresponding to the sth data block to be checked. n The sum of the obtained operation array V corresponding to the sth data block to be checked S For example, according to the encrypted operation random number and the target group random number r corresponding to the sth to-be-checked data block n Get the operation array V corresponding to the sth data block to be checked S The formula is shown in (1):
[0069] V S =r n +E(x,PK-b) (1)
[0070] Wherein, n is the parameter to be verified corresponding to the sth data block to be verified, s is a positive integer less than m, and E(x, PK-b) indicates that the operation random number is encrypted using the public key PK-b of the second terminal.
[0071] Exemplarily, if the parameter to be verified of the third data block to be verified is 5, and the target group random number corresponding to the third verification data block is r5, then the operation array V3 corresponding to the third data block to be verified is obtained by summing the encrypted operation random number and the target group random number r5 corresponding to the third data block to be verified, which is r5+E(x, PK-b). Specifically, the operation array corresponding to each data block to be verified can be obtained according to formula (1).
[0072] S203: Send all operation arrays to the second terminal, so that the second terminal determines the target verification random number array corresponding to each data block to be verified according to the operation array, the grouping random number array and the verification random number array corresponding to each data block to be verified.
[0073] In the embodiment of the present invention, the second terminal receives the operation array corresponding to all the data blocks to be checked. Afterwards, according to the operation array corresponding to each data block to be verified and the grouped random number array Determine the target verification random number array {Y1, Y2, ..., Y m}. Among them, the parameter to be checked corresponding to the sth data block to be checked is n, and the operation array V corresponding to the sth data block to be checked is S , the target verification random number array Y corresponding to the sth data block to be verified s for Specifically, The expression of is shown in formula (2):
[0074]
[0075] Where s is a positive integer less than m, and i is a positive integer less than 2. k A positive integer, D(V S -r i , sk-a) represents the operation array V corresponding to the s-th data block to be verified by the second terminal using the private key sk-b of the second terminal S With r i The second terminal decrypts the difference between the decrypted random number array D(V S -r i The i-th decryption random number in sk-b) is respectively combined with the i-th verification random number in the verification random number array to obtain the i-th target verification random number corresponding to the s-th data block to be verified, and the i-th target verification random number corresponding to the s-th data block to be verified is calculated according to the first target verification random number to the second target verification random number. k The target check random number determines the target check random number array Y of the sth data block to be checked s .
[0076] In the embodiment of the present invention, according to formula (1) V S =r n +E(x,PK-b), only D(V S -r n ,sk-b) can be correctly decrypted to obtain the operation random number, that is, the target verification random number array Y corresponding to the sth data block to be verified s for In, only The corresponding V S -r n is the correct random number obtained after decryption, and the rest are random numbers in disorder, so is d n +x.
[0077] S204: Receive all target verification random number arrays and sorted verification group random numbers sent by the second terminal, determine the target random number corresponding to each data block to be verified according to the target verification random number array corresponding to each data block to be verified, the calculated random number, and the verification parameter corresponding to each data block to be verified, and sort all target random numbers according to the serial number corresponding to each data block to be verified to obtain the target random number array.
[0078] In the embodiment of the present invention, after obtaining the target verification random number array corresponding to each data block to be verified, the first terminal obtains all target random numbers corresponding to each data block to be verified according to the target verification random number array y corresponding to each data block to be verified and the calculated random number. Specifically, the target verification random number array Y of the sth data block to be verified s for According to Y s Each target check random number in The difference between the calculated random number and the target random number is obtained to obtain the i-th target random number corresponding to the s-th data block to be verified. Specifically, The calculation formula is shown in formula (3):
[0079]
[0080] In the embodiment of the present invention, the first target random number corresponding to the sth data block to be checked can be obtained according to (3): To 2nd k Target random number The parameter to be checked corresponding to the sth data block to be checked is n, and the nth target random number As the target random number z corresponding to the sth data block to be verified s According to formulas (2) and (3), the first target random number corresponding to the sth data block to be checked is To 2nd k Target random number In, only In The correct random number obtained after decryption, due to is d n +x, then is d n , d nThat is, the nth target random number determined by the parameter to be verified corresponding to the sth data block to be verified
[0081] In the embodiment of the present invention, all target random numbers are sorted according to the sequence number corresponding to each data block to be checked to obtain a target random number array, so that the target random number arrays {Z1, Z2, ..., Z2} corresponding to the first data block to be checked to the mth data block to be checked can be obtained. m}.
[0082] S205: If it is determined that each random number in the random number array of the verification group is consistent with each random number in the target random number array in sequence, then it is determined that the data verification is successful.
[0083] In the embodiment of the present invention, the m groups of check data blocks stored in the second terminal correspond to {D1, D2, ..., D m}, the m groups of to-be-checked data blocks stored in the first terminal correspond to {Z1, Z2, ..., Z m}. For example, according to formula (1), formula (2) and formula (3), it can be deduced that the nth target random number corresponding to the sth to-be-checked data block is is d n , that is, the target random number corresponding to the s-th data block to be verified matches the parameter to be verified corresponding to the s-th data block to be verified. If the verification parameter corresponding to the s-th verification data block in the second terminal is also n, it can be determined that the target random number corresponding to the s-th data block to be verified is consistent with the verification group random number corresponding to the s-th verification data block. If the target random numbers corresponding to the m groups of data blocks to be verified are respectively consistent with the verification group random numbers corresponding to the m groups of verification data blocks, that is, the m groups of data blocks to be verified stored in the first terminal are consistent with the m groups of verification data blocks stored in the second terminal, it is determined that the data verification is successful.
[0084] The data verification method provided by the embodiment of the present invention sets a data verification cooperator to send the generated group random number array to the initiator of data verification, so that the initiator of data verification can determine the operation array corresponding to each data block to be verified according to the to-be-verified parameters of all the data blocks to be verified, the group random number array and the operation random number, and sets the data verification cooperator to use the operation array to obtain the target verification random number corresponding to each data block to be verified, thereby achieving the purpose of mapping the verification random number array of the data verification cooperator to the data verification initiator, so that the data verification cooperator and the initiator respectively use the verification group random number and the target verification random number to realize data consistency verification, thereby reducing the number of random numbers required in the data verification process, reducing the storage space occupied by random numbers, and saving storage resources.
[0085] Figure 3Schematic diagram of the data verification method provided by the embodiment of the present invention Figure 2 .like Figure 3 As shown, in Figure 2 Based on the data verification method provided in the provided embodiment, the embodiment of the present invention provides a method for performing data order-preserving verification using an order-preserving verification random number, the method comprising the following steps:
[0086] S301: The first terminal generates a first sequence preservation verification random number in response to the obtained data verification instruction, encrypts the first sequence preservation verification random number, and sends the encrypted first sequence preservation verification random number to the second terminal.
[0087] In the embodiment of the present invention, the first terminal generates a first sequence preservation random number seqA, encrypts the first sequence preservation random number seqA according to a pre-stored public key corresponding to the second terminal, and sends the encrypted first sequence preservation random number to the second terminal.
[0088] S302: The second terminal decrypts the encrypted first order preservation verification random number to obtain the first order preservation verification random number, generates a second order preservation verification random number, encrypts the second order preservation verification random number and generates the encrypted second order preservation verification random number, generates an order preservation verification random number based on the first order preservation verification random number and the second order preservation verification random number, and sends the encrypted second order preservation verification random number to the first terminal.
[0089] In the embodiment of the present invention, the second terminal uses the private key to decrypt the encrypted first order-preserving verification random number to obtain the plaintext first order-preserving verification random number seqA. Similarly, the second terminal generates a second order-preserving verification random number, encrypts the second order-preserving verification random number using the pre-stored public key of the first terminal, and sends the encrypted second order-preserving verification random number to the first terminal.
[0090] In an embodiment of the present invention, after generating the second sequence-preserving verification random number, the second terminal generates the sequence-preserving verification random number according to the first sequence-preserving verification random number and the second sequence-preserving verification random number obtained after decryption. Exemplarily, the first sequence-preserving verification random number and the second sequence-preserving verification random number are subjected to an XOR operation to obtain the sequence-preserving verification random number.
[0091] S303: The first terminal decrypts the encrypted second sequence preservation check random number to obtain a second sequence preservation check random number, and generates an order preservation check random number according to the first sequence preservation check random number and the second sequence preservation check random number.
[0092] S304: The first terminal obtains the first order-preserving data to be verified according to the preset rules based on the order-preserving verification random number, the target random number corresponding to each data block to be verified, and the serial number corresponding to each data block to be verified, generates a data operation instruction, and sends the data operation instruction and the data verification instruction to the second terminal.
[0093] In an embodiment of the present invention, after receiving the second order-preserving verification random number sent by the second terminal, the first terminal generates an order-preserving verification random number based on the first order-preserving verification random number and the second order-preserving verification random number obtained after decryption. Exemplarily, the first order-preserving verification random number and the second order-preserving verification random number are subjected to an XOR operation to obtain the order-preserving verification random number.
[0094] In an embodiment of the present invention, after receiving the data verification instruction, the first terminal sends the data verification instruction to the second terminal to start triggering the data verification process. Optionally, the first terminal provides an application for performing data verification, so that the user can start the data verification through the application, so that the first terminal obtains the data verification instruction according to the startup instruction of the application.
[0095] S305: The second terminal generates a group random number array in response to the data verification instruction, generates a verification random number array according to the data length of the pre-stored verification data block, determines the verification group random number corresponding to each verification data block according to the verification parameter corresponding to each verification data block and the verification random number array, and sorts all the verification group random numbers according to the sequence number corresponding to each verification data block to obtain the verification group random number array, and sends the group random number array and the verification group random number array to the first terminal.
[0096] S306: The first terminal determines the target group random number corresponding to each data block to be checked according to the pre-stored parameters to be checked corresponding to each data block to be checked and the group random number array, and determines the operation array corresponding to each data block to be checked according to the generated operation random number and the target group random number corresponding to each data block to be checked, and sends all the operation arrays to the second terminal.
[0097] S307: The second terminal determines the target verification random number array corresponding to each data block to be verified according to the operation array, group random number array and verification random number array corresponding to each data block to be verified, and sends all target verification random number arrays and sorted verification group random numbers to the first terminal.
[0098] S308: The first terminal determines a target random number corresponding to each data block to be checked according to the target check random number array corresponding to each data block to be checked, the calculated random number, and the check parameter corresponding to each data block to be checked.
[0099] In the embodiment of the present invention, the method and effect achieved by S305 to S308 are the same as Figure 2 The methods from S201 to S204 in the embodiments are the same and will not be described again here.
[0100] S309: The first terminal obtains the first sequence-preserving data to be verified according to the preset rules based on the sequence-preserving verification random number, the target random number corresponding to each data block to be verified, and the serial number corresponding to each data block to be verified, generates a data operation instruction, and sends the data operation instruction to the second terminal.
[0101] In the embodiment of the present invention, specifically, the first terminal obtains the calculation formula of the first sequence-preserving data to be verified according to the preset rule according to the sequence-preserving verification random number, the target random number corresponding to each data block to be verified, and the sequence number corresponding to each data block to be verified, as shown in (4):
[0102] Z=Z1+Z2*seq+Z3*seq 2 +...+Z m *seq m-1 (4)
[0103] Wherein, Z is the first sequence-preserving data to be verified, Z1 is the first data block to be verified, Z2 is the second data block to be verified, and Z m is the mth data block to be verified, and seq is the random number for sequence verification.
[0104] S310: The second terminal obtains second order-preserving data to be verified in response to the data operation instruction according to the sequence-preserving verification random number, the verification group random number corresponding to each verification data block, and the sequence number corresponding to each verification data block according to the preset rules, and sends the second order-preserving data to be verified to the first terminal.
[0105] In the embodiment of the present invention, the method for the second terminal to obtain the second sequence-preserving data to be verified according to the preset rule is as shown in formula (5):
[0106] D=D1+D2*seq+D3*seq 2 +...+D m *seq m-1 (5)
[0107] Where D is the second sequence-preserving data to be verified, D1 is the first verification data block, and D m is the mth data block to be verified, and seq is the random number for sequence verification.
[0108] S311: If the first terminal determines that the first sequence-preserving data to be verified is consistent with the second sequence-preserving data to be verified, then the first terminal determines that the data verification is successful.
[0109] The data verification method provided by the embodiment of the present invention generates the same order-preserving verification random number in the first terminal and the second terminal, so that the first terminal and the second terminal respectively generate first order-preserving data to be verified and second order-preserving data to be verified according to the order-preserving verification random number, and obtains the verification result by directly verifying the first order-preserving data to be verified and the second order-preserving data to be verified, thereby reducing the data transmission overhead in the data verification process and improving the efficiency of data verification.
[0110] Optionally, the first terminal and the second terminal can also use a third-party platform to obtain the same random number for order preservation verification. Specifically, the first terminal generates a data request instruction in response to the obtained data verification instruction, and sends the data request instruction to the third-party random number generation server, so that the third-party random number generation server generates a random number for order preservation verification in response to the data request instruction. The first terminal receives the random number for order preservation verification sent by the third-party random number generation server, sends the data request instruction to the second terminal, so that the second terminal sends the data request instruction to the third-party random number generation server, so that the third-party random number generation server generates a random number for order preservation verification in response to the data request instruction, and receives the random number for order preservation verification sent by the third-party random number generation server.
[0111] The data verification method provided by the embodiment of the present invention obtains a random number for sequence preservation verification through a third-party platform, so that the first terminal and the second terminal can directly use the random number for sequence preservation verification to perform sequence preservation verification on the data, thereby saving the random number storage space of the data verification terminal and improving the efficiency of data verification.
[0112] Figure 4 Schematic diagram of the data verification method provided by the embodiment of the present invention Figure 3 .like Figure 4 As shown, in Figure 2 Based on the data verification method performed by the first terminal provided in the provided embodiment, the embodiment of the present invention provides steps for the second terminal to perform the data verification method, and the steps are as follows:
[0113] S401: Receive a data verification instruction sent by the first terminal, generate a group random number array according to the data verification instruction, generate a verification random number array according to the data length of the pre-stored verification data block, determine the verification group random number corresponding to each verification data block according to the verification parameter corresponding to each verification data block and the verification random number array, and sort all the verification group random numbers according to the serial number corresponding to each verification data block to obtain the verification group random number array.
[0114] S402: Sending the group random number array to the first terminal, so that the first terminal determines the target group random number corresponding to each data block to be checked according to the pre-stored parameters to be checked corresponding to each data block to be checked and the group random number array, and determines the operation array corresponding to each data block to be checked according to the generated operation random number and the target group random number corresponding to each data block to be checked.
[0115] S403: Receive all operation arrays sent by the first terminal, and determine a target verification random number array corresponding to each data block to be verified according to the operation array, the grouping random number array, and the verification random number array corresponding to each data block to be verified.
[0116] S404: All target verification random number arrays and sorted verification group random numbers are sent to the first terminal, so that the first terminal determines the target random number corresponding to each data block to be verified according to the target verification random number array corresponding to each data block to be verified, the calculated random number and the verification parameter corresponding to each data block to be verified, and sorts all the target random numbers according to the sequence number corresponding to each data block to be verified to obtain the target random number array, so that if the first terminal determines that each random number in the verification group random number array is consistent with each random number in the target random number array in sequence, the data verification is determined to be successful.
[0117] In the embodiment of the present invention, the method and effect achieved by S401 to S404 are the same as Figure 2 The methods from S201 to S205 in the embodiments are consistent and will not be described again here.
[0118] Figure 5 A schematic diagram of the structure of a data verification device provided by an embodiment of the present invention Figure 1 .like Figure 5 As shown, the data verification device 50 includes: a first sending module 501, a receiving module 502, a second sending module 503, a determination module 504 and a judgment module 505.
[0119] The first sending module 501 is used to send the obtained data verification instruction to the second terminal, so that the second terminal generates a group random number array in response to the data verification instruction, generates a verification random number array according to the data length of the pre-stored verification data block, determines the verification group random number corresponding to each verification data block according to the verification parameter corresponding to each verification data block and the verification random number array, and sorts all the verification group random numbers according to the sequence number corresponding to each verification data block to obtain the verification group random number array.
[0120] The receiving module 502 is used to receive the group random number array and the verification group random number array sent by the second terminal, determine the target group random number corresponding to each data block to be verified according to the pre-stored parameters to be verified corresponding to each data block to be verified and the group random number array, and determine the operation array corresponding to each data block to be verified according to the generated operation random number and the target group random number corresponding to each data block to be verified.
[0121] The second sending module 503 is used to send all the operation arrays to the second terminal, so that the second terminal determines the target verification random number array corresponding to each data block to be verified according to the operation array corresponding to each data block to be verified, the grouping random number array and the verification random number array.
[0122] The determination module 504 is used to receive all target verification random number arrays and the sorted verification group random numbers sent by the second terminal, determine the target random number corresponding to each data block to be verified according to the target verification random number array corresponding to each data block to be verified, the calculated random number and the verification parameter corresponding to each data block to be verified, and sort all the target random numbers according to the serial number corresponding to each data block to be verified to obtain the target random number array.
[0123] The determination module 505 is used to determine that the data verification is successful if it is determined that each random number in the verification group random number array is consistent with each random number in the target random number array in sequence.
[0124] In one possible implementation, the data verification device also includes an encryption module, which is specifically used to generate a first order-preserving verification random number in response to an obtained data verification instruction, encrypt the first order-preserving verification random number and send the encrypted first order-preserving verification random number to a second terminal, so that the second terminal decrypts the encrypted first order-preserving verification random number to obtain the first order-preserving verification random number, generates a second order-preserving verification random number, encrypts the second order-preserving verification random number and sends the encrypted second order-preserving verification random number, and generates an order-preserving verification random number based on the first order-preserving verification random number and the second order-preserving verification random number; receives the encrypted second order-preserving verification random number sent by the second terminal, decrypts the encrypted second order-preserving verification random number to obtain the second order-preserving verification random number, and generates an order-preserving verification random number based on the first order-preserving verification random number and the second order-preserving verification random number.
[0125] In one possible implementation, the data verification device also includes a generation module, which is specifically used to generate a data request instruction in response to the obtained data verification instruction, and send the data request instruction to a third-party random number generation server, so that the third-party random number generation server generates an order-preserving verification random number in response to the data request instruction; receive the order-preserving verification random number sent by the third-party random number generation server, send the data request instruction to the second terminal, so that the second terminal sends the data request instruction to the third-party random number generation server, so that the third-party random number generation server generates an order-preserving verification random number in response to the data request instruction, and receive the order-preserving verification random number sent by the third-party random number generation server.
[0126] In one possible implementation, the data verification device also includes an acquisition module, which is specifically used to obtain first order-preserving data to be verified according to preset rules based on the order-preserving verification random number, the target random number corresponding to each data block to be verified, and the serial number corresponding to each data block to be verified, generate data operation instructions, and send the data operation instructions to the second terminal, so that the second terminal responds to the data operation instructions to obtain second order-preserving data to be verified according to preset rules based on the order-preserving verification random number, the verification group random number corresponding to each verification data block, and the serial number corresponding to each verification data block; receive the second order-preserving data to be verified sent by the second terminal, and if it is determined that the first order-preserving data to be verified is consistent with the second order-preserving data to be verified, then the data verification is determined to be successful.
[0127] In a possible implementation, the receiving module 502 is specifically used to encrypt the operation random number to obtain an encrypted operation random number; and obtain the operation array corresponding to each data block to be checked in turn according to the sum of the target group random number corresponding to each data block to be checked and the encrypted operation random number.
[0128] In a possible implementation, the determination module 504 is specifically used to obtain a target random number array corresponding to each data block to be checked based on the target verification random number array corresponding to each data block to be checked and the difference between the calculated random numbers; and select a target random number corresponding to each data block to be checked from the target random number array corresponding to each data block to be checked based on the verification parameters corresponding to each data block to be checked.
[0129] Figure 6 A schematic diagram of the structure of a data verification device provided by an embodiment of the present invention Figure 1 .like Figure 6 As shown, the data verification device 60 includes: a generating module 601 , a first sending module 602 , a receiving module 603 and a second sending module 604 .
[0130] The generation module 601 is used to receive a data verification instruction sent by the first terminal, generate a group random number array according to the data verification instruction, generate a verification random number array according to the data length of the pre-stored verification data block, determine the verification group random number corresponding to each verification data block according to the verification parameter corresponding to each verification data block and the verification random number array, and sort all the verification group random numbers according to the sequence number corresponding to each verification data block to obtain the verification group random number array.
[0131] The first sending module 602 is used to send the grouped random number array to the first terminal, so that the first terminal determines the target grouped random number corresponding to each data block to be checked according to the pre-stored parameters to be checked corresponding to each data block to be checked and the grouped random number array, and determines the operation array corresponding to each data block to be checked according to the generated operation random number and the target grouped random number corresponding to each data block to be checked.
[0132] The receiving module 603 is used to receive all operation arrays sent by the first terminal, and determine the target verification random number array corresponding to each data block to be verified according to the operation array corresponding to each data block to be verified, the grouping random number array and the verification random number array.
[0133] The second sending module 604 is used to send all target verification random number arrays and sorted verification group random numbers to the first terminal, so that the first terminal determines the target random number corresponding to each data block to be verified according to the target verification random number array corresponding to each data block to be verified, the calculated random number and the verification parameter corresponding to each data block to be verified, and sorts all the target random numbers according to the sequence number corresponding to each data block to be verified to obtain the target random number array, so that if the first terminal determines that each random number in the verification group random number array is consistent with each random number in the target random number array in sequence, the data verification is determined to be successful.
[0134] In a possible implementation, the receiving module 603 is specifically used to decrypt the difference between the operation array corresponding to each data block to be checked and each group random number in the group random number array according to a preset key to obtain a decrypted random number array corresponding to each data block to be checked; obtain all target verification random numbers corresponding to the data block to be checked according to the decrypted random number array corresponding to each data block to be checked and the verification random number array, and obtain the target verification random number array corresponding to the data block to be checked according to all the target verification random numbers corresponding to the data block to be checked.
[0135] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0136] Figure 7 FIG. 1 is a schematic diagram of the hardware structure of a terminal provided in an embodiment of the present invention. Figure 7 As shown, the terminal of this embodiment includes: a processor 701 and a memory 702; wherein,
[0137] Memory 702, used to store computer-executable instructions;
[0138] The processor 701 is configured to execute the computer-executable instructions stored in the memory to implement the various steps performed by the first terminal or the second terminal in the above embodiment. For details, please refer to the relevant description in the above method embodiment.
[0139] Optionally, the memory 702 may be independent or integrated with the processor 701 .
[0140] When the memory 702 is independently configured, the terminal further includes a bus 703 for connecting the memory 702 and the processor 701 .
[0141] An embodiment of the present invention further provides a computer storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the data verification method as described above is implemented.
[0142] The embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the data verification method as described above. The embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the data verification method as described above.
[0143] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0144] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.
[0145] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit. The above-mentioned module-composed unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0146] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application.
[0147] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0148] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0149] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0150] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0151] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0152] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data verification method, characterized in that: Applied to the first terminal, comprising: Sending the obtained data verification instruction to the second terminal, so that the second terminal generates a group random number array in response to the data verification instruction, generates a verification random number array according to the data length of the pre-stored verification data block, determines the verification group random number corresponding to each verification data block according to the verification parameter corresponding to each verification data block and the verification random number array, and sorts all the verification group random numbers according to the sequence number corresponding to each verification data block to obtain the verification group random number array; Receive the group random number array and the verification group random number array sent by the second terminal, determine the target group random number corresponding to each data block to be verified according to the pre-stored verification parameters corresponding to each data block to be verified and the group random number array, and determine the operation array corresponding to each data block to be verified according to the generated operation random number and the target group random number corresponding to each data block to be verified; Sending all the operation arrays to the second terminal, so that the second terminal determines the target verification random number array corresponding to each data block to be verified according to the operation array corresponding to each data block to be verified, the grouping random number array and the verification random number array; Receive all target verification random number arrays and sorted verification group random numbers sent by the second terminal, determine the target random number corresponding to each data block to be verified according to the target verification random number array corresponding to each data block to be verified, the calculated random number, and the verification parameter corresponding to each data block to be verified, and sort all target random numbers according to the sequence number corresponding to each data block to be verified to obtain a target random number array; If it is determined that each random number in the random number array of the verification group is respectively and sequentially consistent with each random number in the target random number array, then the data verification is determined to be successful; The step of determining the operation array corresponding to each data block to be checked according to the generated operation random number and the target group random number corresponding to each data block to be checked includes: Encrypting the operation random number to obtain an encrypted operation random number; Obtaining in sequence the operation array corresponding to each data block to be checked according to the sum of the target group random number corresponding to each data block to be checked and the encryption operation random number; Correspondingly, the step of determining the target random number corresponding to each data block to be verified according to the target verification random number array corresponding to each data block to be verified, the calculated random number, and the verification parameter corresponding to each data block to be verified includes: Obtaining a target random number array corresponding to each data block to be verified according to a target verification random number array corresponding to each data block to be verified and a difference between the calculated random numbers; A target random number corresponding to each data block to be checked is selected from a target random number array corresponding to each data block to be checked according to the to-be-checked parameter corresponding to each data block to be checked.
2. The method according to claim 1, characterized in that Before sending the obtained data verification instruction to the second terminal, the method further includes: generating a first order-preserving verification random number in response to the obtained data verification instruction, encrypting the first order-preserving verification random number and sending the encrypted first order-preserving verification random number to the second terminal, so that the second terminal decrypts the encrypted first order-preserving verification random number to obtain the first order-preserving verification random number, generating a second order-preserving verification random number, encrypting the second order-preserving verification random number and sending the encrypted second order-preserving verification random number, and generating an order-preserving verification random number according to the first order-preserving verification random number and the second order-preserving verification random number; Receive the encrypted second order preservation verification random number sent by the second terminal, decrypt the encrypted second order preservation verification random number to obtain the second order preservation verification random number, and generate an order preservation verification random number according to the first order preservation verification random number and the second order preservation verification random number.
3. The method according to claim 1, characterized in that Before sending the obtained data verification instruction to the second terminal, the method further includes: Generate a data request instruction in response to the obtained data verification instruction, and send the data request instruction to a third-party random number generation server, so that the third-party random number generation server generates an order-preserving verification random number in response to the data request instruction; Receive the order-preserving verification random number sent by the third-party random number generation server, send the data request instruction to the second terminal, so that the second terminal sends the data request instruction to the third-party random number generation server, so that the third-party random number generation server generates an order-preserving verification random number in response to the data request instruction, and receive the order-preserving verification random number sent by the third-party random number generation server.
4. The method according to claim 3, characterized in that After determining the target random number corresponding to each data block to be verified according to the target verification random number array corresponding to each data block to be verified, the calculated random number and the verification parameter corresponding to each data block to be verified, the method further includes: Obtaining first order-preserving data to be verified according to the sequence-preserving verification random number, the target random number corresponding to each data block to be verified, and the serial number corresponding to each data block to be verified according to a preset rule, generating a data operation instruction, and sending the data operation instruction to the second terminal, so that the second terminal obtains second order-preserving data to be verified according to the sequence-preserving verification random number, the verification group random number corresponding to each verification data block, and the serial number corresponding to each verification data block according to the preset rule in response to the data operation instruction; The second order-preserving data to be verified sent by the second terminal is received, and if it is determined that the first order-preserving data to be verified is consistent with the second order-preserving data to be verified, it is determined that the data verification is successful.
5. The method according to claim 4, characterized in that The calculation formula of the preset rule is as follows: Z=Z1+Z2*seq+Z3*seq 2 +...+From m *seq m-1 Among them, Z is the sequence-preserving data to be verified, Z1 is the first data block, Z2 is the second data block, and Z m is the mth data block, seq is a random number for sequence verification, and m is a positive integer.
6. A data verification method, characterized in that: Applied to the second terminal, including: Receive a data verification instruction sent by the first terminal, generate a group random number array according to the data verification instruction, generate a verification random number array according to the data length of the pre-stored verification data block, determine the verification group random number corresponding to each verification data block according to the verification parameter corresponding to each verification data block and the verification random number array, and sort all the verification group random numbers according to the sequence number corresponding to each verification data block to obtain the verification group random number array; The group random number array is sent to the first terminal, so that the first terminal determines the target group random number corresponding to each data block to be checked according to the pre-stored parameters to be checked corresponding to each data block to be checked and the group random number array, and encrypts the generated operation random number to obtain an encrypted operation random number, and obtains the operation array corresponding to each data block to be checked in turn according to the sum of the target group random number corresponding to each data block to be checked and the encrypted operation random number; Receive all operation arrays sent by the first terminal, and determine a target verification random number array corresponding to each data block to be verified according to the operation array corresponding to each data block to be verified, the grouping random number array, and the verification random number array; All target verification random number arrays and sorted verification group random numbers are sent to the first terminal, so that the first terminal obtains the target random number array corresponding to each data block to be verified according to the target verification random number array corresponding to each data block to be verified and the difference of the calculated random number, selects the target random number corresponding to each data block to be verified from the target random number array corresponding to each data block to be verified according to the verification parameter corresponding to each data block to be verified, and sorts all the target random numbers according to the sequence number corresponding to each data block to be verified to obtain the target random number array, so that if the first terminal determines that each random number in the verification group random number array is respectively and sequentially consistent with each random number in the target random number array, then the data verification is determined to be successful.
7. The method according to claim 6, characterized in that The step of determining a target verification random number array corresponding to each data block to be verified according to the operation array corresponding to each data block to be verified, the grouping random number array, and the verification random number array comprises: Decrypt the difference between the operation array corresponding to each data block to be verified and each group random number in the group random number array according to the preset key to obtain the decrypted random number array corresponding to each data block to be verified; All target verification random numbers corresponding to the data block to be verified are obtained according to the decryption random number array and the verification random number array corresponding to each data block to be verified, and the target verification random number array corresponding to the data block to be verified is obtained according to all the target verification random numbers corresponding to the data block to be verified.
8. A terminal, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the data verification method according to any one of claims 1 to 5 or claims 6 to 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the data verification method according to any one of claims 1 to 5 or claims 6 to 7 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the data verification method according to any one of claims 1 to 5 or claims 6 to 7 is implemented.
