CN113282664A - Data synchronization method, system and storage medium based on block chain - Google Patents

Data synchronization method, system and storage medium based on block chain Download PDF

Info

Publication number
CN113282664A
CN113282664A CN202110644023.6A CN202110644023A CN113282664A CN 113282664 A CN113282664 A CN 113282664A CN 202110644023 A CN202110644023 A CN 202110644023A CN 113282664 A CN113282664 A CN 113282664A
Authority
CN
China
Prior art keywords
node
target
result
processing path
sub
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202110644023.6A
Other languages
Chinese (zh)
Other versions
CN113282664B (en
Inventor
杨宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202110644023.6A priority Critical patent/CN113282664B/en
Publication of CN113282664A publication Critical patent/CN113282664A/en
Application granted granted Critical
Publication of CN113282664B publication Critical patent/CN113282664B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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
    • 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/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application provides a data synchronization method, a data synchronization system and a storage medium based on a block chain, relates to the technical field of computers, and is beneficial to improving the efficiency of business processing. The method comprises the following steps: a first node receives a first request; a first node acquires a service processing path; the first node sends service data and a service processing path to each node in the service processing path; each node respectively verifies the validity of the node to obtain respective verification results; each node sends respective verification results and respective associated nodes to other nodes respectively, each node splices the received associated nodes of each node to obtain a splicing path from the first node to the target node, and verifies the consistency of the splicing path and the service processing path to obtain verification results; each node sends respective verification results to other nodes; and under the condition that the verification results of all the nodes in the service processing path represent that the verification is passed, all the nodes in the service processing path synchronously process the service requested by the first request.

Description

Data synchronization method, system and storage medium based on block chain
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a data synchronization method and system based on a block chain and a storage medium.
Background
When a customer transacts cross-border RMB remittance business at a financial institution in China continent, a payer bank receives a remittance application of the customer and sends a remittance instruction, and the payer bank directly transfers money to a receiving bank, or the payer bank transfers the money to the receiving bank through a proxy bank, and the receiving bank releases the money to the receiving bank according to the requirement of the remittance instruction. In the customer remittance, at least one of the payer and the receiver is not a financial institution.
In the existing cross-border RMB remittance business, each bank on the remittance path carries out self account processing according to the received remittance instruction in sequence, converts loop information in the received remittance instruction to obtain new remittance instruction information, and transmits the new remittance instruction information to subsequent mechanisms in a message mode until the remittance position reaches a final payee account opening bank or a final payee financial mechanism and is released to a client account number or a payee self account. In the whole remittance process, only after the fund clearing between two banks associated with the previous step is completed, the new remittance instruction information is converted and reprocessed by the information receiver of the step and is sequentially pushed to the financial institution next to the information receiver of the step on the remittance path appointed by the remittance service at the initiation time. This method of money transfer is inefficient.
Disclosure of Invention
The embodiment of the application provides a data synchronization method, a data synchronization system and a storage medium based on a block chain, relates to the technical field of computers, and is beneficial to improving the efficiency of business processing.
In a first aspect, an embodiment of the present application provides a data synchronization method, which is applied to a block chain data synchronization system, where the block chain data synchronization system includes: a plurality of nodes, the method comprising: a first node receives a first request; the first request comprises service data and an identifier of a target node; the target node is a node except the first node in the plurality of nodes; a first node acquires a service processing path; in the service processing path, the first node is a starting node, the target node is an ending node, and the service processing path also comprises at least one intermediate node; the first node sends service data and a service processing path to the target node and at least one intermediate node; the target node and at least one intermediate node respectively verify the legality of the service data and the legality of the service processing path to obtain respective first verification result or second verification result; the first verification result is used for representing that the verification is passed, and the second verification result is used for representing that the verification is not passed; the target node and at least one intermediate node respectively send respective first verification results or second verification results and respective associated nodes to each node in the service processing path; the related node of each node is the previous node or the next node of the node in the service processing path; splicing the received associated nodes of the nodes by the nodes in the service processing path to obtain a splicing path from the first node to the target node, verifying the consistency of the splicing path and the service processing path, and obtaining respective third verification result or fourth verification result; the third verification result is used for representing that the verification is passed, and the fourth verification result is used for representing that the verification is not passed; each node in the service processing path sends respective third verification result or fourth verification result to other nodes in the service processing path; and under the condition that the verification result of each node in the service processing path comprises the first verification result and the third verification result, each node in the service processing path synchronously processes the service requested by the first request.
In the embodiment of the application, after receiving the first request, the first node acquires the service data of the request and the service processing path corresponding to the target node, and sends the service data and the service processing path to each node in the service processing path, so that each node in the service processing path can verify the service data and the service processing path respectively to obtain the verification result, and sends the obtained verification result to other nodes in the service processing path, and each node in the service processing path synchronously processes the service requested by the first request under the condition that each node in the service processing path passes the verification, thereby saving the waiting time and improving the processing efficiency of the service requested by the first request.
In one possible implementation, the plurality of nodes further includes a management node; the method further comprises the following steps: the first node sends service data and a service processing path to the management node; the above target node and at least one intermediate node respectively verify the validity of the service data and the service processing path to obtain a first verification result or a second verification result, including:
the target node and at least one intermediate node determine whether the associated node of each node and each node have a target corresponding relation to obtain a first sub-result; the target corresponding relation comprises the corresponding relation between the identification of the associated node of each node and the identification of each node; the target node and the at least one intermediate node determine whether the target data of each node meets a preset condition or not to obtain a second sub-result; the target data is data to be deducted in the process that each node processes the service requested by the first request; the target node and at least one intermediate node determine whether the associated node of each node is a registered node or not to obtain a third sub-result; and the management node determines whether each node in the service processing path is a registered node or not, and obtains a fourth sub-result.
For each of the target node and the at least one intermediate node: under the condition that the first sub-result, the second sub-result and the third sub-result of each node are all yes, the node determines that the service data and the service processing path are legal, and a first verification result of the node is obtained; or, when the first sub-result and the second sub-result of each node are both yes, the third sub-result is no, and the node associated with the node in the fourth sub-result is a registered node, the node determines that the service data and the service processing path are legal, and obtains a first verification result of the node; or, if the first sub-result and the second sub-result of each node are both yes, the third sub-result is no, and the node associated with the node in the fourth sub-result is not a registered node, the node determines that the service data and the service processing path are illegal, and obtains a second verification result of the node; or, under the condition that any one of the first sub-result or the second sub-result of each node is negative, the node determines that the service data and the service processing path are illegal, and obtains a second verification result of the node.
In another possible implementation manner, the determining, by the target node and the at least one intermediate node, whether the target data of each node satisfies a preset condition to obtain a second sub-result includes: if the target data of the node is determined to be greater than or equal to the service quantity by the target node and each node in the at least one intermediate node, the node determines that the second sub-result is yes; determining that the target data of the node is smaller than the service quantity by the target node and each node in the at least one intermediate node, and determining that the second sub-result is yes by the node under the condition that the category of the target data is a preset target category; and determining that the target data of the node is smaller than the service quantity by the target node and each node in the at least one intermediate node, and determining that the second sub-result is negative by the node under the condition that the category of the target data is not the target category.
In another possible implementation manner, the method further includes: the method comprises the steps that when a target node and each node in at least one intermediate node determine that target data of the node are smaller than service quantity and the category of the target data is a target category, the node sends prompt information to other nodes except the node in a service path; the hint information is used to characterize that the node's handling of the requested service for the first request results in the target data being negative.
In another possible implementation manner, the method further includes: and under the condition that the verification result of at least one node in the service processing path comprises a second verification result or a fourth verification result, the at least one node sends the verification result of the at least one node to other nodes except the node in the service processing path. Therefore, under the condition that any one node summarized by the service processing path fails to verify, other nodes can receive the verification result of the node in time, and the information synchronization among the nodes in the service processing path is improved.
In a second aspect, an embodiment of the present application provides a data synchronization system, where the data synchronization system includes a plurality of nodes; the first node is used for receiving a first request; the first request comprises service data and an identifier of a target node; the target node is a node except the first node in the plurality of nodes; the first node is used for acquiring a service processing path; in the service processing path, the first node is a starting node, the target node is an ending node, and the service processing path also comprises at least one intermediate node; the first node is used for sending the service data and the service processing path to the target node and at least one intermediate node; the target node and the at least one intermediate node are respectively used for verifying the legality of the service data and the service processing path to obtain respective first verification result or second verification result; the first verification result is used for representing that the verification is passed, and the second verification result is used for representing that the verification is not passed; the target node and the at least one intermediate node are respectively used for sending respective first verification results or second verification results and respective associated nodes to each node in the service processing path; the related node of each node is the previous node or the next node of the node in the service processing path; each node in the service processing path is used for splicing the received associated node of each node to obtain a splicing path from the first node to the target node, verifying the consistency of the splicing path and the service processing path and obtaining a third verification result or a fourth verification result of each node; the third verification result is used for representing that the verification is passed, and the fourth verification result is used for representing that the verification is not passed; each node in the service processing path is respectively used for sending a respective third verification result or a respective fourth verification result to other nodes in the service processing path; and under the condition that the verification result of each node in the service processing path comprises the first verification result and the third verification result, each node in the service processing path is used for synchronously processing the service requested by the first request.
In one possible implementation, the plurality of nodes further includes a management node; the first node is also used for sending the service data and the service processing path to the management node; the target node and the at least one intermediate node are specifically used for determining whether a target corresponding relationship exists between the associated node of each node and each node, and obtaining a first sub-result; the target corresponding relation comprises the corresponding relation between the identification of the associated node of each node and the identification of each node; the target node and the at least one intermediate node are specifically used for determining whether the target data of each node meets a preset condition to obtain a second sub-result; the target data is data to be deducted in the process that each node processes the service requested by the first request; the target node and the at least one intermediate node are specifically used for determining whether the associated node of each node is a registered node or not to obtain a third sub-result; the management node is used for determining whether each node in the service processing path is a registered node or not and obtaining a fourth sub-result.
For each of the target node and the at least one intermediate node: under the condition that the first sub-result, the second sub-result and the third sub-result of each node are all yes, the node is specifically used for determining that the service data and the service processing path are legal and obtaining a first verification result of the node; or, when the first sub-result and the second sub-result of each node are both yes, the third sub-result is no, and the node associated with the node in the fourth sub-result is a registered node, the node is specifically configured to determine that the service data and the service processing path are legal, and obtain a first verification result of the node; or, when the first sub-result and the second sub-result of each node are both yes, the third sub-result is no, and the node associated with the node in the fourth sub-result is not a registered node, the node is specifically configured to determine that the service data and the service processing path are illegal, and obtain a second verification result of the node; or, in the case that any one of the first sub-result or the second sub-result of each node is negative, the node is specifically configured to determine that the service data and the service processing path are illegal, and obtain the second verification result of the node.
In another possible implementation manner, when the target node and each node in the at least one intermediate node determine that the target data of the node is greater than or equal to the number of services, the node is specifically configured to determine that the second sub-result is yes; the target node and each node in the at least one intermediate node determine that the target data of the node is smaller than the service quantity, and the node is specifically configured to determine that the second sub-result is yes when the category of the target data is a preset target category; and the target node and each node in the at least one intermediate node determine that the target data of the node is smaller than the service quantity, and the node is specifically used for determining whether the second sub-result is negative under the condition that the category of the target data is not the target category.
In another possible implementation manner, when the target node and each node in the at least one intermediate node determine that the target data of the node is smaller than the service quantity and the category of the target data is the target category, the node is further configured to send a prompt message to other nodes except the node in the service path; the hint information is used to characterize that the node's handling of the requested service for the first request results in the target data being negative.
In another possible implementation manner, in a case that the verification result of the at least one node in the traffic processing path includes the second verification result or the fourth verification result, the at least one node is further configured to send the verification result of the at least one node to other nodes except the node in the traffic processing path.
In a third aspect, an embodiment of the present application provides a data synchronization apparatus, including a processor and a memory, where the memory is configured to store code instructions, and the processor is configured to execute the code instructions to perform a method performed by a first node, an intermediate node, a target node, or a management node in the first aspect or any one of the possible implementation manners of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, where a computer program or an instruction is stored, and when the computer program or the instruction is executed on a computer, the computer is caused to execute the method performed by the first node, the intermediate node, the target node, or the management node in the first aspect or any one of the possible implementations of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product including a computer program, which, when run on a computer, causes the computer to perform the method performed by the first node, the intermediate node, the target node, or the management node in the first aspect or any one of the possible implementations of the first aspect.
In a sixth aspect, an embodiment of the present application provides a data synchronization system, where the system includes: the functions of the first node, the intermediate node, the target node or the management node in a data synchronization method described in the first aspect or any one of its possible implementations can be implemented.
In a seventh aspect, the present application provides a chip or a chip system, where the chip or the chip system includes at least one processor and a communication interface, where the communication interface and the at least one processor are interconnected by a line, and the at least one processor is configured to execute a computer program or an instruction to perform a method performed by a first node, an intermediate node, a target node, or a management node in the first aspect or any one of possible implementations of the first aspect; the communication interface in the chip may be an input/output interface, a pin, a circuit, or the like.
In one possible implementation, the chip or chip system described above in this application further comprises at least one memory having instructions stored therein. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or may be a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).
It should be understood that the second to seventh aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the advantageous effects obtained by the aspects and the corresponding possible implementations are similar and will not be described again.
Drawings
FIG. 1 is a schematic diagram of a process for providing a money transfer service according to one embodiment of the present application;
fig. 2 is a schematic structural diagram of a data synchronization system according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a data synchronization method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data synchronization apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a chip according to an embodiment of the present application.
Detailed Description
In the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same or similar items having substantially the same function and action. For example, the first chip and the second chip are only used for distinguishing different chips, and the sequence order thereof is not limited. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.
It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the embodiments of the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or multiple.
In the following, some of the terms and techniques referred to in the examples of the present application are briefly described:
1) cross-border fund receipt and payment
The cross-border fund collection and payment is the international debt and debt caused by international trade, international investment and other aspects between two or more countries or regions, and the trans-country and cross-region fund transfer behavior is realized by means of certain settlement tools and payment systems.
2) Block chain
Blockchains are decentralized databases. A block is a data block. The block chain can combine blocks into a chain data structure in a sequential connection manner by distributed nodes according to a time sequence.
3) Federation chain
Federation chains are an important type of application for block chains. The alliance chain only aims at members of a specific group and limited third parties, a plurality of preselected nodes are internally designated as billers, and generation of each block is jointly determined by all the preselected nodes. For example, a pending transaction (e.g., a cross-border remittance transaction) may correspond to a block in a federation chain. The node for processing the service in the embodiment of the present application may be a preselected node (also referred to as an accounting person) in the federation chain.
4) Consensus mechanism
The consensus mechanism is an algorithm for achieving distributed consensus for blockchain transactions, and solves the problem of consistency of transaction processing of each node in a distributed network, namely consensus on which mode all nodes in the network adopt, and agree on a certain proposal or a certain state. For example, each node processing the cross-border remittance service adopts the same verification method to verify and confirm the cross-border remittance service, and under the condition that each node passes the verification, the nodes reach consensus.
When financial institutions in continental china transact Cross-border rmb remittance business, the Cross border Payment System (CIPS) of rmb is increasingly being handled. The system is mainly responsible for management, operation and maintenance by people's banks. Currently, in the process of processing cross-border rmb remittance service in a CIPS system, a payer bank receives a remittance application of a customer and issues a remittance instruction, and the payer bank directly transfers money to a receiving bank, or the payer bank transfers the money to the receiving bank through an agent bank, and the receiving bank releases the money to the receiving bank according to the requirements of the remittance instruction.
For example, as shown in fig. 1, a processing procedure of a remittance service is shown, in fig. 1, a payer bank 101 receives a remittance request from a customer and sends a remittance instruction, the payer bank 101 processes an account corresponding to the remittance service in the remittance request, then, the payer bank 101 sends the remittance instruction to a first agency 102, the first agency 102 processes the account corresponding to the remittance service and then sends the remittance instruction to a second agency 103, the second agency 103 processes the account corresponding to the remittance service and then sends the remittance instruction to a payee 104, and the payee 104 remits a money in the remittance instruction to a payee. During the whole money transfer process, only after the accounting process between the two institutions (such as the payer bank 101 and the first agency 102) related to the previous step is completed, a new money transfer instruction is converted and reprocessed by the recipient (such as the first agency 102) of the step, and is sequentially pushed to the subsequent node (such as the second agency 103) of the recipient on the money transfer path designated by the money transfer service at the time of initiation. Resulting in long money transfer service processing times and inefficiency.
Based on this, an embodiment of the present application provides a data synchronization method based on a block chain, where the data synchronization method of the embodiment of the present application may be applied to a block chain data synchronization system, and fig. 2 is a schematic structural diagram of the block chain data synchronization system provided in the embodiment of the present application. The blockchain data synchronization system 20 shown in fig. 2 includes a first node 201, a first intermediate node 202, a second intermediate node 203, and a target node 204, and optionally, the blockchain data synchronization system 20 further includes a management node 205. Communication between the nodes in the blockchain data synchronization system 20 is possible.
The first node 201 is configured to receive a service request of a user, the service request including service data and an identification of the target node 204. The first node 201 is further configured to acquire a traffic processing path from the first node 201 to the target node 204 (e.g., the first node 201-the first intermediate node 202-the second intermediate node 203-the target node 204), and send traffic data and the acquired traffic processing path to each node in the traffic processing path (e.g., the first intermediate node 202 to the target node 204 in fig. 2).
Each node in the service processing path is used for verifying the received service data and the service processing path, and sending a verification result and the associated node of the node to each node in the service processing path. Each node in the service processing path is further configured to obtain a splicing path according to the associated node of each node, verify whether the splicing path is the same as the service processing path, if the splicing path is different from the service processing path, verify that the splicing path does not pass, and send a verification result representing that the verification does not pass to other nodes in the service processing path when any verification result representing that the verification is not passed is obtained by any node in the service processing path. The service is changed to the service requested by the service request. And under the condition that the verification result related to the service obtained by each node in the service processing path represents that the verification passes, each node in the service processing path concurrently processes the service. Therefore, on the basis of ensuring the safety of business processing, the efficiency of business processing is improved.
The functions of the nodes (e.g., including the first node 201, the first intermediate node 202, the second intermediate node 203, the target node 204, and the management node 206) in the above-mentioned blockchain data synchronization system can be implemented by the electronic device 30 shown in fig. 3. The electronic device 30 in fig. 3 includes but is not limited to: a processor 301, a memory 302, a communication interface 303, a power supply 304, and the like.
The processor 301 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 302 and calling data stored in the memory 302, thereby performing overall monitoring of the electronic device. Processor 301 may include one or more processing units; optionally, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user interfaces, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 301.
The memory 302 may be used to store software programs as well as various data. The memory 302 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one functional unit, and the like. Further, the memory 302 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Alternatively, the memory 302 may be a non-transitory computer readable storage medium, for example, a read-only memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
The communication interface 303 is an interface for connecting an external device to the electronic apparatus 30. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The communication interface 303 may be used to receive input (e.g., data information, etc.) from an external device and transmit the received input to one or more elements within the electronic apparatus 30 or may be used to transmit data between the electronic apparatus 30 and an external device.
A power supply 304 (e.g., a battery) may be used to supply power to the various components, and optionally, the power supply 304 may be logically connected to the processor 301 through a power management system, so as to manage charging, discharging, and power consumption management functions through the power management system.
Optionally, the computer instructions in the embodiments of the present application may also be referred to as application program code or system, which is not specifically limited in the embodiments of the present application.
The electronic device shown in fig. 3 is merely an example, and does not limit the electronic device to which the embodiments of the present application are applicable. In actual implementation, the electronic device may include more or fewer devices or devices than those shown in fig. 3.
Fig. 4 is a flowchart illustrating a data synchronization method according to an embodiment of the present application, where the data synchronization method shown in fig. 4 is applicable to the block chain data synchronization system shown in fig. 2. As shown in fig. 4, the following steps may be included:
s100: the first node receives a first request. The first request comprises service data and an identifier of a target node; the target node is a node except the first node in the block chain data synchronization system.
In one possible implementation manner, the first node receives a first request sent by the terminal device.
Illustratively, assume that the first node is a node of a payer bank in a blockchain data synchronization system, which receives a first request sent by a terminal device. The terminal device may be a device running a client of a target system of the payer bank, wherein the target system and the blockchain data synchronization system have a communication interface, and the communication interface may be used for the first node to receive data from the terminal device.
In another possible implementation manner, the first node receives a request entry operation of a user in a request entry interface, and acquires a first request.
Illustratively, assume that the first node is a node of a payer bank in a blockchain data synchronization system, the first node receives a first request entered by a user in a request entry interface. The first request is used for requesting to process the remittance service, and the first request can comprise information such as remittance amount and a collection account, wherein the service data of the remittance service comprises the remittance amount, and the identification of the target node of the remittance service is the collection account.
S101: the first node acquires a service processing path. The first node is a starting node in the acquired service processing path, the target node is an ending node in the service processing path, and the service processing path further comprises at least one intermediate node.
In a possible implementation manner, the first node obtains a service processing path of a service requested by a first request input by a user.
In another possible implementation manner, the first node determines a service processing path of the service requested by the first request according to a preset rule.
The first node may pre-store a target correspondence between the node in the block chain data synchronization system and another node, where the target correspondence includes a correspondence between an identifier of the node and an identifier of an associated node. The first node determines a node from the plurality of target correspondences that associates the first node with the target node. The first node determines each node associated from the first node to the target node to form a service processing path for the requested service.
In one example, it is assumed that the target correspondence includes a correspondence between a first node and a first intermediate node, a correspondence between the first intermediate node and a second intermediate node, and a correspondence between the second intermediate node and the target node. Then, the first node determines that the traffic processing path of the first request requested service is the first node, the first intermediate node, the second intermediate node, and the target node.
It can be understood that, in the case that the number of the service processing paths requested by the first request determined by the first node is greater than 1, the first node may select one service path from the plurality of service processing paths as the service processing path of the service requested by the first request, and the first node may also select the service processing path with the highest default priority from the plurality of service processing paths.
Illustratively, the traffic processing path determined by the first node includes a first path and a second path, the first path includes the first node, a first intermediate node, a second intermediate node and a target node, and the second path includes the first node, the second intermediate node and the target node. And under the condition that the first intermediate node is a default associated node of the first node, the first node determines that the first path is a service processing path of the service requested by the first request. It will be appreciated that the default associated node for each node may be the result of the node receiving user input.
Each node in the block chain data synchronization system can receive the target corresponding relation sent by other nodes except the node, and each node can also receive user input operation to acquire the target corresponding relation.
For example, after a financial institution (e.g., a bank or an agency) corresponding to the first intermediate node opens an account in the first node, the first node is an account opening row of the first intermediate node, the first intermediate node is an account row of the first node, and the first node obtains a corresponding relationship (also referred to as an account opening relationship) between the first node and the first intermediate node in response to an input operation of a user. The first node sends the corresponding relation to each node in the block chain data synchronization system, and each node in the block chain data synchronization system stores the received corresponding relation.
S102: the first node sends traffic data and a traffic processing path to the target node and the at least one intermediate node.
In a possible implementation manner, the first node sends the service data and the service processing path to the target node and the at least one intermediate node based on a epidemic protocol (Gossip protocol).
Based on the example of the first path in S101, the first node sends the traffic data and the traffic processing path to its associated first intermediate node, and the first intermediate node sends the traffic data and the traffic processing path to its associated second intermediate node. The second intermediate node sends the traffic data and the traffic processing path to its associated target node.
S103: and the target node and the at least one intermediate node respectively verify the legality of the received service data and the legality of the service processing path to obtain respective first verification result or second verification result. The first verification result is used for representing that the verification is passed, and the second verification result is used for representing that the verification is not passed.
In a possible implementation manner, the target node and the at least one intermediate node determine whether a target corresponding relationship exists between the associated node of each node and each node, and obtain a first sub-result. The target correspondence includes a correspondence between the identifier of the associated node of each node and the identifier of each node.
Based on the target corresponding relationship and the example of the first path in S101, it is described as an example that the first intermediate node determines whether a target corresponding relationship exists between the associated node of the first intermediate node and the first intermediate node, where the associated node of the first intermediate node in the first path is the second intermediate node and the first node, and if the financial institution corresponding to the first intermediate node does not have an account open relationship with the financial institution corresponding to the first node, or if the financial institution corresponding to the first intermediate node does not have an account open relationship with the financial institution corresponding to the second intermediate node, the first intermediate node determines that the service requested by the first request is illegal, and a first sub-result obtained by the first intermediate node indicates that the verification is not passed. Otherwise, the first sub-result representation obtained by the first intermediate node passes the verification.
In the verification process of the account opening relationship, the first sub-result may be determined only by the node where the account opening bank is located, and the node where the account opening bank is located may obtain the neutral information. Wherein, the neutral information does not influence the verification result.
The target node and the at least one intermediate node determine whether the target data of each node meets a preset condition or not to obtain a second sub-result; and the target data is the data to be deducted in the process of processing the service requested by the first request by each node.
In a possible implementation manner, when each of the target node and the at least one intermediate node determines that the target data of the node is greater than or equal to the number of services in the first request, the node determines that the second sub-result is yes. And determining that the target data of the node is smaller than the service quantity in the first request by the target node and each node in the at least one intermediate node, and determining that the second sub-result is yes by the node under the condition that the category of the target data is a preset target category. And the target node and each node in the at least one intermediate node determine that the target data of the node is smaller than the service quantity in the first request, and the node determines that the second sub-result is negative under the condition that the category of the target data is not the target category.
Based on the target correspondence and the example of the first path in S101, the description will be given by taking the first intermediate node as an example: the first intermediate node determines that the second sub-result is yes in the event that the balance of the target account in the first intermediate node is greater than or equal to the money transfer amount in the money transfer service requested by the first request. And the target account is an account opening account of the second intermediate node in the first intermediate node. In the event that the balance of the target account in the first intermediate node is less than the money transfer amount in the money transfer service requested by the first request and the target account in the first intermediate node allows overdraft, the first intermediate node determines the second sub-result to be yes. In the event that the balance of the target account in the first intermediate node is less than the money transfer amount in the money transfer service requested by the first request and the target account in the first intermediate node does not allow overdraft, the first intermediate node determines the second sub-result to be no.
Optionally, when the target node and each node in the at least one intermediate node determine that the target data of the node is smaller than the service quantity and the category of the target data is the target category, the node sends a prompt message to other nodes except the node in the service path; the hint information is used to characterize that the node processing the requested service of the first request results in the target data being negative.
Illustratively, where the balance of the target account in the first intermediate node is less than the money transfer amount in the money transfer service requested by the first request and the target account in the first intermediate node allows overdraft, the first intermediate node sends a prompt to the first node, the second intermediate node, and the target node, the prompt indicating that processing the money transfer service by the first intermediate node will result in overdraft of the account opened by the second intermediate node in the first intermediate node. In this way, risk prompting can be performed on other nodes in the business processing path.
And the target node and the at least one intermediate node determine whether the associated node of each node is a registered node or not, and obtain a third sub-result.
For example, the first intermediate node determines whether the first node and the second intermediate node are registered nodes, and if any one of the first node and the second intermediate node is not a registered node, the first intermediate node determines that the third sub-result is no, otherwise, the first intermediate node determines that the third sub-result is yes. In case the first intermediate node finds the identity of the first node and the identity of the second intermediate node among the identities of the registered nodes, the first intermediate node determines that the third sub-result is yes.
It should be noted that each node in the blockchain data synchronization system stores an identifier of a registered node, and the identifier of the registered node may be sent by the management node. The management node verifies each node added into the block chain data synchronization system, adds the identifier of the verified node into the identifier of the registered node, and sends the identifier of the registered node to each node in the block chain data synchronization system.
And the management node determines whether each node in the service processing path is a registered node or not, and obtains a fourth sub-result. The management node may determine whether each node in the service processing path is a registered node according to a pre-stored identifier of the registered node.
For each of the target node and the at least one intermediate node: and under the condition that the first sub-result, the second sub-result and the third sub-result of each node are all yes, the node determines that the service data and the service processing path are legal, and obtains a first verification result of the node.
Or, when the first sub-result and the second sub-result of each node are both yes, the third sub-result is no, and the node associated with the node in the fourth sub-result is a registered node, the node determines that the service data and the service processing path are legal, and obtains the first verification result of the node. In this way, in the case where the node is registered in the management node in conjunction with the fourth sub-result obtained by the management node, but the registration information of the node is not transmitted to the node in the traffic processing path, the node is not judged erroneously as the registered node.
Or, if the first sub-result and the second sub-result of each node are both yes, the third sub-result is no, and the node associated with the node in the fourth sub-result is not a registered node, the node determines that the service data and the service processing path are illegal, and obtains a second verification result of the node.
Or, in the case that any one of the first sub-result or the second sub-result of each node is negative, the node determines that the service data and the service processing path are illegal, and obtains the second verification result of the node.
S104: the target node and at least one intermediate node respectively send respective first verification results or second verification results and respective associated nodes to each node in the service processing path; the associated node of each node is a previous node or a next node of the node in the service processing path.
For example, it is assumed that a verification result obtained by verifying the service data and the service processing path by the first intermediate node is a first verification result, the first intermediate node sends the first verification result to the first node, the second intermediate node, and the target node, and an associated node of the first intermediate node is the second intermediate node.
S105: splicing the received associated nodes of the nodes by the nodes in the service processing path to obtain a splicing path from the first node to the target node, verifying the consistency of the splicing path and the service processing path, and obtaining respective third verification result or fourth verification result; the third verification result is used for representing that the verification is passed, and the fourth verification result is used for representing that the verification is not passed.
Illustratively, the second intermediate node receives that the associated node of the first node is the first intermediate node, the associated node of the first intermediate node is the second intermediate node, and the associated node of the second intermediate node is the target node. And the splicing path obtained by the second intermediate node is the first node, the first intermediate node, the second intermediate node and the target node. And the second intermediate node determines that the splicing path is the same as the service processing path, and then the second intermediate node obtains a third verification result.
S106: and each node in the service processing path sends respective third verification result or fourth verification result to other nodes in the service processing path.
Based on the example in S105, the second intermediate node sends the third verification result to the first node, the first intermediate node, and the target node.
S107: and under the condition that the verification result of each node in the service processing path comprises the first verification result and the third verification result, each node in the service processing path synchronously processes the service requested by the first request.
Illustratively, under the condition that the first node, the first intermediate node, the second intermediate node and the target node respectively verify that the verification results of the service data and the service processing path are all first verification results, and the verification results of the splicing path obtained by the first node, the first intermediate node, the second intermediate node and the target node are all third verification results, each node in the service processing path synchronously processes the service requested by the first request.
Optionally, S108: and under the condition that the verification result of at least one node in the service processing path comprises a second verification result or a fourth verification result, the node sends the verification result of the node to other nodes except the node in the service processing path.
For example, it is assumed that, when the first intermediate node verifies that the verification result of the service data and the service processing path is the second verification result, the first intermediate node sends the obtained second verification result to the first node, the second intermediate node, and the target node. Thus, the safety of business processing is improved.
In the embodiment of the application, after receiving the first request, the first node acquires the service processing path of the service requested by the first request, and sends the service data and the service processing path to each node in the service processing path, so that each node in the service processing path acquires the information such as the service data and the service processing path when the service request occurs, and verifies the acquired information. For example, when the remittance service occurs, each node in the service processing path for processing the remittance service acquires information such as the remittance amount, the destination account, and the remittance path of the remittance service, and verifies the validity of the information. And under the condition that all the nodes pass the verification, the service requested by the first request is synchronously processed, so that the service processing efficiency is improved. For the remittance service, the processing time of the remittance service is shortened, the liquidity of fund payment is accelerated, and the fund which cannot be utilized in the process is reduced.
The method of the embodiment of the present application is described above, and the following describes a block chain data synchronization system and a data synchronization apparatus for performing the method according to the embodiment of the present application. Those skilled in the art will appreciate that the method and apparatus can be combined and referred to each other, and the data synchronization apparatus provided in the embodiments of the present application can perform the steps of the data synchronization method described above.
As shown in fig. 2, which is a schematic structural diagram of a block chain data synchronization system according to an embodiment of the present application, the block chain data synchronization system 20 shown in fig. 2 includes: the first node 201, the first intermediate node 202, the second intermediate node 203, and the target node 204, and optionally, the blockchain data synchronization system 20 further includes a management node 205. The first node 201 is configured to: receiving a first request; the first request includes the traffic data and an identification of the target node 204; the target node 204 is a node of the plurality of nodes other than the first node 201; the first node 201 is configured to obtain a service processing path; in the service processing path, the first node 201 is a start node, the target node 204 is an end node, and the service processing path further includes at least one intermediate node; the first node 201 is configured to send traffic data and a traffic processing path to the target node 204 and the at least one intermediate node; the target node 204 and the at least one intermediate node are respectively used for verifying the validity of the service data and the service processing path to obtain a first verification result or a second verification result; the first verification result is used for representing that the verification is passed, and the second verification result is used for representing that the verification is not passed; the target node 204 and the at least one intermediate node are respectively configured to send respective first verification results or second verification results, and respective associated nodes to each node in the service processing path; the related node of each node is the previous node or the next node of the node in the service processing path; each node in the service processing path is used for splicing the received associated node of each node to obtain a splicing path from the first node 201 to the target node 204, verifying the consistency of the splicing path and the service processing path, and obtaining a third verification result or a fourth verification result of each node; the third verification result is used for representing that the verification is passed, and the fourth verification result is used for representing that the verification is not passed; each node in the service processing path is respectively used for sending a respective third verification result or a respective fourth verification result to other nodes in the service processing path; and under the condition that the verification result of each node in the service processing path comprises the first verification result and the third verification result, each node in the service processing path is used for synchronously processing the service requested by the first request. For example: in conjunction with fig. 4, the first node 201 may be configured to perform S100 to S108, and the target node 204 may be configured to perform S103 to S108.
In one possible implementation, the plurality of nodes further includes a management node 205; the first node 201 is further configured to send the traffic data and the traffic processing path to the management node 205; the target node 204 and the at least one intermediate node are specifically configured to determine whether a target correspondence relationship exists between a relevant node of each node and each node, and obtain a first sub-result; the target corresponding relation comprises the corresponding relation between the identification of the associated node of each node and the identification of each node; the target node 204 and the at least one intermediate node are specifically configured to determine whether target data of each node meets a preset condition, so as to obtain a second sub-result; the target data is data to be deducted in the process that each node processes the service requested by the first request; the target node 204 and the at least one intermediate node are specifically configured to determine whether a relevant node of each node is a registered node, and obtain a third sub-result; the management node 205 is configured to determine whether each node in the traffic processing path is a registered node, and obtain a fourth sub-result.
For each of the target node 204 and the at least one intermediate node: under the condition that the first sub-result, the second sub-result and the third sub-result of each node are all yes, the node is specifically used for determining that the service data and the service processing path are legal and obtaining a first verification result of the node; or, when the first sub-result and the second sub-result of each node are both yes, the third sub-result is no, and the node associated with the node in the fourth sub-result is a registered node, the node is specifically configured to determine that the service data and the service processing path are legal, and obtain a first verification result of the node; or, when the first sub-result and the second sub-result of each node are both yes, the third sub-result is no, and the node associated with the node in the fourth sub-result is not a registered node, the node is specifically configured to determine that the service data and the service processing path are illegal, and obtain a second verification result of the node; or, in the case that any one of the first sub-result or the second sub-result of each node is negative, the node is specifically configured to determine that the service data and the service processing path are illegal, and obtain the second verification result of the node.
In another possible implementation manner, when the target node 204 and each node in the at least one intermediate node determine that the target data of the node is greater than or equal to the number of services, the node is specifically configured to determine that the second sub-result is yes; the target node 204 and each node in the at least one intermediate node determine that the target data of the node is smaller than the service quantity, and the node is specifically configured to determine that the second sub-result is yes when the category of the target data is a preset target category; the target node 204 and each node in the at least one intermediate node determine that the target data of the node is smaller than the traffic volume, and if the category of the target data is not the target category, the node is specifically configured to determine that the second sub-result is no.
In another possible implementation manner, when the target node 204 and each node in the at least one intermediate node determine that the target data of the node is smaller than the traffic volume and the category of the target data is the target category, the node is further configured to send a prompt message to other nodes except the node in the traffic path; the hint information is used to characterize that the node's handling of the requested service for the first request results in the target data being negative.
In another possible implementation manner, in a case that the verification result of the at least one node in the traffic processing path includes the second verification result or the fourth verification result, the at least one node is further configured to send the verification result of the at least one node to other nodes except the node in the traffic processing path.
The block chain data synchronization system of the present embodiment can be correspondingly used to perform the steps performed in the above method embodiments, and the implementation principle and technical effect are similar, which are not described herein again.
As shown in fig. 5, for a data synchronization apparatus provided in the embodiment of the present application, the data synchronization apparatus 50 may include at least one processor 501, a memory 502, and a communication interface 503, for example, the processor 501 in fig. 5. Each of the processors 501 may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions). The memory 502 is used to store code instructions; the processor 501 is configured to execute the code instructions to perform the data synchronization method provided by any of the above embodiments. The communication interface 503 may be used to implement the transmitting step or the receiving step in the data synchronization method provided by any of the above embodiments.
Exemplarily, fig. 6 is a schematic structural diagram of a chip provided in an embodiment of the present application. Chip 120 includes one or more (including two) processors 1210, a communication bus 1220, and a communication interface 1230, and optionally, chip 120 also includes a memory 1240.
In some embodiments, memory 1240 stores the following elements: an executable module or a data structure, or a subset thereof, or an expanded set thereof.
The methods described in the embodiments of the present application may be applied to the processor 1210 or implemented by the processor 1210. Processor 1210 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by instructions in the form of hardware, integrated logic circuits, or software in the processor 1210. The processor 1210 may be a general-purpose processor (e.g., a microprocessor or a conventional processor), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an FPGA (field-programmable gate array) or other programmable logic device, discrete gate, transistor logic device or discrete hardware component, and the processor 1210 may implement or execute the methods, steps and logic blocks disclosed in the embodiments of the present invention.
The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium mature in the field, such as a random access memory, a read only memory, a programmable read only memory, or a charged erasable programmable memory (EEPROM). The storage medium is located in a memory 1240, and the processor 1210 reads information in the memory 1240 through a communication bus 1220, and performs the steps of the above-described method in conjunction with the hardware thereof. The communication interface 1230 may be used to implement the transmitting step or the receiving step in the data synchronization method provided by any of the above embodiments.
In the above embodiments, the instructions stored by the memory for execution by the processor may be implemented in the form of a computer program product. The computer program product may be written in the memory in advance, or may be downloaded in the form of software and installed in the memory.
Embodiments of the present application also provide a computer program product comprising one or more computer instructions. The procedures or functions according to the embodiments of the present application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. Computer instructions may be stored in, or transmitted from, a computer-readable storage medium to another computer-readable storage medium, e.g., from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optics, Digital Subscriber Line (DSL), or wireless (e.g., infrared, wireless, microwave, etc.), the computer-readable storage medium may be any available medium that a computer can store or a data storage device including one or more available media integrated servers, data centers, etc., the available media may include, for example, magnetic media (e.g., floppy disks, hard disks, or magnetic tape), optical media (e.g., digital versatile disks, DVD), or a semiconductor medium (e.g., a Solid State Disk (SSD)), etc.
The embodiment of the application also provides a computer readable storage medium. The methods described in the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer-readable media may include computer storage media and communication media, and may include any medium that can communicate a computer program from one place to another. A storage medium may be any target medium that can be accessed by a computer.
As one possible design, the computer-readable medium may include a compact disk read-only memory (CD-ROM), RAM, ROM, EEPROM, or other optical disk storage; the computer readable medium may include a disk memory or other disk storage device. Also, any connecting line may also be properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.
Combinations of the above should also be included within the scope of computer-readable media. The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A data synchronization method based on a block chain is applied to a block chain data synchronization system, and the block chain data synchronization system comprises: a plurality of nodes; the method comprises the following steps:
a first node receives a first request; the first request comprises service data and an identifier of a target node; the target node is a node of the plurality of nodes other than the first node;
the first node acquires a service processing path; in the service processing path, the first node is a starting node, the target node is an ending node, and the service processing path further comprises at least one intermediate node;
the first node sending the traffic data and the traffic processing path to the target node and the at least one intermediate node;
the target node and the at least one intermediate node respectively verify the legality of the service data and the legality of the service processing path to obtain respective first verification result or second verification result; the first verification result is used for representing that verification passes, and the second verification result is used for representing that verification does not pass;
the target node and the at least one intermediate node respectively send the first verification result or the second verification result and the associated node to each node in the service processing path; the related node of each node is the previous node or the next node of the node in the service processing path;
splicing the received associated nodes of the nodes by the nodes in the service processing path to obtain a splicing path from the first node to the target node, verifying the consistency of the splicing path and the service processing path, and obtaining respective third verification result or fourth verification result; the third verification result is used for representing that the verification is passed, and the fourth verification result is used for representing that the verification is not passed;
each node in the service processing path sends the third verification result or the fourth verification result to other nodes in the service processing path;
and under the condition that the verification result of each node in the service processing path comprises the first verification result and the third verification result, each node in the service processing path synchronously processes the service requested by the first request.
2. The data synchronization method of claim 1, wherein the plurality of nodes further comprises a management node; the method further comprises the following steps:
the first node sends the service data and the service processing path to the management node;
the target node and the at least one intermediate node respectively verify the validity of the service data and the service processing path to obtain respective first verification result or second verification result, including:
the target node and the at least one intermediate node determine whether a target corresponding relationship exists between the associated node of each node and each node, and a first sub-result is obtained; the target corresponding relation comprises a corresponding relation between the identification of the associated node of each node and the identification of each node;
the target node and the at least one intermediate node determine whether the target data of each node meets a preset condition or not to obtain a second sub-result; the target data is data to be deducted in the process that each node processes the service requested by the first request;
the target node and the at least one intermediate node determine whether the associated node of each node is a registered node or not to obtain a third sub-result;
the management node determines whether each node in the service processing path is a registered node or not to obtain a fourth sub-result;
for each of the target node and the at least one intermediate node: when the first sub-result, the second sub-result and the third sub-result of each node are all yes, the node determines that the service data and the service processing path are legal, and obtains the first verification result of the node;
or, when the first sub-result and the second sub-result of each node are both yes, the third sub-result is no, and the node associated with the node in the fourth sub-result is a registered node, the node determines that the service data and the service processing path are legal, and obtains the first verification result of the node;
or, when the first sub-result and the second sub-result of each node are both yes, the third sub-result is no, and the node associated with the node in the fourth sub-result is not a registered node, the node determines that the service data and the service processing path are illegal, and obtains the second verification result of the node;
or, in the case that any one of the first sub-result or the second sub-result of each node is negative, the node determines that the service data and the service processing path are illegal, and obtains the second verification result of the node.
3. The data synchronization method according to claim 2, wherein the target node and the at least one intermediate node determine whether the target data of each node satisfies a preset condition, and obtain a second sub-result, including:
if the target data of the node is determined to be greater than or equal to the traffic quantity by the target node and each node in the at least one intermediate node, the node determines that the second sub-result is yes;
determining, by the target node and each of the at least one intermediate node, that target data of the node is smaller than the traffic volume, and if the type of the target data is a preset target type, determining, by the node, that the second sub-result is yes;
and determining, by the target node and each of the at least one intermediate node, that the target data of the node is smaller than the traffic volume, and if the category of the target data is not the target category, determining, by the node, that the second sub-result is no.
4. The data synchronization method of claim 3, further comprising:
the target node and each node in the at least one intermediate node determine that the target data of the node is smaller than the service quantity, and the node sends prompt information to other nodes except the node in the service path under the condition that the type of the target data is the target type; the prompt message is used for representing that the node processes the service requested by the first request, so that the target data is negative.
5. The data synchronization method according to any one of claims 1 to 4, wherein the method further comprises:
and under the condition that the verification result of at least one node in the service processing path comprises the second verification result or the fourth verification result, the at least one node sends the verification result of the at least one node to other nodes except the node in the service processing path.
6. A data synchronization system based on a blockchain, the data synchronization system comprising a plurality of nodes;
the first node is used for receiving a first request; the first request comprises service data and an identifier of a target node; the target node is a node of the plurality of nodes other than the first node;
the first node is used for acquiring a service processing path; in the service processing path, the first node is a starting node, the target node is an ending node, and the service processing path further comprises at least one intermediate node;
the first node is configured to send the traffic data and the traffic processing path to the target node and the at least one intermediate node;
the target node and the at least one intermediate node are respectively used for verifying the legality of the service data and the legality of the service processing path to obtain respective first verification result or second verification result; the first verification result is used for representing that verification passes, and the second verification result is used for representing that verification does not pass;
the target node and the at least one intermediate node are respectively configured to send the first verification result or the second verification result, and the associated node to each node in the service processing path; the related node of each node is the previous node or the next node of the node in the service processing path;
each node in the service processing path is used for splicing the received associated node of each node to obtain a splicing path from the first node to the target node, verifying the consistency of the splicing path and the service processing path and obtaining a third verification result or a fourth verification result of each node; the third verification result is used for representing that the verification is passed, and the fourth verification result is used for representing that the verification is not passed;
each node in the service processing path is configured to send the third verification result or the fourth verification result to another node in the service processing path;
and under the condition that the verification result of each node in the service processing path comprises the first verification result and the third verification result, each node in the service processing path is used for synchronously processing the service requested by the first request.
7. The data synchronization system of claim 6, wherein the plurality of nodes further comprises a management node;
the first node is further configured to send the service data and the service processing path to the management node;
the target node and the at least one intermediate node are specifically used for determining whether a target corresponding relationship exists between the associated node of each node and each node, so as to obtain a first sub-result; the target corresponding relation comprises a corresponding relation between the identification of the associated node of each node and the identification of each node;
the target node and the at least one intermediate node are specifically used for determining whether the target data of each node meets a preset condition to obtain a second sub-result; the target data is data to be deducted in the process that each node processes the service requested by the first request;
the target node and the at least one intermediate node are specifically used for determining whether the associated node of each node is a registered node or not to obtain a third sub-result;
the management node is used for determining whether each node in the service processing path is a registered node or not to obtain a fourth sub-result;
for each of the target node and the at least one intermediate node: when the first sub-result, the second sub-result, and the third sub-result of each node are all yes, the node is specifically configured to determine that the service data and the service processing path are legal, and obtain the first verification result of the node;
or, when the first sub-result and the second sub-result of each node are both yes, the third sub-result is no, and the node associated with the node in the fourth sub-result is a registered node, the node is specifically configured to determine that the service data and the service processing path are legal, and obtain the first verification result of the node;
or, when the first sub-result and the second sub-result of each node are both yes, the third sub-result is no, and the node associated with the node in the fourth sub-result is not a registered node, the node is specifically configured to determine that the service data and the service processing path are illegal, and obtain the second verification result of the node;
or, in the case that any one of the first sub-result or the second sub-result of each node is negative, the node is specifically configured to determine that the service data and the service processing path are illegal, and obtain the second verification result of the node.
8. The data synchronization system of claim 7,
the target node and each node in the at least one intermediate node are specifically configured to determine that the second sub-result is yes when determining that the target data of the node is greater than or equal to the traffic number;
the target node and each node in the at least one intermediate node determine that the target data of the node is smaller than the service quantity, and the node is specifically configured to determine that the second sub-result is yes when the type of the target data is a preset target type;
and determining, by the target node and each of the at least one intermediate node, that the target data of the node is smaller than the traffic volume, and that the node is specifically configured to determine whether the second sub-result is negative in the case that the category of the target data is not the target category.
9. The data synchronization system of claim 8,
the target node and each node in the at least one intermediate node determine that the target data of the node is smaller than the service quantity, and the node is also used for sending prompt information to other nodes except the node in the service path under the condition that the category of the target data is the target category; the prompt message is used for representing that the node processes the service requested by the first request, so that the target data is negative.
10. The data synchronization system according to any one of claims 6 to 9,
and in the case that the verification result of at least one node in the traffic processing path includes the second verification result or the fourth verification result, the at least one node is further configured to send the verification result of the at least one node to other nodes in the traffic processing path except the node.
11. A computer-readable storage medium storing instructions that, when executed, cause a computer to perform a data synchronization method as claimed in any one of claims 1 to 5.
12. A computer program product, comprising a computer program which, when run, causes a computer to perform a data synchronization method as claimed in any one of claims 1 to 5.
CN202110644023.6A 2021-06-09 2021-06-09 Block chain-based data synchronization method, system and storage medium Active CN113282664B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110644023.6A CN113282664B (en) 2021-06-09 2021-06-09 Block chain-based data synchronization method, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110644023.6A CN113282664B (en) 2021-06-09 2021-06-09 Block chain-based data synchronization method, system and storage medium

