Data processing method, device, equipment and medium based on blockchain system
By using smart contracts and ledgers in the blockchain system for data processing and flow control, the single point problem caused by the centralized process control center is solved, a decentralized data processing framework is realized, and the stability of data processing is improved.
Patent Information
- Application Number
- CN202210371601.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-04-08
AI Technical Summary
In the existing technology, multiple business participants need to interact remotely with a centralized process control center during data processing and transfer, resulting in single point problems and poor stability. Centralized node failure will cause the entire data processing framework to be unavailable.
The distributed node mechanism based on the blockchain system is used to control data processing and flow through smart contracts and ledgers on the blockchain nodes to avoid centralized nodes and achieve a decentralized data processing framework.
It improves the stability of data processing, avoids the problem of unavailability of the process processing framework caused by centralized node failure, and ensures the reliability and stability of data processing.
Smart Images

Figure CN114663080B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of blockchain technology, and more specifically, to a data processing method, device, electronic device, readable storage medium, and computer program product implemented based on a blockchain system. Background Art
[0002] With the rapid development of Internet technology, business cooperation between enterprises is becoming more frequent, and more and more businesses require the cooperation of multiple business participants. In related technologies, a centralized process control center is usually used to control the business flow between multiple business participants.
[0003] In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the related technology: multiple business participants need to interact remotely with the process control center when conducting data processing, there is a single point problem, and the stability of data processing is poor. Summary of the invention
[0004] In view of this, the present disclosure provides a data processing method, device, electronic device, readable storage medium and computer program product based on a blockchain system.
[0005] One aspect of the present disclosure provides a data processing method based on a blockchain system, wherein the blockchain system includes multiple blockchain nodes, and the blockchain nodes are configured with a first blockchain account book, a first smart contract, and a second smart contract. The method includes: for each of the blockchain nodes in the blockchain system, in response to triggering a scheduled task, calling the first smart contract to query the first blockchain account book to obtain at least one first block associated with the blockchain node; when it is determined that a first target block exists in at least one of the first blocks, parsing and processing the first target block to obtain target data; and calling the second smart contract to flow process the target data.
[0006] According to an embodiment of the present disclosure, the above-mentioned blockchain node is also configured with a second blockchain ledger; wherein, the above-mentioned calling of the above-mentioned second smart contract to perform flow processing on the above-mentioned target data includes: determining a business identifier based on the above-mentioned target data; determining a first process definition file associated with the above-mentioned business identifier from the above-mentioned second blockchain ledger; determining a first target blockchain node based on the above-mentioned first process definition file; generating a second block based on the above-mentioned target data and the above-mentioned first target blockchain node; and writing the above-mentioned second block into the above-mentioned first blockchain ledger.
[0007] According to an embodiment of the present disclosure, the determining of the first process definition file associated with the business identifier from the second blockchain ledger includes: obtaining at least one third block associated with the business identifier from the second blockchain ledger; determining a second target block from at least one third block; and parsing the second target block to obtain the first process definition file.
[0008] According to an embodiment of the present disclosure, the determining of the second target block from at least one of the third blocks includes: determining the third block located at the end of the second blockchain ledger among the at least one third block as the second target block.
[0009] According to an embodiment of the present disclosure, the above-mentioned blockchain node is also configured with a third smart contract; the above-mentioned method also includes: in response to receiving a second process definition file, determining multiple second target blockchain nodes associated with the above-mentioned second process definition file; calling the third smart contract to initiate a first consensus proposal to the multiple second target blockchain nodes; when it is determined that the multiple second target blockchain nodes reach a consensus on the above-mentioned first consensus proposal, packaging the above-mentioned second process definition file into the above-mentioned third block; and writing the above-mentioned third block into the above-mentioned second blockchain ledger.
[0010] According to an embodiment of the present disclosure, the first blocks are configured with a processing status identifier; the method further includes: in the case of determining that there is a first block in at least one of the first blocks that is characterized by an unprocessed first block as being marked with a processing status identifier, determining that there is the first target block in at least one of the first blocks.
[0011] According to an embodiment of the present disclosure, the method further includes: for each of the above-mentioned blockchain nodes, when writing the third target block into the first blockchain ledger or the second blockchain ledger of the above-mentioned blockchain node, initiating a second consensus proposal to other blockchain nodes of the above-mentioned blockchain system; and when determining that the above-mentioned other blockchain nodes have reached a consensus on the above-mentioned second consensus proposal, writing the above-mentioned third target block into the first blockchain ledger or the second blockchain ledger of other blockchain nodes of the above-mentioned blockchain system.
[0012] Another aspect of the present disclosure provides a data processing device implemented based on a blockchain system, wherein the blockchain system includes multiple blockchain nodes, and the blockchain nodes are configured with a first blockchain account book, a first smart contract, and a second smart contract. The device includes: a query module, which is used to call the first smart contract for each of the blockchain nodes in the blockchain system in response to triggering a scheduled task, so as to query the first blockchain account book and obtain at least one first block associated with the blockchain node; a first processing module, which is used to parse and process the first target block to obtain target data when it is determined that a first target block exists in at least one of the first blocks; and a second processing module, which is used to call the second smart contract to perform flow processing on the target data.
[0013] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method as described above.
[0014] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.
[0015] Another aspect of the present disclosure provides a computer program product, which includes computer executable instructions, and when the instructions are executed, are used to implement the method as described above.
[0016] According to the embodiments of the present disclosure, because a blockchain system is used to realize the flow control of data processing, each blockchain node can check whether there is a first target block in the first block associated with the blockchain node in the first blockchain account book stored locally by calling the first smart contract, and if it is determined that the first target block exists, parse and process the first target block to obtain the target data, and realize the flow processing of the target data by calling the second smart contract. Through the above technical means, the single point problem existing in the process processing framework of the related technology is at least partially overcome, and the problem that the failure of the centralized node will cause the process processing framework to be unavailable is avoided, and the stability of data processing is effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0018] Figure 1 An exemplary system architecture of a data processing method and device implemented based on a blockchain system according to an embodiment of the present disclosure is schematically shown.
[0019] Figure 2 The flowchart schematically shows a data processing method based on a blockchain system according to an embodiment of the present disclosure.
[0020] Figure 3 A flowchart of a target data flow processing method according to an embodiment of the present disclosure is schematically shown.
[0021] Figure 4 The flowchart of the process definition file publishing method according to the embodiment of the present disclosure is schematically shown.
[0022] Figure 5A The diagram schematically shows a data processing system of a business participant according to an embodiment of the present disclosure.
[0023] Figure 5B A schematic diagram of a blockchain system according to an embodiment of the present disclosure is schematically shown.
[0024] Figure 6 The block diagram schematically shows a data processing device implemented based on a blockchain system according to an embodiment of the present disclosure.
[0025] Figure 7 A block diagram of an electronic device suitable for implementing a data processing method based on a blockchain system according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0026] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0027] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0028] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0029] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0030] In related technologies, the flow of data processing involving multiple parties is mostly implemented based on process engines such as Activiti, Flowable, and camunda. The specific implementation methods adopted include: using the process engine to build a centralized process control center, formulating process definition files, and then the process control center is responsible for controlling the flow of data processing steps between multiple participants.
[0031] There is a single point problem when using a process engine to build a process control center to control the flow of data processing between multiple participants. For example, due to technical limitations, there is a high possibility of hardware failure throughout the life cycle. When the process control center fails, the entire data processing flow framework will be unavailable; for another example, since the process definition file is usually also stored in the process control center, if a business participant unilaterally publishes or modifies the process definition file without notifying other business participants, it will affect the normal operation of the business process; or, since all process scheduling information is stored in the process control center, the data is unreliable; for another example, when multiple business participants are processing data, they need to interact remotely with the process control center, which will cause large delays and errors that may be caused by network transmission.
[0032] In view of this, the embodiments of the present disclosure implement the distributed deployment of the framework based on the distributed node mechanism of the blockchain network, and no longer require a centralized process control center node to achieve the purpose of decentralization. Specifically, the embodiments of the present disclosure provide a data processing method, device, electronic device, readable storage medium and computer program product based on the blockchain system. The blockchain system includes multiple blockchain nodes, and the blockchain node is configured with a first blockchain account book, a first smart contract and a second smart contract. The method includes: for each blockchain node in the blockchain system, in response to triggering a scheduled task, calling the first smart contract to query the first blockchain account book to obtain at least one first block associated with the blockchain node; when it is determined that there is a first target block in at least one first block, parsing and processing the first target block to obtain target data; and calling the second smart contract to flow process the target data.
[0033] Figure 1 The exemplary system architecture of the data processing method and device based on the blockchain system according to the embodiment of the present disclosure is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0034] like Figure 1 As shown, the system architecture 100 according to this embodiment may include blockchain nodes 101, 102, 103, 104, 105, 106, and a network 107.
[0035] Blockchain nodes 101, 102, 103, 104, 105, and 106 are deployed in the terminal devices, servers, or server clusters of the corresponding business participants.
[0036] The network 107 is used to provide a medium for communication links between blockchain nodes 101, 102, 103, 104, 105, and 106. The network 107 may include various connection types, such as wired and / or wireless communication links, etc.
[0037] Blockchain nodes 101, 102, 103, 104, 105, and 106 constitute a blockchain system. Each blockchain node is configured with a smart contract and a blockchain ledger. Each blockchain node enjoys the same rights and obligations as all other blockchain nodes. Each blockchain node will determine some blockchain nodes as consensus blockchain nodes through a consensus mechanism. Any blockchain node performs read and write operations in its corresponding blockchain database, and other blockchain nodes will complete synchronization according to a certain mechanism, thereby achieving complete consistency of data in the blockchain database corresponding to all blockchain nodes in the blockchain network.
[0038] It should be noted that the data processing method based on the blockchain system provided in the embodiment of the present disclosure can generally be executed by the blockchain nodes 101, 102, 103, 104, 105, and 106. Accordingly, the data processing device based on the blockchain system provided in the embodiment of the present disclosure can generally be set in the blockchain nodes 101, 102, 103, 104, 105, and 106.
[0039] It should be understood that Figure 1 The number of blockchain nodes and networks in the example is only for illustration. Any number of blockchain nodes and networks may be used as required.
[0040] Figure 2 The flowchart schematically shows a data processing method based on a blockchain system according to an embodiment of the present disclosure.
[0041] like Figure 2 As shown, the method includes operations S201 to S203.
[0042] In operation S201, for each blockchain node in the blockchain system, in response to triggering a scheduled task, a first smart contract is called to query a first blockchain ledger to obtain at least one first block associated with the blockchain node.
[0043] In operation S202, when it is determined that a first target block exists in at least one first block, the first target block is parsed and processed to obtain target data.
[0044] In operation S203, the second smart contract is called to perform flow processing on the target data.
[0045] According to an embodiment of the present disclosure, each business participant can join the blockchain system by installing a blockchain node.
[0046] According to an embodiment of the present disclosure, when installing a blockchain node, a business participant can download the first blockchain ledger and the like to a local computer and install multiple smart contracts such as a first smart contract and a second smart contract.
[0047] According to an embodiment of the present disclosure, a scheduled task may be a task that is triggered at a certain time interval and is used to call a preset program or implement a preset function. The triggering time interval of the scheduled task may be, for example, 5 seconds, 30 seconds, etc., which is not limited here.
[0048] According to an embodiment of the present disclosure, the first blockchain ledger may include multiple subchains, each of which may correspond to a blockchain node. The at least one first block may be all blocks contained in the subchain corresponding to the blockchain node in the first blockchain ledger.
[0049] According to an embodiment of the present disclosure, the first block may include business data associated with the blockchain node. The first target block may include business data to be processed associated with the blockchain node.
[0050] According to an embodiment of the present disclosure, the first smart contract can be used to respond to a scheduled task and query the first blockchain ledger local to the blockchain node to determine whether there is any business data to be processed associated with the blockchain node in the first blockchain ledger, that is, whether there is a first target block.
[0051] According to an embodiment of the present disclosure, the content in the first blockchain ledger can rely on the ledger data synchronization mechanism of the blockchain system to be synchronized in real time to the first blockchain ledger local to the blockchain nodes of all business participants.
[0052] According to the embodiments of the present disclosure, parsing and processing the first target block can be understood as: parsing the first target block to obtain the business data to be processed contained in the first target block, and using the business logic of the business participant corresponding to the blockchain node to process the business data. The target data can be the output data after the business participant processes the business data.
[0053] According to an embodiment of the present disclosure, the second smart contract can be used to realize data flow between blockchain nodes, that is, the second smart contract can process the target data obtained by the blockchain node so as to facilitate subsequent processing of the target data by another blockchain node.
[0054] According to the embodiments of the present disclosure, because a blockchain system is used to realize the flow control of data processing, each blockchain node can check whether there is a first target block in the first block associated with the blockchain node in the first blockchain account book stored locally by calling the first smart contract, and if it is determined that the first target block exists, parse and process the first target block to obtain the target data, and realize the flow processing of the target data by calling the second smart contract. Through the above technical means, the single point problem existing in the process processing framework of the related technology is at least partially overcome, and the problem that the failure of the centralized node will cause the process processing framework to be unavailable is avoided, and the stability of data processing is effectively improved.
[0055] Reference below Figure 3 , Figure 4 , Figure 5A and Figure 5B , combined with specific embodiments Figure 2 The method shown is further explained.
[0056] According to an embodiment of the present disclosure, the first block may be configured with a processing status identifier.
[0057] According to an embodiment of the present disclosure, whether a first target block exists can be determined by traversing the processing status identifiers of at least one first block, that is, when it is determined that a first block represented by a processing status identifier as unprocessed exists in at least one first block, it is determined that a first target block exists in at least one first block.
[0058] According to an embodiment of the present disclosure, the blockchain node may also be configured with a second blockchain ledger.
[0059] According to an embodiment of the present disclosure, each block of the second blockchain account book can be parsed into a process definition file, which can be used to set the flow order of business data between various blockchain nodes. For example, the flow order of business A can be set to be executed sequentially by blockchain nodes a, b, and c. For another example, the flow order of business B can be set to be executed first by blockchain node a, and then by blockchain nodes b and c in parallel.
[0060] Figure 3 A flowchart of a target data flow processing method according to an embodiment of the present disclosure is schematically shown.
[0061] like Figure 3 As shown, the method includes operations S301 to S304.
[0062] In operation S301, a service identifier is determined based on target data.
[0063] In operation S302, a first process definition file associated with the business identifier is determined from the second blockchain ledger.
[0064] In operation S303, a first target blockchain node is determined based on the first process definition file; and a second block is generated based on the target data and the first target blockchain node.
[0065] In operation S304, the second block is written into the first blockchain ledger.
[0066] According to an embodiment of the present disclosure, the service identifier may be a unique identifier used to determine the service associated with the target data.
[0067] According to an embodiment of the present disclosure, the first target blockchain node may be one or more blockchain nodes located after the blockchain node in the first process definition file.
[0068] According to an embodiment of the present disclosure, the second block can be generated by packaging the target data, and then the second block can be written into the subchain corresponding to the first target blockchain node in the first blockchain ledger. Alternatively, identification information associated with the first target blockchain node can be added to the second block, and then the second block with the identification information added can be written into the first blockchain ledger.
[0069] According to an embodiment of the present disclosure, operation S302 may include the following operations:
[0070] Acquire at least one third block associated with the business identifier from the second blockchain account book; determine a second target block from the at least one third block; and parse the second target block to obtain a first process definition file.
[0071] According to an embodiment of the present disclosure, at least one third block associated with the business identifier can be obtained by determining the process definition file associated with the business identifier in the second blockchain account book, that is, the process definition file in each third block is characterized as a current process definition file or a historical process definition file of the business indicated by the business identifier.
[0072] According to an embodiment of the present disclosure, the first process definition file may refer to the process definition file on which consensus is reached most recently among multiple process definition files associated with the service identifier.
[0073] According to an embodiment of the present disclosure, since a newly added block in a blockchain ledger is usually located at the end of the blockchain ledger, determining the second target block from at least one third block may include the following operations:
[0074] A third block located at the end of the second blockchain ledger among the at least one third block is determined as a second target block.
[0075] According to an embodiment of the present disclosure, the blockchain node may also be configured with a third smart contract. The third smart contract may be used to implement a consensus mechanism for a new process definition file.
[0076] According to the embodiments of the present disclosure, the distributed storage of all data is realized based on the shared ledger and data synchronization mechanism of the blockchain. During the scheduling process, all participants only need to interact with the local ledger to complete the process of obtaining and submitting data. The blockchain network can automatically synchronize and update the data to the ledgers of other participants, thereby reducing network delays, network transmission errors, etc.
[0077] Figure 4 The flowchart of the process definition file publishing method according to the embodiment of the present disclosure is schematically shown.
[0078] like Figure 4 As shown, the method includes operations S401 to S404.
[0079] In operation S401, in response to receiving a second process definition file, a plurality of second target blockchain nodes associated with the second process definition file are determined.
[0080] In operation S402, a third smart contract is called to initiate a first consensus proposal to multiple second target blockchain nodes.
[0081] In operation S403, when it is determined that the plurality of second target blockchain nodes reach a consensus on the first consensus proposal, the second process definition file is packaged into a third block.
[0082] In operation S404, the third block is written into the second blockchain ledger.
[0083] According to an embodiment of the present disclosure, the second process definition file may have an associated target business. The second process definition file may be uploaded by any business participant related to the target business, or uploaded by any other blockchain node, which is not limited here.
[0084] According to an embodiment of the present disclosure, the multiple second target blockchain nodes may be blockchain nodes configured by multiple business participants related to the target business.
[0085] According to the embodiments of the present disclosure, reaching a consensus on the first consensus proposal may be that all business participants have confirmed the second process definition file. Alternatively, reaching a consensus on the first consensus proposal may also be that a preset proportion of all business participants have confirmed the second process definition file. The preset proportion may be 80%, 90%, etc., and may be set according to the specific application scenario, and is not limited here.
[0086] According to an embodiment of the present disclosure, when the first consensus proposal fails to reach a consensus, feedback information indicating that a consensus has not been reached may be sent to the initiator of the first consensus proposal, i.e., the blockchain node that receives the second process definition file, so that the business participant to which the blockchain node belongs may modify the second process definition file.
[0087] According to the embodiments of the present disclosure, version control of the process definition file is achieved through the multi-party consensus mechanism of the blockchain, so that the release or modification of the process definition file must be carried out after obtaining the consensus of all participants, avoiding unilateral modification and release by a certain participant, and ensuring the normal progress of the entire scheduling process.
[0088] Figure 5A The diagram schematically shows a data processing system of a business participant according to an embodiment of the present disclosure.
[0089] like Figure 5A As shown, the data processing system 500A of each business participant may include a business layer 510 , a call layer 520 , and a blockchain layer 530 .
[0090] The business layer 510 can be a data processing module for business participants. Business participants can use local hardware resources to process business, or they can initiate the publishing process of process definition files, the flow process of data processing, the processing process of receiving tasks, etc. through the calling layer 520.
[0091] The call layer 520 may be used to implement information interaction between the business layer 510 and the blockchain layer 530 .
[0092] The blockchain layer 530 can be used as a blockchain node in the blockchain system. The blockchain layer 530 can implement the publishing process of the process definition file, the flow process of data processing, the processing process of receiving tasks, etc. by calling smart contracts. The configured smart contracts include timed task smart contracts, business flow smart contracts, file publishing smart contracts, etc. By configuring smart contracts to realize business processing, the reliability of data processing can be improved and the complexity of upper-layer applications can be reduced.
[0093] The blockchain layer 530 may include a blockchain ledger, and the blockchain ledgers of each business participant all consistently contain all data information, such as process definition files, process flow information, task information of this node, etc. Since all flow information is stored in the blockchain ledgers of all participants, based on the characteristics of the blockchain network such as data immutability and traceability, all process scheduling processes can be traced.
[0094] Figure 5B A schematic diagram of a blockchain system according to an embodiment of the present disclosure is schematically shown.
[0095] like Figure 5B As shown, the blockchain system 500B may be composed of a blockchain layer 530 of multiple data processing systems 500A.
[0096] According to the embodiment of the present disclosure, when a business participant publishes a process definition file, the business layer 510 may publish the process definition file to the calling layer 520, and then the calling layer 520 publishes the process definition file to the blockchain layer 530, and then the blockchain layer 530 performs a chain operation on the process definition file. The chain operation may include: the blockchain layer 530 initiates a consensus proposal, and all business participants related to the process definition file perform smart contracts to reach a consensus on the process definition file; and after the consensus is reached, the process definition file is packaged into a block, and then the block is placed in the blockchain account book.
[0097] According to the embodiments of the present disclosure, when processing business data, the blockchain layer 530 can respond to triggering a scheduled task, perform a smart contract, and query the local blockchain account book to see if there is business data that needs to be processed locally, that is, the pending business process that is transferred to the blockchain node. When the business data is queried, the blockchain layer 530 can send the business data to the business layer 510 through the call layer 520, and after the business layer 510 processes the business data, the flow processing process is performed.
[0098] According to an embodiment of the present disclosure, when performing a flow processing procedure, the business layer 510 can send the target data generated after processing the business to the blockchain layer 530 through the call layer 520. The blockchain layer 530 can obtain the latest process definition file related to the business from the blockchain account book according to the business indicated by the target data, and determine the next blockchain node to be transferred from the process definition file. After that, the blockchain layer 530 can package the information of the next blockchain node and the target data into a block, and put the block into the blockchain account book.
[0099] According to the embodiments of the present disclosure, when a block is placed in the blockchain ledger of any blockchain layer 530, a smart contract can be executed to perform data synchronization operations of the blockchain ledgers of the blockchain layer 530 of each business participant. Specifically, the following operations may be included:
[0100] For each blockchain node, while writing the third target block into the first blockchain ledger or the second blockchain ledger of the blockchain node, a second consensus proposal is initiated to other blockchain nodes of the blockchain system; and, after determining that other blockchain nodes have reached a consensus on the second consensus proposal, the third target block is written into the first blockchain ledger or the second blockchain ledger of other blockchain nodes of the blockchain system.
[0101] According to the embodiments of the present disclosure, by adding the blockchain layer in the data processing system of the business participant as a blockchain node to the blockchain system, the changed data can be synchronously updated to the blockchain ledger of each business participant by relying on the reliable data synchronization mechanism of the blockchain network. All business participants only need to interact with the local blockchain ledger, thereby reducing network latency, network transmission errors, etc.
[0102] Figure 6 The block diagram schematically shows a data processing device implemented based on a blockchain system according to an embodiment of the present disclosure.
[0103] like Figure 6 As shown, the data processing device 600 implemented based on the blockchain system includes a query module 610, a first processing module 620 and a second processing module 630.
[0104] The query module 610 is used to call the first smart contract for each blockchain node in the blockchain system in response to triggering a scheduled task to query the first blockchain ledger to obtain at least one first block associated with the blockchain node.
[0105] The first processing module 620 is configured to parse and process the first target block to obtain target data when it is determined that the first target block exists in the at least one first block.
[0106] The second processing module 630 is used to call the second smart contract to perform flow processing on the target data.
[0107] According to the embodiments of the present disclosure, because a blockchain system is used to realize the flow control of data processing, each blockchain node can check whether there is a first target block in the first block associated with the blockchain node in the first blockchain account book stored locally by calling the first smart contract, and if it is determined that the first target block exists, parse and process the first target block to obtain the target data, and realize the flow processing of the target data by calling the second smart contract. Through the above technical means, the single point problem existing in the process processing framework of the related technology is at least partially overcome, and the problem that the failure of the centralized node will cause the process processing framework to be unavailable is avoided, and the stability of data processing is effectively improved.
[0108] According to an embodiment of the present disclosure, a blockchain system includes multiple blockchain nodes, and the blockchain nodes are configured with a first blockchain ledger, a first smart contract, and a second smart contract.
[0109] According to an embodiment of the present disclosure, the blockchain node is also configured with a second blockchain ledger.
[0110] According to an embodiment of the present disclosure, the second processing module 630 includes a first processing submodule, a second processing submodule, a third processing submodule, a fourth processing submodule and a fifth processing submodule.
[0111] The first processing submodule is used to determine the service identifier based on the target data.
[0112] The second processing submodule is used to determine a first process definition file associated with the business identifier from the second blockchain account book.
[0113] The third processing submodule is used to determine the first target blockchain node based on the first process definition file.
[0114] The fourth processing submodule is used to generate a second block based on the target data and the first target blockchain node.
[0115] The fifth processing submodule is used to write the second block into the first blockchain account book.
[0116] According to an embodiment of the present disclosure, the second processing submodule includes a first processing unit, a second processing unit and a third processing unit.
[0117] The first processing unit is used to obtain at least one third block associated with the business identifier from the second blockchain account book.
[0118] The second processing unit is configured to determine a second target block from at least one third block.
[0119] The third processing unit is used to parse the second target block to obtain the first process definition file.
[0120] According to an embodiment of the present disclosure, the second processing unit includes a processing sub-unit.
[0121] The processing subunit is used to determine a third block located at the end of the second blockchain ledger among the at least one third block as a second target block.
[0122] According to an embodiment of the present disclosure, the blockchain node is also configured with a third smart contract.
[0123] According to an embodiment of the present disclosure, the data processing device 600 further includes a first determination module, a first consensus module, a packaging module and a first writing module.
[0124] The first determination module is used to determine a plurality of second target blockchain nodes associated with the second process definition file in response to receiving the second process definition file.
[0125] The first consensus module is used to call the third smart contract to initiate a first consensus proposal to multiple second target blockchain nodes.
[0126] The packaging module is used to package the second process definition file into a third block when it is determined that multiple second target blockchain nodes reach a consensus on the first consensus proposal.
[0127] The first writing module is used to write the third block into the second blockchain ledger.
[0128] According to an embodiment of the present disclosure, the first block is configured with a processing status identifier.
[0129] According to an embodiment of the present disclosure, the data processing device 600 further includes a second determining module.
[0130] The second determining module is configured to determine that there is a first target block in the at least one first block when it is determined that there is a first block in the at least one first block whose processing status is indicated as unprocessed.
[0131] According to an embodiment of the present disclosure, the data processing device 600 further includes a second consensus module and a second writing module.
[0132] The second consensus module is used to initiate a second consensus proposal to other blockchain nodes of the blockchain system for each blockchain node when writing a third target block into the first blockchain ledger or the second blockchain ledger of the blockchain node.
[0133] The second writing module is used to write the third target block into the first blockchain ledger or the second blockchain ledger of other blockchain nodes of the blockchain system when it is determined that other blockchain nodes have reached a consensus on the second consensus proposal.
[0134] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0135] For example, any multiple of the query module 610, the first processing module 620 and the second processing module 630 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the query module 610, the first processing module 620 and the second processing module 630 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the query module 610 , the first processing module 620 , and the second processing module 630 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
[0136] It should be noted that the data processing device part based on the blockchain system in the embodiments of the present disclosure corresponds to the data processing method part based on the blockchain system in the embodiments of the present disclosure. The description of the data processing device part based on the blockchain system specifically refers to the data processing method part based on the blockchain system, which will not be repeated here.
[0137] Figure 7 A block diagram of an electronic device suitable for implementing a data processing method based on a blockchain system according to an embodiment of the present disclosure is schematically shown. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0138] like Figure 7As shown, the computer electronic device 700 according to the embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include an onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.
[0139] In RAM 703, various programs and data required for the operation of electronic device 700 are stored. Processor 701, ROM 702 and RAM 703 are connected to each other via bus 704. Processor 701 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 702 and / or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0140] According to an embodiment of the present disclosure, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to the bus 704. The electronic device 700 may further include one or more of the following components connected to the I / O interface 705: an input portion 706 including a keyboard, a mouse, etc.; an output portion 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 708 including a hard disk, etc.; and a communication portion 709 including a network interface card such as a LAN card, a modem, etc. The communication portion 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage portion 708 as needed.
[0141] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0142] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0143] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0144] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 702 and / or the RAM 703 described above and / or one or more memories other than the ROM 702 and the RAM 703 .
[0145] The embodiments of the present disclosure also include a computer program product, which includes a computer program, which contains a program code for executing the method provided by the embodiments of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the data processing method based on the blockchain system provided by the embodiments of the present disclosure.
[0146] When the computer program is executed by the processor 701, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0147] In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and downloaded and installed through the communication part 709, and / or installed from a removable medium 711. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0148] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0149] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0150] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A data processing method based on a blockchain system, wherein the blockchain system includes a plurality of blockchain nodes, wherein the blockchain nodes are configured with a first blockchain ledger, a second blockchain ledger, a first smart contract, and a second smart contract, wherein the method includes: For each of the blockchain nodes in the blockchain system, in response to triggering a scheduled task, calling the first smart contract to query the first blockchain ledger to obtain at least one first block associated with the blockchain node; When it is determined that a first target block exists in at least one of the first blocks, parsing and processing the first target block to obtain target data; Based on the target data, determining a service identifier; Determine a first process definition file associated with the business identifier from the second blockchain ledger; Based on the first process definition file, determine a first target blockchain node; Generate a second block based on the target data and the first target blockchain node; as well as Writing the second block into the first blockchain ledger.
2. The method according to claim 1, wherein: The determining, from the second blockchain account book, a first process definition file associated with the business identifier includes: Obtaining at least one third block associated with the business identifier from the second blockchain ledger; Determine a second target block from at least one of the third blocks; and The second target block is parsed to obtain the first process definition file.
3. The method according to claim 2, wherein: The determining of the second target block from at least one of the third blocks comprises: The third block located at the end of the second blockchain ledger among at least one of the third blocks is determined as the second target block.
4. The method according to claim 2, wherein: The blockchain node is also configured with a third smart contract; The method further comprises: In response to receiving a second process definition file, determining a plurality of second target blockchain nodes associated with the second process definition file; Calling a third smart contract to initiate a first consensus proposal to a plurality of the second target blockchain nodes; When it is determined that a plurality of the second target blockchain nodes reach a consensus on the first consensus proposal, packaging the second process definition file into the third block; and Writing the third block into the second blockchain ledger.
5. The method according to claim 1, wherein: The first block is configured with a processing status identifier; The method further comprises: When it is determined that at least one of the first blocks includes the first block whose processing status is indicated as unprocessed, it is determined that at least one of the first blocks includes the first target block.
6. The method according to any one of claims 1 to 5, further comprising: For each of the blockchain nodes, initiating a second consensus proposal to other blockchain nodes of the blockchain system while writing a third target block into the first blockchain ledger or the second blockchain ledger of the blockchain node; as well as When it is determined that the other blockchain nodes reach a consensus on the second consensus proposal, the third target block is written into the first blockchain ledger or the second blockchain ledger of the other blockchain nodes of the blockchain system.
7. A data processing device implemented based on a blockchain system, wherein the blockchain system includes a plurality of blockchain nodes, wherein the blockchain nodes are configured with a first blockchain ledger, a second blockchain ledger, a first smart contract, and a second smart contract, wherein the device includes: A query module, configured to, for each of the blockchain nodes in the blockchain system, call the first smart contract in response to triggering a scheduled task, so as to query the first blockchain ledger and obtain at least one first block associated with the blockchain node; A first processing module, configured to parse and process the first target block to obtain target data when it is determined that a first target block exists in at least one of the first blocks; A first processing submodule, configured to determine a service identifier based on the target data; A second processing submodule, configured to determine a first process definition file associated with the business identifier from the second blockchain account book; A third processing submodule, configured to determine a first target blockchain node based on the first process definition file; a fourth processing submodule, configured to generate a second block based on the target data and the first target blockchain node; as well as The fifth processing submodule is used to write the second block into the first blockchain account book.
8. An electronic device, comprising: one or more processors; a memory for storing one or more instructions, Wherein, when the one or more instructions are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having executable instructions stored thereon, wherein when the executable instructions are executed by a processor, the processor is enabled to implement the method according to any one of claims 1 to 6.
10. A computer program product, comprising computer executable instructions, which are used to implement the method of any one of claims 1 to 6 when executed.
Citation Information
Patent Citations
Block chain data processing method and apparatus
CN107807991A
