WO2021003968A1 - 数据核对方法、装置、计算机设备和存储介质 - Google Patents

数据核对方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2021003968A1
WO2021003968A1 PCT/CN2019/121530 CN2019121530W WO2021003968A1 WO 2021003968 A1 WO2021003968 A1 WO 2021003968A1 CN 2019121530 W CN2019121530 W CN 2019121530W WO 2021003968 A1 WO2021003968 A1 WO 2021003968A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
business
node
verification
blockchain
Prior art date
Application number
PCT/CN2019/121530
Other languages
English (en)
French (fr)
Inventor
王梦寒
武伯超
张宝
赵达悦
刘恩科
高建欣
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2021003968A1 publication Critical patent/WO2021003968A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries

Definitions

  • This application relates to a data verification method, device, computer equipment and storage medium.
  • Business systems generate a large amount of updated business data every day. Because business data is widely distributed, a large amount of business data may need to be distributed and stored. Therefore, multiple data centers are often used for data storage, and they are distributed in various places. The business data needs to be synchronized.
  • a data verification method, device, computer equipment, and storage medium are provided.
  • a data verification method including:
  • the updated service data is checked and passed.
  • a data checking device includes:
  • the data encryption module is used to perform data encryption on the newly added service data when the newly added service data sent by other blockchain nodes in the blockchain network is received;
  • the data uploading module is used to upload the encrypted new business data to the node ledger of the current blockchain node
  • the data matching module is used to match the data in the non-decrypted state between the business data updated within the preset time interval in the node books of all the blockchain nodes in the blockchain network when the preset verification time is reached;
  • the verification and determination module is used for verifying the updated business data when it is determined that the updated business data matches each other in all the node ledgers.
  • a computer device including a memory and one or more processors, the memory stores computer readable instructions, when the computer readable instructions are executed by the processor, the one or more processors execute The following steps:
  • the updated service data is checked and passed.
  • One or more non-volatile computer-readable storage media storing computer-readable instructions.
  • the one or more processors execute the following steps:
  • the updated service data is checked and passed.
  • Fig. 1 is an application scenario diagram of a data verification method according to one or more embodiments.
  • Fig. 2 is a schematic flowchart of a data verification method according to one or more embodiments.
  • Fig. 3 is a schematic flowchart of a data synchronization step according to one or more embodiments.
  • Fig. 4 is a block diagram of a data verification device according to one or more embodiments.
  • Figure 5 is a block diagram of a computer device according to one or more embodiments.
  • the data verification method provided in this application can be applied to the application environment as shown in FIG. 1.
  • the node servers 102 of each blockchain node communicate with each other through the network to construct a blockchain network.
  • each node server 102 can communicate with the service terminal 104 through a network.
  • the business terminal 104 can send updated business data to the node server 102, and the node server 102 uploads the received updated business data to the database and the node ledger of the blockchain node.
  • the node server 102 of a certain node receives the block
  • encrypt the new business data When adding new business data sent by other blockchain nodes in the chain network, encrypt the new business data; upload the encrypted new business data to the node ledger of the current blockchain node; when it reaches the preset check At time, match the data in the non-decrypted state between the business data updated in the preset time interval in the node ledger of all blockchain nodes in the blockchain network; when it is determined that the updated business data is in the ledger of all nodes When the two match each other, the updated business data is checked and passed.
  • the service terminal 104 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
  • the node server 102 may be implemented by an independent server or a server cluster composed of multiple servers.
  • a data verification method is provided. Taking the method applied to the node server in FIG. 1 as an example, the method includes the following steps:
  • Step 210 When receiving newly added service data sent by other blockchain nodes in the blockchain network, perform data encryption on the newly added service data.
  • the business system is set up with multiple data centers, and each data center is a blockchain node on the blockchain network.
  • Each data center is equipped with a node server and a node database.
  • Multiple node servers communicate through the network to form a blockchain network.
  • the node database can be the database in the node server or an independent database.
  • Node databases can also communicate through the network to synchronize data between databases.
  • the node server of a certain blockchain node detects the database of other blockchain nodes and synchronizes the updated new business data with the database of the current node, it extracts the updated new business data from the database of the current node.
  • the newly added business data is the data generated during the business process, such as user registration information data, business order data, etc.
  • the node server can actively grab the updated new business data from the database according to the storage time of the data in the database, and the node server can also send update data upload instructions to the database, so that The database uploads updated new business data to the node server according to the update data upload instruction.
  • the node server extracts the business information from the newly-added business data, searches for preset encryption rules for the business data corresponding to the business information, and performs data encryption on the newly-added business data according to the acquired preset encryption rules.
  • the number and content of the fields contained in the business data of different businesses are different.
  • Each business party can specify preset encryption rules, including fields that need to be shielded from sensitive information and corresponding encryption rules.
  • the preset encryption rules are stored in the business terminal. And each node server.
  • Step 220 Upload the encrypted new service data to the node ledger of the current blockchain node.
  • the node server uploads the encrypted new business data to the node ledger of the current blockchain node, and the node ledger performs accounting processing on the encrypted new business data.
  • the node ledger records the upload time of the newly-added service data when accounting for the encrypted newly-added service data.
  • Step 230 When the preset verification time is reached, match the data in the non-decrypted state between the service data updated within the preset time interval in the node books of all the blockchain nodes in the blockchain network.
  • Each blockchain node in the blockchain network performs data verification on the newly added data in the node ledger according to a preset verification time period.
  • the preset check period is to perform statistical analysis on the historical data update period, calculate the statistical index of the data update period, and set it according to the statistical index. For example, it can be the mean value, median value, etc. of the statistical update period.
  • the preset verification period can be set to 5 minutes, 10 minutes, half an hour, etc.
  • the node server only checks the incremental data in the current time period and does not perform a second reconciliation, thereby avoiding repeated reconciliation and improving the reconciliation efficiency.
  • the initial verification time is set in the blockchain network, and the preset verification time is calculated according to the initial verification time and the preset verification period.
  • the preset verification time of each node server in the blockchain network remains consistent.
  • each node server automatically starts the data matching work of the updated data in the node ledger.
  • each node server reads the newly added data in the preset time interval from the corresponding node ledger.
  • the length of the preset time interval is equal to the preset verification period, and the newly added data will be read Pairwise match with the newly added data read in the ledger of other nodes.
  • any node server in the blockchain network can be set as a central server.
  • the central server communicates with other node servers, and other node servers send the read and updated business data to the central server.
  • Data matching is performed between the received updated business data and the updated business data read locally.
  • the central server may not be set, and each node server sends updated service data to other node servers to perform data matching with each other.
  • the data matching rule of the non-encrypted data in the updated business data can be set to match when the data is completely consistent, or it can be set to match when the data meets the preset
  • the value range is set, it is judged to be a match, and it can also be set to be judged as a match when the two mutually verified data meet a certain data relationship, and other matching rules can also be set.
  • the encrypted data in the updated business data there is no need to decrypt the encrypted data, and the encrypted data is matched with the data by using the preset verification rules between the encrypted data. If the business data contains multiple fields, the matching rules for different fields can be different.
  • Step 240 When it is determined that the updated service data matches each other in all the node ledgers, the updated service data is checked and passed.
  • the node server determines that the updated service data meets the matching rules when comparing pairwise in all the node ledgers, and when they match each other, it is determined that the newly updated service data updated within the preset time interval has passed the verification. As long as there is a mismatch between the newly added business data in the ledger of one node and the newly added business data in the ledger of other nodes, it is determined that the verification of the newly added business data has failed.
  • the updated business data is uploaded to the node account book of the blockchain network in time, and when the preset verification time is reached, the updated business data within the preset time interval is automatically verified.
  • data matching there is no need to decrypt the encrypted fields, but to directly perform data matching on the encrypted fields, thereby ensuring that sensitive information in the business data is not exposed and improving the security of data verification.
  • data verification between blockchain ledgers can increase the frequency and efficiency of reconciliation, reduce the cost of abnormal data investigation, and ensure the safety and security of data stored on the ledgers. stability.
  • the above method may further include the following data synchronization steps:
  • Step 202 Receive service update data sent by the service terminal.
  • the business terminal collects or generates a large amount of new business update data every day, and the business update data may include but is not limited to user registration information, business change information, etc.
  • Business update data can be composed of multiple business records, each business record is a piece of updated business information, and each business record can include multiple fields, such as user ID, user name, name, age, occupation and other fields.
  • the service terminal regularly uploads the service update data to the data center that matches itself, that is, the node server.
  • the matching rule between the business terminal and the data center can be the device distance priority principle, that is, the business terminal sends the service update data to the node server closest to its own geographic location; it can also use the business scope matching principle, that is, different data centers store different business scopes
  • the service terminal sends the data to the corresponding node server according to the service scope of the service update data; in addition, a matching rule combining distance priority and service scope matching or other matching rules can also be used.
  • Step 204 Upload the service update data to the database and the node ledger corresponding to the current blockchain node.
  • the node server After the node server receives the service update data uploaded by the service terminal, it stores the service update data in the database of the current blockchain node, thereby performing data backup locally. Or, the database sorts the stored data according to the time of the received service update data.
  • the database can be an internal database of the node server or an independent database.
  • the node server uploads the received business update data to the node ledger of the current blockchain node for data accounting. Before uploading the business update data to the blockchain node ledger, the node server extracts the business update data Business information, and search for preset encryption rules for business data corresponding to the business information, perform data encryption on the business update data according to the acquired preset encryption rules, and upload the encrypted business update data to the node ledger.
  • step 206 the database synchronizes the service update data to the databases of other blockchain nodes in the blockchain network.
  • the business update data is synchronized to the databases of other blockchain nodes in the blockchain network.
  • the databases between the blockchain networks communicate through the network.
  • Each database is a distributed database.
  • the data synchronization method of the distributed database is adopted to synchronize the business update data to the databases of all blockchain nodes. Transfer to the respective node server. This can ensure that business update data is synchronized to each data center in the blockchain network as quickly as possible, and each blockchain node performs synchronized data accounting.
  • performing data encryption on the newly-added service data includes: reading newly-added service records one by one from the newly-added service data; and extracting a service identifier from each newly-added service record; Search for the sensitive field corresponding to the service identifier and the encryption rule corresponding to the sensitive field; and perform data encryption on the corresponding sensitive field according to the encryption rule.
  • Each business party can set in advance the sensitive fields that need to be encrypted for data and the encryption rules for each sensitive field, and store the sensitive fields and the corresponding encryption rules in association with the business identifier in the business terminal and each node server.
  • the newly-added business data is composed of multiple newly-added business records, and each newly-added business record may contain multiple business information fields, including a business identification field.
  • the node server reads the newly added business records one by one from the newly added business data, and extracts the business identifier from each newly added business record.
  • the node server searches for the sensitive field corresponding to the business identifier and the encryption rule corresponding to each sensitive field.
  • the node server encrypts each sensitive field according to the encryption rules.
  • each sensitive field is different. Therefore, the verification rules when verifying each sensitive field are also different. If some need to verify whether the encrypted fields in the two ledgers are equal, some need to compare the value range , Some need to perform addition, subtraction, multiplication relationship comparison and so on. Different verification rules correspond to different non-decryption check equations. Sensitive fields are equivalent to the input of the non-decryption check equation, and encryption rules are equivalent to the operation function of the non-decryption check equation. Therefore, the encryption rules of each encrypted field should also be adapted to the data format of the non-decrypted check equation, so that the encrypted data meets the data format requirements of the equation.
  • the business data updated within a preset time interval are matched with each other in a non-decrypted state, including: reading the current one by one The serial number of each business record in the updated business data of the node ledger; determine whether there is a business record consistent with the serial number in the ledger of other nodes; when there are business records consistent with the serial number in all the node books, all the node books Perform matching verification on the corresponding unencrypted fields in the business records, and perform zero-knowledge proof verification on the corresponding encrypted fields in the business records; when all unencrypted fields match and all encrypted fields pass the zero-knowledge proof verification, then It is determined that the business records have been verified.
  • Business data is composed of multiple business records, and each business record can contain multiple business information fields.
  • the node server uploads the updated business data to the node ledger, it assigns a unique serial number to each business record.
  • the serial number can be randomly generated or sequentially generated according to the recording time of each business record in the service terminal.
  • the node server reads the serial number of each business record in the updated business data one by one, and queries whether there is a business record consistent with the read serial number in the node ledger of other blockchain nodes. For example, if the node server of the current node is the central server, the node servers of the remaining nodes will send their updated business data to the central server, and the central server will look for the existence and read the updated business data of each node one by one. Business records with consistent serial numbers.
  • the node server When the node server finds a business record consistent with the read serial number in all the node ledgers, the node server performs the step of matching the fields in each business record with each other. Specifically, the data format of each business record is standardized by the business terminal. Therefore, the fields contained in each business record are also fixed, and the verification and matching rules for the fields are also determined.
  • the node server stores the data matching rules of each field in advance. For unencrypted fields, the node server obtains the verification and matching rules corresponding to each field, and performs field values of the corresponding unencrypted fields in multiple node ledgers according to the verification and matching rules. Pairwise check.
  • the node server uses a zero-knowledge proof verification method to perform pairwise verification on the field values of the corresponding encrypted fields in the multiple node ledgers, that is, the prover verifies without providing any encryption rule information to the verifier Only the field value of the encrypted field provided by the certifier can judge whether the field matches.
  • performing zero-knowledge proof verification on the corresponding encrypted fields in the business records includes: obtaining the zero-knowledge proof equation corresponding to the encryption rules of each encrypted field; and inputting the corresponding encrypted fields in each business record in pairs In the zero-knowledge proof equation, it is judged whether the zero-knowledge proof equation holds; when it is judged that all the pairwise input zero-knowledge proof equations are established, it is judged that the zero-knowledge proof verification of the encrypted field passes.
  • the zero-knowledge proof verification uses STARKs (scalable transparent knowledge argumentation) zero-knowledge proof technology, and the data structure of the zero-knowledge proof equation is as shown in formula (1):
  • x 1 is the field value of an encrypted field in node ledger 1 before encryption
  • x 2 is the field value of the corresponding encrypted field in node ledger 2 before encryption
  • P() and D() denote node ledger 1 and node ledger 2, respectively
  • the encryption function of the encrypted field is equivalent to the encrypted private keys of two ledgers.
  • Z() is a well-known proof rule, which is equivalent to the public key of each node’s ledger.
  • the public key can be stored in a smart contract.
  • C() is a constraint. Different encryption fields have corresponding encryption rules and different constraints can be set. . Therefore, due to different encryption rules and constraints, different fields correspond to different zero-knowledge proof equations.
  • the server extracts the zero-knowledge proof equation from the encryption rules of each encrypted field, and uses the encrypted field value of each encrypted field in each ledger as an input parameter to enter the zero-knowledge proof equation in pairs to determine the zero-knowledge after the input parameter Prove whether the equation is true or not.
  • the zero-knowledge proof equation is calculated to be true, it is determined that the value of the field matches in the two node ledgers.
  • the encrypted field matches in all the node ledgers, it is determined that the encrypted field is zero
  • the knowledge verification passed. Otherwise, as long as there is a node ledger whose zero-knowledge proof equation does not hold after inputting the parameters, it is determined that the verification of the encrypted field fails.
  • the corresponding encrypted field in the business record performs zero-knowledge proof verification, including: the server corresponding to the blockchain node encrypts the plaintext field before the encrypted field corresponding to the encrypted field, the blind factor of the encrypted private key, and the encryption
  • the hash values of the fields are all sent to the secondary node, which can be a server for calculating the signature result, and the secondary node communicates with the blockchain network through the network.
  • the secondary node calculates the signature result according to the hash value of the plaintext field, blind factor and encrypted field, uploads the signature result to the blockchain network, and the blockchain network calculates the public key according to the ciphertext field, and then encrypts it according to the public key
  • the hash value of the field is signed, and the signature is verified and compared with the signature result uploaded by the secondary node.
  • the verification is passed, the corresponding encrypted field in the business record passes the zero-knowledge proof verification, otherwise, the zero-knowledge proof The verification failed.
  • the node server may generate a data abnormality report based on the field of the failed matching business record and the serial number of the business record.
  • the data abnormality report can be saved locally or recorded in the node ledger, so as to facilitate the corresponding business terminal to troubleshoot data synchronization abnormalities.
  • the data verification method may further include the following steps: when there is a node ledger with no business record of the serial number, obtaining the earliest record time of the business record corresponding to the serial number in the blockchain network; obtaining the current time , Obtain the recording interval length according to the current time and the earliest recording time, and compare the recording interval length with the preset interval threshold; when the recording interval exceeds the preset interval threshold, it is determined that the business record corresponding to the serial number fails to match.
  • the node server When the node server performs business record query in each node ledger based on the serial number, when the node server finds a node ledger that does not have a business record consistent with the read serial number, the node server obtains the remaining business records with the serial number In the node ledger, the recording time of the business record, and the recording time is the time when the node ledger records the record. The node server finds the earliest record time for the business record in the blockchain network from each record time.
  • the node server obtains the current time and calculates the time difference between the current time and the earliest recording time to obtain the recording interval time.
  • the node server obtains the preset interval threshold.
  • the preset interval threshold is used to measure whether the recording exceeds the maximum synchronization delay time.
  • the node server compares the recording interval with the preset interval threshold. When it is determined according to the comparison result that the recording interval exceeds the preset interval When the threshold is set, the node server determines that the business record corresponding to the read serial number fails to match, and the business record may fail to synchronize due to network failures and other issues.
  • the node server can obtain the node code corresponding to the node ledger missing the business record corresponding to the serial number, generate a data abnormality report based on the node code and serial number, and save the data abnormal report locally or record it in the node ledger, thereby It is convenient for the corresponding business terminal to troubleshoot abnormal data synchronization problems.
  • the above method may further include the following step: when the recording interval duration does not exceed the preset interval threshold, modifying the recording time of the service update records corresponding to the serial numbers in all node ledgers to the current time.
  • the node server determines that the recording interval duration does not exceed the preset interval threshold, it modifies the recording time of the business record in the remaining node books of the business record with the serial number to the current time. Therefore, the data verification of the field value of this business record will no longer be carried out, that is, no data verification will be carried out during this verification period.
  • This record may not be synchronized due to network delays and other reasons, so it cannot be due to the temporary lack of business records. It is determined that the record synchronization has failed. Modify the recording time of this business record in the remaining node ledger to the current time, so that it can automatically enter the data verification of the next verification cycle.
  • the data verification method may further include the following steps: when it is determined that there is an encrypted field or an unencrypted field that fails the verification, it is determined that the verification of the business record has failed; according to the serial number of the business record , And the encrypted field or unencrypted field that fails the verification to generate a data abnormality report; and record the data abnormality report in the node ledger of each blockchain node.
  • the node server matches each field in the updated business record pairwise between all the node ledgers, when it detects an encrypted field or an unencrypted field that has not passed the data verification, it determines that the updated business record is verified failure.
  • the node server obtains business records with data matching failures, including business records with missing data in some node ledgers, and business records with field values that fail to verify each other between the ledgers, and the node server matches business records with failed data matching Generate data verification report.
  • the node server can directly list business records that fail to match; for business records that fail to verify the field, the node server also obtains the serial number of the business record and the encryption of the failed verification Fields and/or unencrypted fields, and obtain the verification failure reason of each field, the node server generates a data verification report according to the serial number and the verification failure reason; other methods may also be used to generate a data exception report.
  • the node server records the verification time in the data verification report, and the verification time is set to the current time.
  • the node server uploads the generated abnormal data report to the node ledger of the current node and synchronizes it to the database of the current node.
  • the database synchronizes the data check report to the database of other nodes, and then uploads the database of other nodes to other nodes.
  • the node server is uploaded to the corresponding node account book by the node server of other nodes, so as to record the abnormal data report in the blockchain network.
  • the above method may further include the following steps: receiving an abnormal bill query request sent by the service terminal, the abnormal bill query request carrying the query time range; searching the node account book of the current blockchain node within the query time range Data exception report; the data exception report is returned to the business terminal.
  • the service terminal needs to check whether the uploaded service data is accounted successfully.
  • the service terminal can periodically send an abnormal bill query request to the matching node server, or the reviewer can actively send an abnormal bill query request to the matching node server by operating the service terminal.
  • the abnormal bill query requests the user to request the node server to query the business data with abnormal accounting, and the abnormal bill query request carries the query time range of the business data uploaded by the terminal.
  • the node server receives the abnormal bill query request sent by the service terminal, and extracts the query time range from the abnormal bill query request.
  • the node server searches the node ledger of the current blockchain node for the data abnormal report whose recording time is within the query time range, and returns the data abnormal report to the service terminal.
  • the business terminal when the business terminal sends an abnormal bill query request to the node server, it can directly obtain the abnormal data record within the query time range from the node ledger of the blockchain node, which can effectively shorten the data verification time and reduce Data verification cost.
  • a data verification device including: a data encryption module 410, a data upload module 420, a data matching module 430, and a verification determination module 440, wherein:
  • the data encryption module 410 is configured to perform data encryption on the newly added service data when the newly added service data sent by other blockchain nodes in the blockchain network is received.
  • the data upload module 420 is configured to upload the encrypted newly added service data to the node ledger of the current blockchain node.
  • the data matching module 430 is used to match the data in the non-decrypted state between the business data updated within the preset time interval in the node books of all the blockchain nodes in the blockchain network when the preset verification time is reached .
  • the verification and determination module 440 is used for verifying the updated business data when it is determined that the updated business data matches each other in all the node ledgers.
  • the data verification device may further include:
  • the update data receiving module is used to receive the service update data sent by the service terminal.
  • the update data upload module is used to upload business update data to the database and node ledger corresponding to the current blockchain node.
  • the database synchronization module is used for the database to synchronize the business update data to the database of other blockchain nodes in the blockchain network.
  • the data encryption module 410 may include:
  • the record reading unit is used to read the newly added business records one by one from the newly added business data.
  • the identification extraction module is used to extract the business identification from each of the newly added business records.
  • the encrypted information search unit is used to search for the sensitive field corresponding to the service identifier and the encryption rule corresponding to the sensitive field.
  • the encryption processing unit is configured to perform data encryption on the corresponding sensitive field according to the encryption rule.
  • the data matching module 430 may include:
  • the serial number reading unit is used to read the serial number of each business record in the updated business data of the current node ledger one by one.
  • the consistency determining unit is used to determine whether there is a business record consistent with the serial number in the ledger of other nodes.
  • the field verification unit is used for matching and verifying the corresponding unencrypted fields in the business records in all the node ledgers when there are business records consistent with the serial number in all the node ledgers, and compare the business records Zero-knowledge proof verification is performed on the corresponding encrypted fields in the and
  • the verification and determination unit is configured to determine that the business record is verified as passed when all the unencrypted fields match and all the encrypted fields pass the zero-knowledge proof verification.
  • the field check unit may include:
  • the equation obtaining subunit is used to obtain the zero-knowledge proof equation corresponding to the encryption rule of each encrypted field.
  • the equation judging subunit is used to input the corresponding encrypted fields in each of the business records into the zero-knowledge proof equation in pairs to determine whether the zero-knowledge proof equation is valid.
  • the result judging subunit is used for judging that the zero-knowledge proof verification of the encrypted field is passed when it is judged that the zero-knowledge proof equations of all pairwise inputs are established.
  • the data verification device may further include:
  • the failure determination module is used to determine that the verification of the business record fails when it is determined that there is an encrypted field or an unencrypted field that fails the verification.
  • the report generation module is used to generate a data abnormality report based on the serial number of the business record and the encrypted or unencrypted field that fails the verification.
  • the report recording module is used for recording the data abnormality report in the node ledger of each blockchain node.
  • the data verification device may further include:
  • the time acquisition module is configured to acquire the earliest record time of the business record corresponding to the serial number in the blockchain network when there is a node ledger without the business record of the serial number.
  • the duration comparison module is used to obtain the current time, obtain the recording interval duration according to the current time and the earliest recording time, and compare the recording interval duration with a preset interval threshold.
  • the failure determination module is configured to determine that the matching of the business record corresponding to the serial number fails when the recording interval duration exceeds the preset interval threshold.
  • Each module in the above-mentioned data checking device can be implemented in whole or in part by software, hardware and a combination thereof.
  • the foregoing modules may be embedded in the form of hardware or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the foregoing modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 5.
  • the computer equipment includes a processor, a memory, a network interface and a database connected through a system bus.
  • the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer readable instructions, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium.
  • the database of the computer equipment is used to store data verification data.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer readable instructions are executed by the processor to realize a data verification method.
  • FIG. 5 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
  • the specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
  • a computer device including a memory and one or more processors.
  • the memory stores computer-readable instructions.
  • the one or more processors perform the following steps: when a block is received When adding new business data sent by other blockchain nodes in the chain network, perform data encryption on the new business data and upload the encrypted new business data to the node ledger of the current blockchain node;
  • the check time is preset, the business data updated within the preset time interval in the node books of all the blockchain nodes in the blockchain network are matched with the data in the non-decrypted state; and when it is determined that the updated When the business data matches with each other in all the node ledgers, the updated business data is checked and passed.
  • the processor further implements the following steps when executing the computer-readable instructions: receiving service update data sent by the service terminal; uploading the service update data to the database and node ledger corresponding to the current blockchain node In; the database synchronizes the service update data to the databases of other blockchain nodes in the blockchain network.
  • the processor when the processor executes the computer-readable instruction to implement the step of data encryption on the newly added service data, it is also used to: read each service record in the second service data of the current node ledger one by one. Serial number; read new business records one by one from the newly added business data; extract business identifiers from each of the newly added business records; search for the sensitive fields corresponding to the business identifiers, and those corresponding to the sensitive fields Encryption rules; perform data encryption on the corresponding sensitive fields according to the encryption rules.
  • the node ledger of all the blockchain nodes in the blockchain network when the processor executes the computer-readable instructions, the node ledger of all the blockchain nodes in the blockchain network, the business data updated within the preset time interval, are mutually non-decrypted.
  • the matching step is also used to: read the serial number of each business record in the updated business data of the current node ledger one by one; determine whether there are business records consistent with the serial number in the ledger of other nodes; when all nodes When there is a business record consistent with the serial number in the ledger, the corresponding unencrypted field in the business record in all the node ledger is matched and verified, and the corresponding encrypted field in the business record is verified by zero-knowledge proof. When all unencrypted fields match and all encrypted fields pass the zero-knowledge proof verification, it is determined that the business record verification is passed.
  • the processor when the processor executes the computer-readable instruction to implement the zero-knowledge proof verification step of the corresponding encrypted field in the business record, it is also used to: obtain the encryption rule corresponding to each encrypted field Zero-knowledge proof equation; input the corresponding encrypted fields in each of the business records into the zero-knowledge proof equation in pairs, and judge whether the zero-knowledge proof equation is valid; when judging all pairwise input zero-knowledge proof equations When the equations are all established, it is determined that the zero-knowledge proof verification of the encrypted field passes.
  • the processor further implements the following steps when executing the computer-readable instructions: when it is determined that there is an encrypted field or an unencrypted field that fails the verification, it is determined that the verification of the business record has failed.
  • the processor further implements the following steps when executing the computer-readable instructions: when there is a node ledger without the business record of the serial number, obtain the business record corresponding to the serial number in the blockchain The earliest recording time in the network; obtaining the current time, obtaining the recording interval length according to the current time and the earliest recording time, and comparing the recording interval length with a preset interval threshold; when the recording interval length exceeds the preset When the interval threshold is set, it is determined that the matching of the business record corresponding to the serial number fails.
  • One or more non-volatile computer-readable storage media storing computer-readable instructions.
  • the one or more processors perform the following steps: When adding new business data sent by other blockchain nodes in the blockchain network, perform data encryption on the new business data and upload the encrypted new business data to the node ledger of the current blockchain node; when When the preset verification time is reached, match the data in the non-decrypted state between the business data updated within the preset time interval in the node books of all blockchain nodes in the blockchain network; and when the update is determined When the service data of is matched with each other in all the node accounts, the updated service data is checked and passed.
  • the following steps are also implemented: receiving the service update data sent by the service terminal; uploading the service update data to the database corresponding to the current blockchain node and the node ledger; the database; Synchronize business update data to the databases of other blockchain nodes in the blockchain network.
  • the computer-readable instruction when executed by the processor to implement the step of data encryption on the newly added service data, it is also used to: read each service record in the second service data of the current node ledger one by one The serial number of the; read the new business records one by one from the new business data; extract the business ID from each of the new business records; look up the sensitive field corresponding to the business ID, and the sensitive field corresponding Encryption rules; perform data encryption on the corresponding sensitive fields according to the encryption rules.
  • the node ledgers of all blockchain nodes in the blockchain network will be non-decrypted with the business data updated within a preset time interval.
  • the data matching step is also used to: read the serial number of each business record in the updated business data of the current node ledger one by one; determine whether there are business records consistent with the serial number in the other node ledger; when all When there are business records consistent with the serial number in the node ledger, the corresponding unencrypted fields in the business records in all node books are matched and verified, and the corresponding encrypted fields in the business records are verified by zero-knowledge Verification: When all unencrypted fields match and all encrypted fields pass the zero-knowledge proof verification, it is determined that the business record has been verified.
  • the computer-readable instruction when executed by the processor to implement the zero-knowledge proof verification step of the corresponding encrypted field in the business record, it is also used to: obtain the encryption rule correspondence of each encrypted field Zero-knowledge proof equation; input the corresponding encrypted fields in each of the business records into the zero-knowledge proof equation in pairs to determine whether the zero-knowledge proof equation is true; when it is determined that all pairwise input zero-knowledge When the proof equations are all established, it is determined that the zero-knowledge proof verification of the encrypted field is passed.
  • the following steps are also implemented: when it is determined that there is an encrypted field or an unencrypted field that fails the verification, it is determined that the verification of the business record has failed.
  • the following steps are also implemented: when there is a node ledger without the business record of the serial number, obtain the business record corresponding to the serial number in the block The earliest recording time in the chain network; obtaining the current time, obtaining the recording interval length according to the current time and the earliest recording time, and comparing the recording interval length with a preset interval threshold; when the recording interval length exceeds the preset interval When the interval threshold is set, it is determined that the matching of the business record corresponding to the serial number fails.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Channel
  • memory bus Radbus direct RAM
  • RDRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Mathematical Physics (AREA)
  • Fuzzy Systems (AREA)
  • Computing Systems (AREA)
  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种数据核对方法,包括:当接收到区块链网络中其他区块链节点发送的新增业务数据时,对所述新增业务数据进行数据加密将加密后的新增业务数据上传至所述当前区块链节点的节点账本中;当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配;当判定出所述更新的业务数据在所有节点账本中均相互匹配时,则对所述更新的业务数据核对通过。

Description

数据核对方法、装置、计算机设备和存储介质
相关申请的交叉引用
本申请要求于2019年7月9日提交中国专利局,申请号为2019106146391,申请名称为“数据核对方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及一种数据核对方法、装置、计算机设备和存储介质。
背景技术
业务系统每天都会有产生大量更新的业务数据,由于业务数据的产生地分布较广,大量的业务数据可能需要进行分布存储,因此往往采用建立多个数据中心的方式进行数据存储,并且分布在各地的业务数据需要进行数据同步。
然而,发明人意识到,在数据同步的过程中,常因网络或其他不明原因引起数据同步失败的问题,造成信息的不一致,因此,需要对各地的数据进行核对,而业务数据中包含许多敏感信息,在核对的过程中有很大几率会暴露这些敏感信息,因此,无法完全保证核对过程中业务数据的安全性。
发明内容
根据本申请公开的各种实施例,提供一种数据核对方法、装置、计算机设备和存储介质。
一种数据核对方法,包括:
当接收到区块链网络中其他区块链节点发送的新增业务数据时,对所述新增业务数据进行数据加密;
将加密后的新增业务数据上传至所述当前区块链节点的节点账本中;
当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配;及
当判定出所述更新的业务数据在所有节点账本中均相互匹配时,则对所述更新的业务数据核对通过。
一种数据核对装置,包括:
数据加密模块,用于当接收到区块链网络中其他区块链节点发送的新增业务数据时,对所述新增业务数据进行数据加密;
数据上链模块,用于将加密后的新增业务数据上传至所述当前区块链节点的节点账本 中;
数据匹配模块,用于当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配;及
校验判定模块,用于当判定出所述更新的业务数据在所有节点账本中均相互匹配时,则对所述更新的业务数据核对通过。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:
当接收到区块链网络中其他区块链节点发送的新增业务数据时,对所述新增业务数据进行数据加密;
将加密后的新增业务数据上传至所述当前区块链节点的节点账本中;
当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配;及
当判定出所述更新的业务数据在所有节点账本中均相互匹配时,则对所述更新的业务数据核对通过。
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
当接收到区块链网络中其他区块链节点发送的新增业务数据时,对所述新增业务数据进行数据加密;
将加密后的新增业务数据上传至所述当前区块链节点的节点账本中;
当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配;及
当判定出所述更新的业务数据在所有节点账本中均相互匹配时,则对所述更新的业务数据核对通过。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为根据一个或多个实施例中数据核对方法的应用场景图。
图2为根据一个或多个实施例中数据核对方法的流程示意图。
图3为根据一个或多个实施例中数据同步步骤的流程示意图。
图4为根据一个或多个实施例中数据核对装置的框图。
图5为根据一个或多个实施例中计算机设备的框图。
具体实施方式
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供的数据核对方法,可以应用于如图1所示的应用环境中。各区块链节点的节点服务器102相互之间通过网络进行通信,构建形成区块链网络。此外,各节点服务器102可以与业务终端104通过网络进行通信。业务终端104可以向节点服务器102发送更新的业务数据,节点服务器102将接收的更新的业务数据上传至本区块链节点的数据库以及节点账本中,当某一个节点的节点服务器102接收到区块链网络中其他区块链节点发送的新增业务数据时,对新增业务数据进行数据加密;将加密后的新增业务数据上传至当前区块链节点的节点账本中;当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配;当判定出更新的业务数据在所有节点账本中均相互匹配时,则对更新的业务数据核对通过。
业务终端104可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,节点服务器102可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在其中一个实施例中,如图2所示,提供了一种数据核对方法,以该方法应用于图1中的节点服务器为例进行说明,包括以下步骤:
步骤210,当接收到区块链网络中其他区块链节点发送的新增业务数据时,对新增业务数据进行数据加密。
业务系统设置有多个数据中心,每个数据中心为区块链网络上的一个区块链节点。每个数据中心均配置有节点服务器和节点数据库,多个节点服务器之间通过网络进行通信从而构建形成区块链网络,节点数据库可以为节点服务器内的数据库,也可以为独立的数据库,多个节点数据库之间也可以通过网络进行通信,进行数据库之间的数据同步。
当某一区块链节点的节点服务器检测到其他区块链节点的数据库,向当前节点的数据库同步了更新的新增业务数据时,从当前节点的数据库中抽取更新的新增业务数据。新增业务数据为业务进行过程中产生的数据,如用户注册信息数据、业务订单数据等。当节点服务器从数据库中获取新增业务数据时,节点服务器可以根据数据库中数据的存储时间,从数据库中主动抓取更新的新增业务数据,节点服务器也可以向数据库发送更新数据上传指令,使得数据库根据更新数据上传指令向节点服务器上传更新的新增业务数据。
节点服务器从新增业务数据中提取出业务信息,并查找与业务信息对应的业务数据的预设加密规则,根据获取到的预设加密规则对新增业务数据进行数据加密。不同业务的业务数据中包含的字段数量、内容均有所不同,各业务方可规定预设加密规则,包括需要进 行敏感信息屏蔽的字段及相应的加密规则,预设加密规则存储于业务终端,及各节点服务器中。
步骤220,将加密后的新增业务数据上传至当前区块链节点的节点账本中。
节点服务器将加密后的新增业务数据上传至当前区块链节点的节点账本中,节点账本对加密后的新增业务数据进行记账处理。节点账本在对加密后的新增业务数据进行记账时,记录新增业务数据的上传时间,
步骤230,当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配。
区块链网络中的各区块链节点按照预设的核对时间周期对节点账本中的新增数据进行数据核对。预设核对周期是对历史的数据更新周期进行统计分析,计算出数据更新周期的统计学指标,根据统计学指标进行设定的。例如,可以为所统计更新周期的均值、中位值等。例如,可以将预设核对周期设定为5分钟、10分钟、半小时等。节点服务器只对本次时间周期内的增量数据进行核对,不进行二次对账,从而能够避免重复对账,且提高对账效率。
区块链网络中设定起始核对时间,并根据起始核对时间和预设核对周期计算出预设核对时间,区块链网络中每个节点服务器的预设核对时间保持一致。当到达预设核对时间时,各节点服务器自动启动节点账本中更新数据的数据匹配工作。当到达预设核对时间时,各节点服务器从相应的节点账本中读取预设时间间隔内的新增数据,预设时间间隔的时间长度等于预设核对周期,将读取出的新增数据与其他节点账本中读取的新增数据相互之间进行两两匹配。
在进行数据匹配时,可以将区块链网络中的任意一个节点服务器设置为中心服务器,中心服务器与其他节点服务器进行通信,其他节点服务器将读取的更新的业务数据发送至中心服务器,中心服务器将接收到的更新的业务数据及本地读取的更新的业务数据两两之间进行数据匹配。在其他实施例中,也可以不设定中心服务器,由每个节点服务器分别向其他节点服务器发送更新的业务数据,相互之间进行数据匹配。
节点服务器在对更新的业务数据相互之间进行数据匹配时,更新的业务数据中的非加密数据的数据匹配规则可以设定为当数据完全一致时则匹配,也可以设定为当数据符合预设的数值范围时则判定为匹配,还可以设定为当两个互相校验的数据之间符合一定的数据关系则可判定为匹配,也可以设定其他的匹配规则。对于更新的业务数据中的加密数据,无需对加密数据进行解密,利用预设的加密数据之间的核对规则对加密数据进行数据匹配。若业务数据中包含多个字段,则不同字段的匹配规则可以不同。
步骤240,当判定出更新的业务数据在所有节点账本中均相互匹配时,则对更新的业务数据核对通过。
当节点服务器判定出更新的业务数据在所有节点账本中两两比较时均符合匹配规则,相互匹配时,则判定本次预设时间间隔内更新的新增业务数据核对通过。只要有一个节点 账本中的新增业务数据与其他节点账本的新增业务数据不匹配时,则判定对新增业务数据核对失败。
上述数据核对方法中,将更新的业务数据及时上传至区块链网络的节点账本中,在到达预设核对时间时,将预设时间间隔内的更新的业务数据进行自动核对。在进行数据匹配时,无需对已加密的字段进行解密,而是直接对加密字段进行数据匹配,从而保证能够不暴露业务数据中的敏感信息,提高数据校验的安全性。此外,由于区块链本身特有的高传输效率等特点,区块链账本之间进行数据核对能够提高对账的频率和效率,降低异常数据排查成本,并且能够保证账本上存储数据的安全性和稳定性。
在其中一个实施例中,如图3所示,上述方法还可以包括以下数据同步步骤:
步骤202,接收业务终端发送的业务更新数据。
业务终端每天都会收集到或产生大量的新增的业务更新数据,业务更新数据可以包括但不限于用户注册信息、业务更改信息等。业务更新数据可以由多条业务记录组成,每条业务记录为一条更新的业务信息,每条业务记录中可以包括多个字段,如用户标识、用户名、姓名、年龄、职业等多个字段。业务终端定时将业务更新数据上传至与自身相匹配的数据中心,即节点服务器。
业务终端与数据中心的匹配规则可以为设备距离优先原则,即业务终端将业务更新数据发送至与自身地理位置最近的节点服务器;也可以采用业务范围匹配原则,即不同的数据中心存储不同业务范围的数据,业务终端根据业务更新数据的业务范围发送至相应的节点服务器;除此之外,也可以采用距离优先与业务范围匹配相结合的匹配规则,或者其他匹配规则。
步骤204,将业务更新数据上传至当前区块链节点对应的数据库及节点账本中。
节点服务器接收到业务终端上传的业务更新数据之后,将业务更新数据存储至当前区块链节点的数据库中,从而在本地进行数据备份。或者,数据库按照接收到的业务更新数据的时间对存储的数据进行排序。数据库可以为节点服务器内部的数据库,也可以为独立形式的数据库。同时,节点服务器将接收的业务更新数据上传至当前区块链节点的节点账本中进行数据记账,在将业务更新数据上传至区块链节点账本上之前,节点服务器从业务更新数据中提取出业务信息,并查找与业务信息对应的业务数据的预设加密规则,根据获取到的预设加密规则对业务更新数据进行数据加密,将加密处理后的业务更新数据上传至节点账本中。
步骤206,数据库将业务更新数据同步至区块链网络中其他区块链节点的数据库中。
当前节点的数据库在本地存储业务更新数据之后,将业务更新数据同步至区块链网络中其他区块链节点的数据库中。具体地,各区块链网络之间的数据库通过网络进行通信,各数据库为分布式数据库,采用分布式数据库的数据同步方法,将业务更新数据同步至所有区块链节点的数据库,再由各数据库传输给各自的节点服务器。从而能够保证业务更新数据最快地同步至区块链网络中的各个数据中心,各区块链节点进行同步数据记账。
在其中一个实施例中,对所述新增业务数据进行数据加密,包括:从所述新增业务数据中逐条读取新增业务记录;从各所述新增业务记录中提取出业务标识;查找所述业务标识对应的敏感字段,及所述敏感字段对应的加密规则;根据所述加密规则对相应的所述敏感字段进行数据加密。
由于不同业务的业务逻辑不同,业务数据中需要隐藏的敏感数据也不同。各业务方可事先设定需要进行数据加密的敏感字段,及各敏感字段的加密规则,将敏感字段及相应的加密规则与业务标识关联存储于业务终端及各节点服务器中。
新增业务数据是由多条新增业务记录组成,每条新增业务记录又可以包含多个业务信息字段,其中包含业务标识字段。节点服务器从新增业务数据中逐条读取新增业务记录,并从各条新增业务记录中提取出业务标识,节点服务器查找业务标识对应的敏感字段及各敏感字段对应的加密规则。节点服务器根据各敏感字段的加密规则对其进行加密处理。
各敏感字段的数据形式不同,因此,在对各敏感字段进行校验时的校验规则也有所差别,如有的需要验证两个账本中的加密字段是否相等,有的需要进行数值范围比对,有的需要进行加减、倍乘关系比对等。不同的验证规则对应于不同的非解密校验等式,敏感字段相当于非解密校验等式的输入,加密规则相当于非解密校验等式的运算函数。因此,各加密字段的加密规则也要适应于非解密校验等式的数据形式,使得加密后的数据满足等式的数据格式要求。
在其中一个实施例中,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配,包括:逐条读取当前的节点账本的更新的业务数据中各业务记录的流水号;判断其他节点账本中是否存在与流水号一致的业务记录;当所有节点账本中均存在与流水号一致的业务记录时,将所有节点账本中业务记录中相应的未加密字段进行匹配校验,将业务记录中相应的加密字段进行零知识证明校验;当所有未加密字段均匹配且所有加密字段均通过零知识证明校验时,则判定业务记录核对通过。
业务数据是由多条业务记录组成,每条业务记录又可以包含多个业务信息字段。节点服务器在将更新的业务数据上传至节点账本时,赋予每条业务记录一个唯一的流水号,流水号可以随机生成,也可以根据各条业务记录在业务终端的记录时间逐序生成。
在进行数据核对时,节点服务器逐条读取更新的业务数据中各条业务记录的流水号,查询其他区块链节点的节点账本中是否存在与读取的流水号相一致的业务记录。例如,若当前节点的节点服务器为中心服务器时,其余各节点的节点服务器将各自更新的业务数据发送至中心服务器,中心服务器逐个从接收的各节点的更新的业务数据中查找是否存在与读取的流水号一致的业务记录。
当节点服务器在所有的节点账本中都查询到与读取的流水号一致的业务记录时,节点服务器再进行将各业务记录中的字段进行相互匹配的步骤。具体地,每个业务记录的数据格式均经过业务终端的标准化处理,因此,每个业务记录中包含的字段也是固定的,字段 的校验匹配规则也是确定的。节点服务器中事先存储了各字段的数据匹配规则,对于未加密字段,节点服务器获取各字段对应的校验匹配规则,并根据校验匹配规则将多个节点账本中相应未加密字段的字段值进行两两校验。对于加密字段,节点服务器采用零知识证明的校验方法将多个节点账本中相应加密字段的字段值进行两两校验,即证明者在不向验证者提供任何加密规则信息的情况下,验证者只根据证明者提供的加密字段的字段数值即可判断字段是否匹配。
在其中一个实施例中,业务记录中相应的加密字段进行零知识证明校验,包括:获取各加密字段的加密规则对应的零知识证明等式;将各业务记录中相应的加密字段两两输入零知识证明等式中,判断零知识证明等式是否成立;当判定所有两两输入的零知识证明等式均成立时,则判定对加密字段零知识证明校验通过。
在本实施例中,零知识证明校验采用STARKs(可扩容的透明知识论证)零知识证明技术,零知识证明等式的数据结构如公式(1):
C(P(x 1))=Z(x 2)*D(x 2)           (1)
x 1为节点账本1中一个加密字段加密前的字段数值,x 2为节点账本2中相对应加密字段加密前的字段数值,P()和D()分别表示节点账本1和节点账本2中该加密字段的加密函数,相当于两个账本的加密的私钥。Z()为公知的证明规则,相当于各节点账本的公钥,公钥可以存储于智能合约中,C()为约束条件,不同的加密字段更具相应的加密规则可以设置不同的约束条件。因此,由于加密规则和约束条件的不同,不同的字段对应不同的零知识证明等式。
服务器从各加密字段的加密规则中提取出零知识证明等式,并将各加密字段在各账本中的加密字段数值作为输入参数两两输入零知识证明等式中,判定输入参数后的零知识证明等式是否成立,当计算出零知识证明等式成立时,则判定该字段在两个节点账本中数值匹配,当该加密字段在所有节点账本中均匹配时,则判定对该加密字段零知识证明校验通过。否则,只要存在输入参数后零知识证明等式不成立的节点账本,则判定对该加密字段校验失败。
在其中一个实施例中,业务记录中相应的加密字段进行零知识证明校验,包括:区块链节点对应的服务器将加密字段对应的加密前的明文字段、加密私钥的盲因子、及加密字段的哈希值均发送至二级节点,二级节点可以为用于计算签名结果的服务器,二级节点通过网络与区块链网络进行通信。二级节点根据明文字段、盲因子和加密字段的哈希值计算出签名结果,将签名结果上传至区块链网络,区块链网络根据密文字段计算出公钥,再根据公钥对加密字段的哈希值进行签名,将该签名与二级节点上传的签名结果进行验签比较,当验签通过时,则业务记录中相应的加密字段通过零知识证明校验,否则,零知识证明校验失败。
具体地,当要验证两个加密字段相等时,假设A和B这两个加密字段都是密码学中的Perdesen Commitment格式,使用ECC椭圆曲线,描述如下:A=a*G+x1*H;B=b*G+x2*H; A、B为密文字段,a、b为明文字段,x1、x2为盲因子,H点为H=h*G,h为私钥,二级节点对P256曲线的参数进行替换,得到一条新的以H点为基点的P256曲线S,在二级节点上计算:message=hash(string(A)+string(B));同时,计算(x1-x2),并以(x1-x2)为私钥,对message进行签名,得到签名码sig,将sig签名码发送到区块链网络上;区块链网络计算C=A-B,得到公钥C;计算加密字段哈希值message=hash(string(A)+string(B)),用C对message进行签名,如果签名通过,则说明A和B相等。进一步地,建立在同态加密算法的基础之上,除了可以比较A和B之外,假设存在Perdesen Commitment格式的加密数据A1,A2,A3...,以及B1,B2,B3...,可以比较(A1+A2+A3+...)和(B1+B2+B3+...)是否相等。
当要验证两个加密字段的大小关系时,在二级节点上计算message=hash(string(A)+string(B));同时计算y=(x1-x2),c=(a-b);以message,c,y为参数,进行RangeProof计算,得到签名结果Sig,将sig签名码发送到区块链网络上。区块链网络上的节点服务器计算message=hash(string(A)+string(B)),同时计算:C=(A-B);以message,C,Sig为参数,进行RangeProof验签,如果验签通过,则说明C的明文c是一个范围在[0,2^32)的整数;进一步地,证明某个数隶属于一个范围内,也是非常常见的需求,比如a<=n<=b,此时,可以同时提供(n-a)>=0&&(b-n)>=0的证明,即可证明n隶属于[a,b]之间。
进一步地,节点服务器可以根据匹配失败的业务记录中的,匹配失败的字段和该业务记录的流水号生成数据异常报告。可以将数据异常报告保存至本地或记录在节点账本中,从而便于相应的业务终端进行数据同步异常的问题排查。
在其中一个实施例中,数据核对方法还可以包括以下步骤:当存在没有流水号的业务记录的节点账本时,获取流水号对应的业务记录在区块链网络中的最早记录时间;获取当前时间,根据当前时间和最早记录时间得到记录间隔时长,并将记录间隔时长与预设间隔阈值比较;当记录间隔时长超过预设间隔阈值时,则判定流水号对应的业务记录匹配失败。
节点服务器根据流水号在各节点账本中进行业务记录查询时,当节点服务器查找到没有与读取的流水号一致的业务记录的节点账本时,节点服务器获取其余的存在该流水号的业务记录的节点账本中,该业务记录的记录时间,记录时间为节点账本对该记录进行记账的时间。节点服务器从各记录时间中查找出给业务记录在区块链网络中的最早记录时间。
节点服务器获取当前时间,计算当前时间与最早记录时间的时间差值从而得到记录间隔时长。节点服务器获取预设间隔阈值,预设间隔阈值用于衡量记录是否超过最大同步延迟时长,节点服务器将记录间隔时长与预设间隔阈值进行比较,当根据比较结果判定出记录间隔时长超过预设间隔阈值时,节点服务器判定读取的流水号对应的业务记录匹配失败,该业务记录可能由于网络故障等问题同步失败。
进一步地,节点服务器可以获取缺失该流水号对应的业务记录的节点账本对应的节点代码,根据节点代码和流水号生成数据异常报告,可以将数据异常报告保存至本地或记录 在节点账本中,从而便于相应的业务终端进行数据同步异常的问题排查。
在其中一个实施例中,上述方法还可以包括以下步骤:当记录间隔时长未超过预设间隔阈值时,将所有节点账本中流水号对应的业务更新记录的记录时间修改为当前时间。
当节点服务器判定出记录间隔时长未超过预设间隔阈值时,则将其余的存在该流水号的业务记录的节点账本中,该条业务记录的记录时间修改为当前时间。从而该条业务记录不再进行字段值的数据核对,即在本次核对周期内不再进行数据核对,该条记录可能是由于网络延迟等原因尚未进行同步,因此不能仅由于业务记录的暂时缺失就判定该记录同步失败。将其余节点账本中该条业务记录的记录时间修改为当前时间,可以使其自动进入下一核对周期的数据核对。
在本实施例中,在业务记录在节点账本中存在缺失的情况下,通过设定预设间隔阈值,可以确保所有的业务记录只进行一次对账,避免重复对账工作。
在其中一个实施例中,数据核对方法还可以包括以下步骤:当判定出存在校验未通过的加密字段或未加密字段时,则判定所述业务记录核对失败;根据所述业务记录的流水号,及所述校验未通过的加密字段或未加密字段生成数据异常报告;将所述数据异常报告记录于各所述区块链节点的节点账本中。
当节点服务器对更新的业务记录中的各字段在所有节点账本之间进行两两匹配时,当检测出未通过数据校验的加密字段或未加密字段时,则判定该条更新的业务记录核对失败。
节点服务器获取数据匹配失败的业务记录,其中包含在某些节点账本中存在数据缺失的业务记录,以及字段值在各账本之间相互校验失败的业务记录,节点服务器根据数据匹配失败的业务记录生成数据核对报告。在数据核对报告中,对于数据缺失的业务记录,节点服务器可以直接列出匹配失败的业务记录;对于字段校验失败的业务记录,节点服务器也获取业务记录的流水号,及校验失败的加密字段和/或未加密字段,并获取各字段的校验失败原因,节点服务器根据流水号和校验失败原因生成数据核对报告;也可以采用其他方式生成数据异常报告。
节点服务器在数据核对报告中记录核对时间,核对时间设定为当前时间。节点服务器将生成的数据异常报告上传至当前节点的节点账本中,同时同步给当前节点的数据库,由数据库将数据核对报告同步至其他节点的数据库中,再由其他节点的数据库上传给其他节点的节点服务器,由其他节点的节点服务器上传至相应的节点账本中,从而将数据异常报告记录在区块链网络中。
在其中一个实施例中,上述方法还可以包括以下步骤:接收业务终端发送的异常账单查询请求,异常账单查询请求中携带查询时间范围;查找当前区块链节点的节点账本中查询时间范围内的数据异常报告;将数据异常报告返回给业务终端。
业务终端需要核查上传的业务数据是否记账成功,业务终端可以定期向相匹配的节点服务器发送异常账单查询请求,也可以由审核人员通过操作业务终端主动向匹配的节点服 务器发送异常账单查询请求。异常账单查询请求用户向节点服务器请求查询记账异常的业务数据,异常账单查询请求中携带终端已上传的业务数据的查询时间范围。节点服务器接收业务终端发送的异常账单查询请求,并从异常账单查询请求中提取查询时间范围。节点服务器从当前区块链节点的节点账本中搜索记录时间处于查询时间范围内的数据异常报告,并将数据异常报告返回给业务终端。
在本实施例中,业务终端在向节点服务器发送异常账单查询请求时,可以直接从区块链节点的节点账本中获取到查询时间范围内的异常数据记录,从而可以有效缩短数据核对时间,降低数据核对成本。
应该理解的是,虽然图2-3的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在其中一个实施例中,如图4所示,提供了一种数据核对装置,包括:数据加密模块410、数据上传模块420、数据匹配模块430和核对判定模块440,其中:
数据加密模块410,用于当接收到区块链网络中其他区块链节点发送的新增业务数据时,对所述新增业务数据进行数据加密。
数据上传模块420,用于将加密后的新增业务数据上传至所述当前区块链节点的节点账本中。
数据匹配模块430,用于当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配。及
核对判定模块440,用于当判定出所述更新的业务数据在所有节点账本中均相互匹配时,则对所述更新的业务数据核对通过。
在其中一个实施例中,数据核对装置还可以包括:
更新数据接收模块,用于接收业务终端发送的业务更新数据。
更新数据上传模块,用于将业务更新数据上传至当前区块链节点对应的数据库及节点账本中。及
数据库同步模块,用于数据库将业务更新数据同步至区块链网络中其他区块链节点的数据库中。
在其中一个实施例中,数据加密模块410可以包括:
记录读取单元,用于从所述新增业务数据中逐条读取新增业务记录。
标识提取模块,用于从各所述新增业务记录中提取出业务标识。
加密信息查找单元,用于查找所述业务标识对应的敏感字段,及所述敏感字段对应的 加密规则。及
加密处理单元,用于根据所述加密规则对相应的所述敏感字段进行数据加密。
在其中一个实施例中,数据匹配模块430可以包括:
流水号读取单元,用于逐条读取当前的节点账本的所述更新的业务数据中各业务记录的流水号。
一致判定单元,用于判断其他节点账本中是否存在与所述流水号一致的业务记录。
字段校验单元,用于当所有节点账本中均存在与所述流水号一致的业务记录时,将所有节点账本中所述业务记录中相应的未加密字段进行匹配校验,将所述业务记录中相应的加密字段进行零知识证明校验。及
校验判定单元,用于当所有未加密字段均匹配且所有加密字段均通过零知识证明校验时,则判定所述业务记录核对通过。
在其中一个实施例中,字段校验单元可以包括:
等式获取子单元,用于获取各所述加密字段的加密规则对应的零知识证明等式。
等式判定子单元,用于将各所述业务记录中相应的加密字段两两输入所述零知识证明等式中,判断所述零知识证明等式是否成立。及
结果判定子单元,用于当判定所有两两输入的零知识证明等式均成立时,则判定对所述加密字段零知识证明校验通过。
在其中一个实施例中,数据核对装置还可以包括:
失败判定模块,用于当判定出存在校验未通过的加密字段或未加密字段时,则判定所述业务记录核对失败。
报告生成模块,用于根据所述业务记录的流水号,及所述校验未通过的加密字段或未加密字段生成数据异常报告。及
报告记录模块,用于将所述数据异常报告记录于各所述区块链节点的节点账本中。
在其中一个实施例中,数据核对装置还可以包括:
时间获取模块,用于当存在没有所述流水号的业务记录的节点账本时,获取所述流水号对应的业务记录在所述区块链网络中的最早记录时间。
时长比较模块,用于获取当前时间,根据当前时间和所述最早记录时间得到记录间隔时长,并将所述记录间隔时长与预设间隔阈值比较。及
失败判定模块,用于当所述记录间隔时长超过所述预设间隔阈值时,则判定所述流水号对应的业务记录匹配失败。
关于数据核对装置的具体限定可以参见上文中对于数据核对方法的限定,在此不再赘述。上述数据核对装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在其中一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部 结构图可以如图5所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储数据核对数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种数据核对方法。
本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
一种计算机设备,包括存储器和一个或多个处理器,存储器中储存有计算机可读指令,计算机可读指令被处理器执行时,使得一个或多个处理器执行以下步骤:当接收到区块链网络中其他区块链节点发送的新增业务数据时,对所述新增业务数据进行数据加密将加密后的新增业务数据上传至所述当前区块链节点的节点账本中;当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配;及当判定出所述更新的业务数据在所有节点账本中均相互匹配时,则对所述更新的业务数据核对通过。
在其中一个实施例中,处理器执行计算机可读指令时还实现以下步骤:接收业务终端发送的业务更新数据;将所述业务更新数据上传至所述当前区块链节点对应的数据库及节点账本中;所述数据库将所述业务更新数据同步至所述区块链网络中其他区块链节点的数据库中。
在其中一个实施例中,处理器执行计算机可读指令时实现对所述新增业务数据进行数据加密的步骤时还用于:逐条读取当前的节点账本的第二业务数据中各业务记录的流水号;从所述新增业务数据中逐条读取新增业务记录;从各所述新增业务记录中提取出业务标识;查找所述业务标识对应的敏感字段,及所述敏感字段对应的加密规则;根据所述加密规则对相应的所述敏感字段进行数据加密。
在其中一个实施例中,处理器执行计算机可读指令时实现将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配的步骤时还用于:逐条读取当前的节点账本的所述更新的业务数据中各业务记录的流水号;判断其他节点账本中是否存在与所述流水号一致的业务记录;当所有节点账本中均存在与所述流水号一致的业务记录时,将所有节点账本中所述业务记录中相应的未加密字段进行匹配校验,将所述业务记录中相应的加密字段进行零知识证明校验;当所有未加密字段均匹配且所有加密字段均通过零知识证明校验时,则判定所述业务记录核对通过。
在其中一个实施例中,处理器执行计算机可读指令时实现将所述业务记录中相应的加密字段进行零知识证明校验的步骤时还用于:获取各所述加密字段的加密规则对应的零知识证明等式;将各所述业务记录中相应的加密字段两两输入所述零知识证明等式中,判断 所述零知识证明等式是否成立;当判定所有两两输入的零知识证明等式均成立时,则判定对所述加密字段零知识证明校验通过。
在其中一个实施例中,处理器执行计算机可读指令时还实现以下步骤:当判定出存在校验未通过的加密字段或未加密字段时,则判定所述业务记录核对失败根据所述业务记录的流水号,及所述校验未通过的加密字段或未加密字段生成数据异常报告;将所述数据异常报告记录于各所述区块链节点的节点账本中。
在其中一个实施例中,处理器执行计算机可读指令时还实现以下步骤:当存在没有所述流水号的业务记录的节点账本时,获取所述流水号对应的业务记录在所述区块链网络中的最早记录时间;获取当前时间,根据当前时间和所述最早记录时间得到记录间隔时长,并将所述记录间隔时长与预设间隔阈值比较;当所述记录间隔时长超过所述预设间隔阈值时,则判定所述流水号对应的业务记录匹配失败。
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:当接收到区块链网络中其他区块链节点发送的新增业务数据时,对所述新增业务数据进行数据加密将加密后的新增业务数据上传至所述当前区块链节点的节点账本中;当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配;及当判定出所述更新的业务数据在所有节点账本中均相互匹配时,则对所述更新的业务数据核对通过。
在其中一个实施例中,计算机可读指令被处理器执行时还实现以下步骤:接收业务终端发送的业务更新数据;将业务更新数据上传至当前区块链节点对应的数据库及节点账本中;数据库将业务更新数据同步至区块链网络中其他区块链节点的数据库中。
在其中一个实施例中,计算机可读指令被处理器执行时实现对所述新增业务数据进行数据加密的步骤时还用于:逐条读取当前的节点账本的第二业务数据中各业务记录的流水号;从所述新增业务数据中逐条读取新增业务记录;从各所述新增业务记录中提取出业务标识;查找所述业务标识对应的敏感字段,及所述敏感字段对应的加密规则;根据所述加密规则对相应的所述敏感字段进行数据加密。
在其中一个实施例中,计算机可读指令被处理器执行时实现将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配的步骤时还用于:逐条读取当前的节点账本的所述更新的业务数据中各业务记录的流水号;判断其他节点账本中是否存在与所述流水号一致的业务记录;当所有节点账本中均存在与所述流水号一致的业务记录时,将所有节点账本中所述业务记录中相应的未加密字段进行匹配校验,将所述业务记录中相应的加密字段进行零知识证明校验;当所有未加密字段均匹配且所有加密字段均通过零知识证明校验时,则判定所述业务记录核对通过。
在其中一个实施例中,计算机可读指令被处理器执行时实现将所述业务记录中相应的加密字段进行零知识证明校验的步骤时还用于:获取各所述加密字段的加密规则对应的零 知识证明等式;将各所述业务记录中相应的加密字段两两输入所述零知识证明等式中,判断所述零知识证明等式是否成立;当判定所有两两输入的零知识证明等式均成立时,则判定对所述加密字段零知识证明校验通过。
在其中一个实施例中,计算机可读指令被处理器执行时还实现以下步骤:当判定出存在校验未通过的加密字段或未加密字段时,则判定所述业务记录核对失败根据所述业务记录的流水号,及所述校验未通过的加密字段或未加密字段生成数据异常报告;将所述数据异常报告记录于各所述区块链节点的节点账本中。
在其中一个实施例中,计算机可读指令被处理器执行时还实现以下步骤:当存在没有所述流水号的业务记录的节点账本时,获取所述流水号对应的业务记录在所述区块链网络中的最早记录时间;获取当前时间,根据当前时间和所述最早记录时间得到记录间隔时长,并将所述记录间隔时长与预设间隔阈值比较;当所述记录间隔时长超过所述预设间隔阈值时,则判定所述流水号对应的业务记录匹配失败。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种数据核对方法,包括:
    当接收到区块链网络中其他区块链节点发送的新增业务数据时,对所述新增业务数据进行数据加密;
    将加密后的所述新增业务数据上传至所述当前区块链节点的节点账本中;
    当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配;及
    当判定出所述更新的业务数据在所有节点账本中均相互匹配时,则对所述更新的业务数据核对通过。
  2. 根据权利要求1所述的方法,其特征在于,还包括:
    接收业务终端发送的业务更新数据;
    将所述业务更新数据上传至所述当前区块链节点对应的数据库及节点账本中;及
    所述数据库将所述业务更新数据同步至所述区块链网络中其他区块链节点的数据库中。
  3. 根据权利要求1所述的方法,其特征在于,所述对所述新增业务数据进行数据加密,包括:
    从所述新增业务数据中逐条读取新增业务记录;
    从各所述新增业务记录中提取出业务标识;
    查找所述业务标识对应的敏感字段,及所述敏感字段对应的加密规则;及
    根据所述加密规则对相应的所述敏感字段进行数据加密。
  4. 根据权利要求1所述的方法,其特征在于,所述将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配,包括:
    逐条读取当前的节点账本的所述更新的业务数据中各业务记录的流水号;
    判断其他节点账本中是否存在与所述流水号一致的业务记录;
    当所有节点账本中均存在与所述流水号一致的业务记录时,将所有节点账本中所述业务记录中相应的未加密字段进行匹配校验,将所述业务记录中相应的加密字段进行零知识证明校验;及
    当所有未加密字段均匹配且所有加密字段均通过零知识证明校验时,则判定所述业务记录核对通过。
  5. 根据权利要求4所述的方法,其特征在于,所述将所述业务记录中相应的加密字段进行零知识证明校验,包括:
    获取各所述加密字段的加密规则对应的零知识证明等式;
    将各所述业务记录中相应的加密字段两两输入所述零知识证明等式中,判断所述零知识证明等式是否成立;及
    当判定所有两两输入的零知识证明等式均成立时,则判定对所述加密字段零知识证明校验通过。
  6. 根据权利要求4所述的方法,其特征在于,还包括:
    当判定出存在校验未通过的加密字段或未加密字段时,则判定所述业务记录核对失败;
    根据所述业务记录的流水号,及所述校验未通过的加密字段或未加密字段生成数据异常报告;及
    将所述数据异常报告记录于各所述区块链节点的节点账本中。
  7. 根据权利要求4所述的方法,其特征在于,还包括:
    当存在没有所述流水号的业务记录的节点账本时,获取所述流水号对应的业务记录在所述区块链网络中的最早记录时间;
    获取当前时间,根据当前时间和所述最早记录时间得到记录间隔时长,并将所述记录间隔时长与预设间隔阈值比较;及
    当所述记录间隔时长超过所述预设间隔阈值时,则判定所述流水号对应的业务记录匹配失败。
  8. 一种数据核对装置,包括:
    数据加密模块,用于当接收到区块链网络中其他区块链节点发送的新增业务数据时,对所述新增业务数据进行数据加密;
    数据上链模块,用于将加密后的新增业务数据上传至所述当前区块链节点的节点账本中;
    数据匹配模块,用于当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配;及
    校验判定模块,用于当判定出所述更新的业务数据在所有节点账本中均相互匹配时,则对所述更新的业务数据核对通过。
  9. 根据权利要求8所述的装置,其特征在于,还包括:
    更新数据接收模块,用于接收业务终端发送的业务更新数据;
    更新数据上传模块,用于将业务更新数据上传至当前区块链节点对应的数据库及节点账本中;及
    数据库同步模块,用于数据库将业务更新数据同步至区块链网络中其他区块链节点的数据库中。
  10. 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    当接收到区块链网络中其他区块链节点发送的新增业务数据时,对所述新增业务数据进行数据加密;
    将加密后的新增业务数据上传至所述当前区块链节点的节点账本中;
    当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配;及
    当判定出所述更新的业务数据在所有节点账本中均相互匹配时,则对所述更新的业务数据核对通过。
  11. 根据权利要求10所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    接收业务终端发送的业务更新数据;
    将所述业务更新数据上传至所述当前区块链节点对应的数据库及节点账本中;及
    所述数据库将所述业务更新数据同步至所述区块链网络中其他区块链节点的数据库中。
  12. 根据权利要求10所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时所实现的所述对所述新增业务数据进行数据加密,包括:
    从所述新增业务数据中逐条读取新增业务记录;
    从各所述新增业务记录中提取出业务标识;
    查找所述业务标识对应的敏感字段,及所述敏感字段对应的加密规则;及
    根据所述加密规则对相应的所述敏感字段进行数据加密。
  13. 根据权利要求10所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时所实现的所述将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配,包括:
    逐条读取当前的节点账本的所述更新的业务数据中各业务记录的流水号;
    判断其他节点账本中是否存在与所述流水号一致的业务记录;
    当所有节点账本中均存在与所述流水号一致的业务记录时,将所有节点账本中所述业务记录中相应的未加密字段进行匹配校验,将所述业务记录中相应的加密字段进行零知识证明校验;及
    当所有未加密字段均匹配且所有加密字段均通过零知识证明校验时,则判定所述业务记录核对通过。
  14. 根据权利要求13所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时所实现的所述将所述业务记录中相应的加密字段进行零知识证明校验,包括:
    获取各所述加密字段的加密规则对应的零知识证明等式;
    将各所述业务记录中相应的加密字段两两输入所述零知识证明等式中,判断所述零知识证明等式是否成立;及
    当判定所有两两输入的零知识证明等式均成立时,则判定对所述加密字段零知识证明校验通过。
  15. 根据权利要求13所述的计算机设备,其特征在于,所述处理器执行所述计算机 可读指令时还执行以下步骤:
    当判定出存在校验未通过的加密字段或未加密字段时,则判定所述业务记录核对失败;
    根据所述业务记录的流水号,及所述校验未通过的加密字段或未加密字段生成数据异常报告;及
    将所述数据异常报告记录于各所述区块链节点的节点账本中。
  16. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    当接收到区块链网络中其他区块链节点发送的新增业务数据时,对所述新增业务数据进行数据加密;
    将加密后的新增业务数据上传至所述当前区块链节点的节点账本中;
    当到达预设核对时间时,将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配;及
    当判定出所述更新的业务数据在所有节点账本中均相互匹配时,则对所述更新的业务数据核对通过。
  17. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:
    接收业务终端发送的业务更新数据;
    将所述业务更新数据上传至所述当前区块链节点对应的数据库及节点账本中;及
    所述数据库将所述业务更新数据同步至所述区块链网络中其他区块链节点的数据库中。
  18. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时所实现的所述对所述新增业务数据进行数据加密,包括:
    从所述新增业务数据中逐条读取新增业务记录;
    从各所述新增业务记录中提取出业务标识;
    查找所述业务标识对应的敏感字段,及所述敏感字段对应的加密规则;及
    根据所述加密规则对相应的所述敏感字段进行数据加密。
  19. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时所实现的所述将区块链网络中所有区块链节点的节点账本中,预设时间间隔内更新的业务数据相互之间进行非解密状态的数据匹配,包括:
    逐条读取当前的节点账本的所述更新的业务数据中各业务记录的流水号;
    判断其他节点账本中是否存在与所述流水号一致的业务记录;
    当所有节点账本中均存在与所述流水号一致的业务记录时,将所有节点账本中所述业务记录中相应的未加密字段进行匹配校验,将所述业务记录中相应的加密字段进行零知识证明校验;及
    当所有未加密字段均匹配且所有加密字段均通过零知识证明校验时,则判定所述业务记录核对通过。
  20. 根据权利要求19所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时所实现的所述将所述业务记录中相应的加密字段进行零知识证明校验,包括:
    获取各所述加密字段的加密规则对应的零知识证明等式;
    将各所述业务记录中相应的加密字段两两输入所述零知识证明等式中,判断所述零知识证明等式是否成立;及
    当判定所有两两输入的零知识证明等式均成立时,则判定对所述加密字段零知识证明校验通过。
PCT/CN2019/121530 2019-07-09 2019-11-28 数据核对方法、装置、计算机设备和存储介质 WO2021003968A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910614639.1 2019-07-09
CN201910614639.1A CN110457914A (zh) 2019-07-09 2019-07-09 数据核对方法、装置、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2021003968A1 true WO2021003968A1 (zh) 2021-01-14

Family

ID=68482415

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/121530 WO2021003968A1 (zh) 2019-07-09 2019-11-28 数据核对方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN110457914A (zh)
WO (1) WO2021003968A1 (zh)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800040A (zh) * 2021-01-22 2021-05-14 平安养老保险股份有限公司 业务数据校验方法、装置、计算机设备及存储介质
CN113256257A (zh) * 2021-05-28 2021-08-13 北京瑞卓喜投科技发展有限公司 一种基于区块链的交易签署方法、装置和电子设备
CN113377757A (zh) * 2021-06-24 2021-09-10 杭州数梦工场科技有限公司 数据对账方法、装置、电子设备及机器可读存储介质
CN113450096A (zh) * 2021-06-25 2021-09-28 未鲲(上海)科技服务有限公司 资源转移数据的处理方法、装置、电子设备及介质
CN113595240A (zh) * 2021-06-21 2021-11-02 深圳供电局有限公司 电力数据的检测方法、装置、设备及存储介质
CN113642039A (zh) * 2021-08-09 2021-11-12 平安科技(深圳)有限公司 单证模板的配置方法、装置、计算机设备和存储介质
CN113642027A (zh) * 2021-09-01 2021-11-12 卫宁健康科技集团股份有限公司 医疗信息整合方法、装置、计算机设备、介质及系统
CN114785812A (zh) * 2022-06-22 2022-07-22 浙商银行股份有限公司 一种基于零知识证明的区块链区块同步方法及装置

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457914A (zh) * 2019-07-09 2019-11-15 深圳壹账通智能科技有限公司 数据核对方法、装置、计算机设备和存储介质
CN111262848A (zh) * 2020-01-13 2020-06-09 万春琦 一种基于区块链账户加密的访问控制系统
CN111367933A (zh) * 2020-03-18 2020-07-03 北京意锐新创科技有限公司 适用于支付设备管控平台的账单安全保护方法和装置
CN111800252A (zh) * 2020-07-22 2020-10-20 深圳壹账通智能科技有限公司 基于区块链的信息审核方法、装置和计算机设备
CN111866164B (zh) * 2020-07-29 2021-05-07 广州伊智信息科技有限公司 一种对各通信设备之间传输数据时信息采集系统及方法
CN112052265B (zh) * 2020-09-02 2024-05-10 平安壹钱包电子商务有限公司 数据核对确认方法、装置、计算机设备及可读存储介质
CN113190616B (zh) * 2021-04-16 2023-02-21 宁波市民卡运营管理有限公司 区块链对账系统以及方法、计算机设备、可读存储介质
CN113285945B (zh) * 2021-05-19 2022-11-15 恒安嘉新(北京)科技股份公司 通信安全监控方法、装置、设备及存储介质
CN113761064B (zh) * 2021-08-27 2023-06-30 成都质数斯达克科技有限公司 基于区块链的日切对账方法、装置、设备及可读存储介质
CN113849543B (zh) * 2021-09-30 2022-07-12 北京荷月科技有限公司 一种对账信息查询系统、数据更新方法及对账查询方法
CN115086065B (zh) * 2022-07-12 2024-01-19 北斗星通智联科技有限责任公司 一种基于区块链的数据同步方法、装置、电子设备及介质
CN116109275A (zh) * 2023-02-23 2023-05-12 成都鱼泡科技有限公司 一种多数据对账校验方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180053161A1 (en) * 2016-08-17 2018-02-22 International Business Machines Corporation Tracking transactions through a blockchain
CN109345251A (zh) * 2018-08-24 2019-02-15 深圳壹账通智能科技有限公司 可协商的区块链交易方法、装置、设备及存储介质
CN109671205A (zh) * 2018-09-25 2019-04-23 深圳壹账通智能科技有限公司 基于区块链的投票方法、装置、设备及计算机存储介质
CN110457914A (zh) * 2019-07-09 2019-11-15 深圳壹账通智能科技有限公司 数据核对方法、装置、计算机设备和存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180053161A1 (en) * 2016-08-17 2018-02-22 International Business Machines Corporation Tracking transactions through a blockchain
CN109345251A (zh) * 2018-08-24 2019-02-15 深圳壹账通智能科技有限公司 可协商的区块链交易方法、装置、设备及存储介质
CN109671205A (zh) * 2018-09-25 2019-04-23 深圳壹账通智能科技有限公司 基于区块链的投票方法、装置、设备及计算机存储介质
CN110457914A (zh) * 2019-07-09 2019-11-15 深圳壹账通智能科技有限公司 数据核对方法、装置、计算机设备和存储介质

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800040A (zh) * 2021-01-22 2021-05-14 平安养老保险股份有限公司 业务数据校验方法、装置、计算机设备及存储介质
CN112800040B (zh) * 2021-01-22 2024-02-06 平安养老保险股份有限公司 业务数据校验方法、装置、计算机设备及存储介质
CN113256257A (zh) * 2021-05-28 2021-08-13 北京瑞卓喜投科技发展有限公司 一种基于区块链的交易签署方法、装置和电子设备
CN113595240A (zh) * 2021-06-21 2021-11-02 深圳供电局有限公司 电力数据的检测方法、装置、设备及存储介质
CN113595240B (zh) * 2021-06-21 2024-01-19 深圳供电局有限公司 电力数据的检测方法、装置、设备及存储介质
CN113377757B (zh) * 2021-06-24 2023-08-25 杭州数梦工场科技有限公司 数据对账方法、装置、电子设备及机器可读存储介质
CN113377757A (zh) * 2021-06-24 2021-09-10 杭州数梦工场科技有限公司 数据对账方法、装置、电子设备及机器可读存储介质
CN113450096A (zh) * 2021-06-25 2021-09-28 未鲲(上海)科技服务有限公司 资源转移数据的处理方法、装置、电子设备及介质
CN113642039A (zh) * 2021-08-09 2021-11-12 平安科技(深圳)有限公司 单证模板的配置方法、装置、计算机设备和存储介质
CN113642039B (zh) * 2021-08-09 2024-05-28 平安科技(深圳)有限公司 单证模板的配置方法、装置、计算机设备和存储介质
CN113642027A (zh) * 2021-09-01 2021-11-12 卫宁健康科技集团股份有限公司 医疗信息整合方法、装置、计算机设备、介质及系统
CN113642027B (zh) * 2021-09-01 2024-04-16 卫宁健康科技集团股份有限公司 医疗信息整合方法、装置、计算机设备、介质及系统
CN114785812A (zh) * 2022-06-22 2022-07-22 浙商银行股份有限公司 一种基于零知识证明的区块链区块同步方法及装置

Also Published As

Publication number Publication date
CN110457914A (zh) 2019-11-15

Similar Documents

Publication Publication Date Title
WO2021003968A1 (zh) 数据核对方法、装置、计算机设备和存储介质
AU2022200535B2 (en) Method and system for blockchain variant using digital signatures
US10491390B2 (en) Proof chaining and decomposition
WO2020253122A1 (zh) 数据核对方法、装置、计算机设备和存储介质
WO2020048241A1 (zh) 区块链跨链的认证方法、系统、服务器及可读存储介质
CN114944932B (zh) 将区块添加到被许可的区块链的方法和系统
EP3693886A1 (en) Optimizations for verification of interactions system and method
US11625718B2 (en) Blockchain-based data verification system and method, computing device and storage medium
US20190213333A1 (en) Decentralized data authentication system for creation of integrated lifetime health records
TW202101939A (zh) 用於區塊鏈系統中的主節點切換處理的方法及裝置
WO2020211496A1 (zh) 一种块链式账本中的签名验证方法、系统、装置及设备
US20230316273A1 (en) Data processing method and apparatus, computer device, and storage medium
TW201826772A (zh) 基於區塊鏈技術的強健的atm網路系統及其資訊處理方法
WO2021204273A1 (zh) 资产类型注册、交易记录验证
US11057220B2 (en) Signature verification for a blockchain ledger
WO2021203590A1 (zh) 基于区块链的企业数据处理方法、装置、设备和存储介质
CN109861996B (zh) 基于区块链的关系证明方法、装置、设备及存储介质
WO2020233149A1 (zh) 一种块链式账本中的授时认证方法、装置及设备
CN110427424A (zh) 业务数据核对方法、装置、计算机设备和存储介质
CN112749969A (zh) 一种数据处理方法、装置、计算机设备及存储介质
CN112287033B (zh) 一种数据同步方法、设备以及计算机可读存储介质
CN102045349B (zh) 一种基于时间和事件的一次性口令生成和验证方法
CN115811422A (zh) 一种基于区块链的医疗数据共享方法及系统
Jia et al. PROCESS: Privacy-preserving on-chain certificate status service
US20240073045A1 (en) Blockchain-based data processing method and apparatus, device, medium, and product

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19937335

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 11/05/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19937335

Country of ref document: EP

Kind code of ref document: A1