Publications (2)

Publication Number Publication Date
CN113282664A true CN113282664A (en) 2021-08-20
CN113282664B CN113282664B (en) 2023-11-24

Family

ID=77284001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110644023.6A Active CN113282664B (en) 2021-06-09 2021-06-09 Block chain-based data synchronization method, system and storage medium

Country Status (1)

Country Link
CN (1) CN113282664B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111415163A (en) * 2020-04-30 2020-07-14 中国银行股份有限公司 Service processing and verifying method, system and verifying node based on block chain
CN111444550A (en) * 2020-03-24 2020-07-24 腾讯科技(深圳)有限公司 Block chain-based service data verification method and device and readable storage medium
CN112700246A (en) * 2020-12-31 2021-04-23 iCALC控股有限公司 Data processing method, device and equipment based on block chain and readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111444550A (en) * 2020-03-24 2020-07-24 腾讯科技(深圳)有限公司 Block chain-based service data verification method and device and readable storage medium
CN111415163A (en) * 2020-04-30 2020-07-14 中国银行股份有限公司 Service processing and verifying method, system and verifying node based on block chain
CN112700246A (en) * 2020-12-31 2021-04-23 iCALC控股有限公司 Data processing method, device and equipment based on block chain and readable storage medium

Also Published As

Publication number Publication date
CN113282664B (en) 2023-11-24

Similar Documents

Publication Publication Date Title
US20180365688A1 (en) Transaction execution and validation in a blockchain
CN108881187A (en) A kind of across chain data transferring method and equipment suitable for permitting chain scene
JP2019523495A (en) Digital goods management in a distributed transaction consensus network
EP3857489A1 (en) Method and system for dispute resolution in a public blockchain
CN112087502B (en) Method, device and equipment for processing request and storage medium
CN110175908A (en) A kind of value-added tax on imports financing method and device
CN113256294B (en) Network payment method, device, equipment and system
KR20190108666A (en) Apparatus and method for automated deposit and withdrawal of funds for cryptocurrency transactions and computer program for the same
CN111311395B (en) Management system, method, equipment and storage medium for public accumulation fund-charging and repayment service
WO2020103573A1 (en) Block chain-based network transaction signature method and device, and terminal equipment
CN113282664A (en) Data synchronization method, system and storage medium based on block chain
CN112965986B (en) Service consistency processing method, device, equipment and storage medium
CN108985933A (en) A kind of bookkeeping methods and device
CN111932255B (en) Method and device for realizing transaction reconciliation based on encrypted currency
KR102107454B1 (en) System for multiplication of financial payment networks, method for financial services using the same and computer program for the same
CN111260349B (en) Real-time payment method and system based on block chain
CN112446787A (en) Resource transfer method, device, equipment and storage medium
CN113628050A (en) Digital RMB delivery method, system, program product and storage medium
TW202125368A (en) Shares transfer system based on security token and method thereof
KR102475662B1 (en) Method and system for managing point using blockchain based on distributed ledger
CN110458701A (en) A kind of data processing method, device, block chain node device and medium
KR102398641B1 (en) System for providing card payment agent service and method performing thereof
CN111127003B (en) Wallet account payment method, device and storage medium
CN116703395B (en) Digital RMB payment method, device, equipment, system and medium
US11556922B2 (en) Method and system for conversion of digital assets to fiat currency

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant