A data processing method, device and storage medium based on blockchain network
By using collaboration contracts and permission configuration information in the blockchain network, the problems of poor security and lack of permission management in the existing technology are solved, and safe and efficient data sharing and collaboration tasks are achieved.
Patent Information
- Application Number
- CN202110955601.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-19
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-08-19
AI Technical Summary
The existing model for data sharing with blockchain has problems such as poor security and lack of differentiated management capabilities for data operation permissions.
By using collaboration contracts in the blockchain network, a collaboration data packet containing task identification, encrypted task data and permission configuration information is generated and written to the blockchain to achieve differentiated management of data operation permissions.
It realizes the security and efficiency of data sharing, ensures data tamper-proof and traceability, and can quickly complete collaborative tasks.
Smart Images

Figure CN115714656B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device and storage medium based on a blockchain network. Background Art
[0002] Blockchain is a technology system jointly maintained by multiple parties, storing data in a block chain structure, using cryptography to ensure transmission and access security, and achieving consistent data storage, non-tampering, and non-repudiation. In the existing data sharing models using blockchain, the common practice is to directly share each data among multiple participants, which has poor security, no mandatory regulations and constraints on the process of sharing data and the format of data, and lacks differentiated management capabilities for data operation permissions. It can be seen that how to provide a safe and efficient data sharing solution has become an urgent problem to be solved. Summary of the invention
[0003] The embodiments of the present application provide a data processing method, device and storage medium based on a blockchain network, which can realize data sharing safely and efficiently and complete collaborative tasks quickly.
[0004] In a first aspect, an embodiment of the present application provides a data processing method based on a blockchain network, which is applied to a first collaboration device, and the method includes:
[0005] Obtain the first task data and task identifier of the target collaborative task.
[0006] A first collaborative data packet is generated based on the first task data and task identifier of the target collaborative task, wherein the first collaborative data packet includes the task identifier, encrypted first task data and permission configuration information, and the permission configuration information is used to indicate the operation authority of at least one second collaborative device over the first task data.
[0007] A call request for a collaboration contract is sent to a node device of a blockchain network, wherein the call request carries the first collaboration data packet, and the call request is used to instruct the node device to write the first collaboration data packet into the blockchain by calling the collaboration contract, and send a collaboration request to each second collaboration device.
[0008] In a first aspect, an embodiment of the present application provides a data processing method based on a blockchain network, which is applied to a node device of the blockchain network, and the method includes:
[0009] Receive a call request for a collaborative contract sent by a first collaborative device, the call request including a first collaborative data packet, the first collaborative data packet including a task identifier of a target collaborative task, encrypted first task data and permission configuration information, the permission configuration information being used to indicate the operating authority of at least one second collaborative device over the first task data.
[0010] In response to the call request, the collaboration contract is called to write the first collaboration data packet into the blockchain.
[0011] A collaboration request is sent to each second collaboration device, where the collaboration request carries a task identifier of the target collaboration task, and the task identifier is used by each second collaboration device to obtain the first collaboration data packet from the node device.
[0012] In a third aspect, an embodiment of the present application provides a data processing device, the device comprising:
[0013] The acquisition module is used to acquire the first task data and task identifier of the target collaborative task.
[0014] A processing module is used to generate a first collaborative data packet based on the first task data and task identifier of the target collaborative task, wherein the first collaborative data packet includes the task identifier, encrypted first task data and permission configuration information, and the permission configuration information is used to indicate the operation authority of at least one second collaborative device over the first task data.
[0015] A sending module is used to send a call request of a collaboration contract to a node device of a blockchain network, wherein the call request carries the first collaboration data packet, and the call request is used to instruct the node device to write the first collaboration data packet into the blockchain by calling the collaboration contract, and send a collaboration request to each second collaboration device.
[0016] In a fourth aspect, an embodiment of the present application provides a data processing device, the device comprising:
[0017] A receiving module is used to receive a call request for a collaborative contract sent by a first collaborative device, wherein the call request includes a first collaborative data packet, wherein the first collaborative data packet includes a task identifier of a target collaborative task, encrypted first task data and permission configuration information, and the permission configuration information is used to indicate the operation authority of at least one second collaborative device over the first task data.
[0018] The processing module is used to call the collaboration contract in response to the call request to write the first collaboration data packet into the blockchain.
[0019] The sending module is used to send a collaboration request to each second collaboration device, wherein the collaboration request carries a task identifier of the target collaboration task, and the task identifier is used by each second collaboration device to obtain the first collaboration data packet from the node device.
[0020] In a fifth aspect, an embodiment of the present application provides a computer device, comprising a processor, a network interface and a storage device, wherein the processor, the network interface and the storage device are interconnected, wherein the network interface is controlled by the processor for sending and receiving data, the storage device is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the data processing method based on the blockchain network described in the first aspect.
[0021] In the sixth aspect, an embodiment of the present application provides a computer device, comprising a processor, a network interface and a storage device, wherein the processor, the network interface and the storage device are interconnected, wherein the network interface is controlled by the processor for sending and receiving data, the storage device is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the data processing method based on the blockchain network described in the second aspect.
[0022] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and the program instructions are executed by a processor to execute the data processing method based on the blockchain network described in the first aspect.
[0023] In the eighth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and the program instructions are executed by a processor to execute the data processing method based on the blockchain network described in the second aspect.
[0024] In the ninth aspect, the embodiment of the present application provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the data processing method based on the blockchain network described in the first aspect.
[0025] In the tenth aspect, the embodiment of the present application provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the data processing method based on the blockchain network described in the second aspect.
[0026] In an embodiment of the present application, after obtaining the first task data and task identifier of the target collaborative task, the first collaborative device can generate a first collaborative data packet based on the first task data and task identifier of the target collaborative task, the first collaborative data packet including the encrypted first task data and permission configuration information of at least one second collaborative device's operation permissions on the first task data, and send a call request for the collaborative contract to the node device of the blockchain network, the call request carries the first collaborative data packet to instruct the node device to write the first collaborative data packet into the blockchain by calling the collaborative contract, and send a collaborative request to each second collaborative device, thereby making use of the blockchain's data tamper-proof and traceable capabilities to achieve data sharing safely and efficiently and quickly complete collaborative tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0028] Figure 1a It is a schematic diagram of the architecture of a data processing system provided in an embodiment of the present application;
[0029] Figure 1b This is a schematic diagram of the structure of a blockchain provided by an embodiment of the present application;
[0030] Figure 1c It is a schematic diagram of a process of generating a new block provided by an embodiment of the present application;
[0031] Figure 2 It is a flowchart of a data processing method provided in an embodiment of the present application;
[0032] Figure 3 It is a flowchart of another data processing method provided in an embodiment of the present application;
[0033] Figure 4 It is a flowchart of another data processing method provided in an embodiment of the present application;
[0034] Figure 5 It is a flowchart of another data processing method provided in an embodiment of the present application;
[0035] Figure 6 It is a flowchart of another data processing method provided in an embodiment of the present application;
[0036] Figure 7 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0037] Figure 8 is a structural schematic diagram of another data processing device provided in an embodiment of the present application;
[0038] Fig. 9 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0040] See also Figure 1a , is a schematic diagram of the architecture of a data processing system provided in an embodiment of the present application, the data processing system includes a blockchain network 10 and a plurality of collaborative devices 20, wherein:
[0041] The blockchain network 10 refers to a network for sharing data between nodes, and the blockchain network may include multiple nodes 101. Each node 101 can receive input information when performing normal work, and maintain the shared data (i.e., blockchain) in the blockchain network based on the received input information. In order to ensure the information intercommunication within the blockchain network, there can be an information connection between each node, and peer-to-peer (P2P) communication can be achieved between any two nodes, and P2P communication can be performed specifically through a wired communication link or a wireless communication link. For example, when any node in the blockchain network receives input information, other nodes obtain the input information according to the consensus algorithm, and store the input information as data in the shared data, so that the data stored on all nodes in the blockchain network are consistent.
[0042] The collaboration device 20 can access the blockchain network and communicate with nodes in the blockchain network, for example, submit data (such as a created collaboration data packet) to a node, query data from a node, etc. The collaboration device 20 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a vehicle-mounted smart terminal, etc., which is not limited in the embodiments of the present application.
[0043] It should be noted that Figure 1a The number of nodes shown in is only for illustration, and any number of nodes may be deployed according to actual needs.
[0044] Among them, for each node in the blockchain network, there is a node identifier corresponding to it, and each node in the blockchain network can store the node identifiers of other nodes in the blockchain network, so that the generated blocks can be broadcast to other nodes in the blockchain network according to the node identifiers of other nodes. Each node can maintain a node identifier list as shown in the following table, and the node name and node identifier are stored in the node identifier list accordingly. Among them, the node identifier can be an Internet Protocol (IP) address and any other information that can be used to identify the node. The table only uses the IP address as an example for illustration.
[0045] Node Name Node ID Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258
[0046] Each node in the blockchain network stores the same blockchain. The blockchain consists of multiple blocks, see Figure 1b The blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores the input information characteristic value, version number, timestamp and difficulty value, and the block body stores the input information; the next block of the genesis block takes the genesis block as the parent block, and the next block also includes a block header and a block body. The block header stores the input information characteristic value of the current block, the block header characteristic value, version number, timestamp and difficulty value of the parent block, and so on, so that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the input information in the block.
[0047] Among them, when generating each block in the blockchain, see Figure 1c When the node where the blockchain is located receives the input information, it verifies the input information. After the verification is completed, the input information is stored in the memory pool and the hash tree used to record the input information is updated. After that, the update timestamp is updated to the time when the input information is received, and different random numbers are tried to calculate the eigenvalue multiple times so that the calculated eigenvalue can satisfy the following formula:
[0048] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x)) <TARGET
[0049] Among them, SHA256 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, which can be determined based on nbits.
[0050] In this way, when the random number that satisfies the above formula is calculated, the information can be stored accordingly, the block header and block body can be generated, and the current block can be obtained. Subsequently, the node where the blockchain is located sends the newly generated block to other nodes in the blockchain network according to the node identification of other nodes in the blockchain network. Other nodes verify the newly generated block and add the newly generated block to the blockchain stored in them after the verification is completed.
[0051] Among them, smart contracts can be run on the nodes of the blockchain network. Smart contracts are code implementations that are executed when certain conditions are met. Developers can define the contract logic through programming languages and publish it to the blockchain (smart contract registration). According to the logic of the contract terms, they call keys or other events to trigger execution and complete the contract logic. At the same time, it also provides the function of upgrading and canceling smart contracts.
[0052] In some feasible implementations, a certain collaborative device 20 (which may be recorded as a first collaborative device) may obtain the first task data and task identifier of a target collaborative task, wherein the target collaborative task may refer to a specific business processing procedure; the task identifier may uniquely indicate the target collaborative business, and the task identifier may be used to distinguish different collaborative tasks; the first task data may refer to the data that needs to be processed by the next task flow of the target collaborative task. Then, the collaborative device 20 may generate a first collaborative data packet based on the first task data and task identifier of the target collaborative task, wherein the first collaborative data packet includes a task identifier, encrypted first task data, and permission configuration information, wherein the permission configuration information is used to indicate the operation authority of at least one second collaborative device over the first task data, and the second collaborative device is a device used to process the next task flow, which may be Figure 1aAny one or more collaborative devices except the first collaborative device. The collaborative device 20 sends a call request for a collaborative contract to a node 101 of the blockchain network, wherein the collaborative contract can specifically be a smart contract running on each node 101, and the call request carries the first collaborative data packet. The node 101 can write the first collaborative data packet into the blockchain by calling the collaborative contract, and send a collaborative request to each second collaborative device, so that the second collaborative device can execute the next task process mentioned above, that is, obtain the first collaborative data packet from the blockchain, and process the first task data therein accordingly, so that data sharing can be realized safely and efficiently, and the collaborative task can be completed quickly.
[0053] In some feasible implementations, the data processing system may further include a contract issuing device ( Figure 1a The contract issuing device may be Figure 1a Any one of the multiple collaborative devices 20 may also be other devices. The contract issuing device may issue a collaborative contract and collaborative device registration information to the node 101 of the blockchain network. The collaborative contract may run on each node 101, and the node 101 may write the collaborative device registration information into the blockchain. The collaborative device registration information includes the identifiers of all participants of the target collaborative service.
[0054] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0055] See also Figure 2 , is the embodiment of this application based on Figure 1a The data processing system shown in FIG. 1 is a flow chart of a data processing method provided by the data processing system. The data processing method of the embodiment of the present application is mainly described from the side of a certain collaborative device (such as a first collaborative device). The data processing method includes the following steps:
[0056] 201. Obtain first task data and a task identifier of a target collaborative task.
[0057] Among them, the target collaborative task may refer to a specific business processing process, which may include multiple task flows, which are jointly completed by multiple collaborative parties. Each task flow specifically requires the corresponding collaborative party to complete. For example, the target collaborative task may include the business of issuing electronic invoices, bill reimbursement, export tax rebate, etc.; the task identifier can uniquely indicate the target collaborative business, and the task identifier is used to distinguish different collaborative tasks; the first task data may refer to the data that needs to be processed by the next task flow of the target collaborative task. The first collaborative device corresponds to a participant (or collaborative party) of the target collaborative task. The first collaborative device may refer to the device responsible for initiating the target collaborative task, or it may refer to the device responsible for processing the current task flow of the target collaborative task. The current task flow may be any task flow included in the target collaborative business.
[0058] It should be noted that the node device can also be used as a collaborative device, which is not limited in the embodiments of the present application.
[0059] Specifically, the first collaborative device can directly specify the first task data and the task identifier of the target collaborative task, or obtain the first task data and the task identifier of the target collaborative task uploaded by other collaborative devices from the node device of the blockchain network.
[0060] 202. Generate a first collaborative data packet based on the first task data and task identifier of the target collaborative task, wherein the first collaborative data packet includes the task identifier, encrypted first task data and permission configuration information, and the permission configuration information is used to indicate the operation authority of at least one second collaborative device over the first task data.
[0061] Specifically, the first collaborative device can encapsulate the first task data and task identifier of the target collaborative task according to a predefined data structure to generate a corresponding collaborative data packet (recorded as the first collaborative data packet), wherein the first collaborative data packet, in addition to including the task identifier of the target collaborative task and the encrypted first task data, can also include permission configuration information of at least one collaborative device that processes the first task data in the next task flow. The collaborative device can be recorded as the second collaborative device, and the permission configuration information indicates the operation permissions of each second collaborative device on the first task data. The operation permissions may include read permissions and write permissions, thereby using a unified data structure to indicate the participants of the next link and the permission information of each participant, which can ensure that there are mandatory regulations and constraints on the process of sharing data and the format of the data, realize the differentiated management capabilities of different participants for data operation permissions, and realize that the data processed in different links are only open to the read and write permissions of the participants corresponding to the link, thereby avoiding the direct sharing of data from different links among all participants.
[0062] 203. Send a call request for the collaboration contract to a node device of the blockchain network, wherein the call request carries the first collaboration data packet, and the call request is used to instruct the node device to write the first collaboration data packet into the blockchain by calling the collaboration contract, and send a collaboration request to each second collaboration device.
[0063] Specifically, after organizing the first collaborative data packet, the first collaborative device can initiate a call request for the collaborative contract to the node device of the blockchain network, and carry the first collaborative data packet in the call request to trigger the start of the target collaborative task or the target collaborative task to enter the next task process. The node device writes the first collaborative data packet to the blockchain by calling the collaborative contract, and sends a collaborative request to each second collaborative device, so that the second collaborative device can execute the above-mentioned next task process, that is, obtain the first collaborative data packet from the blockchain and perform corresponding processing on the first task data therein.
[0064] It is understandable that if the task process of the target collaborative task has not yet ended, the second collaborative device can determine the participants of the next task process after correspondingly processing the first task data, and use the processed data to create a new collaborative data packet, and submit it to the node device of the blockchain network for chaining.
[0065] In some feasible implementations, blockchain can be used to manage data operation permissions of different participants in a differentiated manner, and to effectively supervise the execution process of collaborative tasks.
[0066] In the specific implementation, the operation permissions of all collaborative devices participating in a collaborative task on the task data can be indicated in the collaborative data packet, so that during the execution of the collaborative task, each collaborative device can accurately obtain the data processing results of the collaborative device that processes each task flow from the blockchain, thereby realizing effective supervision of the execution process of the collaborative task by all participants. For example, for a target collaborative task, the collaborative device that processes the next task flow of the target collaborative task is recorded as a second collaborative device, and the collaborative devices other than the second collaborative device among all the collaborative devices participating in the target collaborative task are recorded as third collaborative devices, and the third collaborative device is also a collaborative device that processes other task flows of the target collaborative task; wherein, the other task flows may include unexecuted task flows in the target collaborative task that are located after the next task flow, or, the other task flows may also include all executed task flows and all unexecuted task flows in the target collaborative task except the next task flow; for the above-mentioned first task data, the first collaborative device may indicate the operation permissions of each second collaborative device on the first task data, and the operation permissions of each third collaborative device on the first task data in the permission configuration information of the collaborative data packet. After the node device writes the collaborative data packet into the blockchain, it may provide read service or write service of the first task data to each collaborative device participating in the target collaborative task according to the permission configuration information in the collaborative data packet. Specifically, the second collaborative device's operating permissions for the first task data may include read permissions and write permissions to ensure that the second collaborative device processes the next task flow of the target collaborative task normally. The third collaborative device's operating permissions for the first task data may only include read permissions to ensure that participants in other links of the target collaborative task can read task data from the blockchain, thereby supervising the data during the task execution process, thereby utilizing a unified data structure to indicate the permission information of participants in each link of the target collaborative task, thereby achieving differentiated management capabilities of different participants over data operating permissions, and achieving effective supervision of the execution process of the collaborative task by participants in each link.
[0067] In an embodiment of the present application, after obtaining the first task data and task identifier of the target collaborative task, the first collaborative device can generate a first collaborative data packet based on the first task data and task identifier of the target collaborative task, the first collaborative data packet including the encrypted first task data and permission configuration information of at least one second collaborative device's operation permissions on the first task data, and send a call request for the collaborative contract to the node device of the blockchain network, the call request carries the first collaborative data packet, and can instruct the node device to write the first collaborative data packet into the blockchain by calling the collaborative contract, and send a collaborative request to each second collaborative device, thereby making use of the blockchain's data tamper-proof and traceable capabilities to achieve data sharing safely and efficiently, and can be used to quickly complete collaborative tasks in various scenarios.
[0068] See also Figure 3 , is the embodiment of this application based on Figure 1a The data processing system shown in FIG. 1 is a flow chart of another data processing method provided by the data processing system. The data processing method of the embodiment of the present application is mainly described from the side of a certain collaborative device (such as a first collaborative device). The data processing method includes the following steps:
[0069] 301. Obtain first task data and a task identifier of a target collaborative task.
[0070] Specifically, when the first collaborative device is the device responsible for initiating the target collaborative task, the first collaborative device can determine the initial task data of the target collaborative task. The initial task data can be, for example, a consumption record of a user to be invoiced. The initial task data is used as the first task data of the target collaborative task, and a task identifier of the target collaborative task is generated; when the first collaborative device is responsible for processing the current task flow of the target collaborative task, the first collaborative device can receive a collaborative request sent by a node device of the blockchain network, the collaborative request carries the task identifier of the target collaborative task, and can respond to the collaborative request by sending a data query request to the node device, the data query request carries the task identifier of the target collaborative task, the node device can query the second collaborative data packet stored in the blockchain, the second collaborative data packet can be generated by other collaborative devices according to a predefined data structure after processing the previous task flow of the current task flow, the first collaborative device receives the second collaborative data packet sent by the node device, the second collaborative data packet includes the encrypted second task data of the target collaborative task, the second task data refers to the data that needs to be processed by the current task flow of the target collaborative task, and the first collaborative device processes the encrypted second task data to obtain the first task data of the target collaborative task.
[0071] In some feasible implementations, the second collaborative data packet may also include a compression algorithm type and an encryption algorithm type for the second task data. The first collaborative device may use the compression algorithm type and the encryption algorithm type for the second task data to decrypt the encrypted second task data to obtain the second task data, and then perform business processing on the second task data corresponding to the current task flow of the target collaborative task to obtain the first task data of the target collaborative task.
[0072] 302. Obtain the next task flow of the target collaborative task.
[0073] Specifically, if the first collaborative device is the device responsible for initiating the target collaborative task, the first collaborative device may use the first task flow of the target collaborative task as the above-mentioned next task flow; if the first collaborative device is the device responsible for processing the current task flow of the target collaborative task, the first collaborative device may determine the next task flow according to the execution order between the task flows included in the target collaborative task, or the first collaborative device may also flexibly specify the next task flow of the target collaborative task according to actual business needs.
[0074] 303. Determine at least one second collaboration device for processing the next task flow and the operation authority of each second collaboration device on the first task data.
[0075] Specifically, the first collaborative device can flexibly specify the collaborative device (referred to as the second collaborative device) used to process the next task flow, and the number of second collaborative devices can be one or more. If there are multiple second collaborative devices, the next task flow can be completed by multiple second collaborative devices in collaboration, or by multiple second collaborative devices in a competitive manner, that is, only one second collaborative device's processing result is valid. In addition, the first collaborative device can also specify the operating authority of each second collaborative device over the first task data.
[0076] 304. Generate permission configuration information according to the operation permission of each second collaborative device on the first task data, where the permission configuration information includes an identifier of each second collaborative device and the operation permission of each second collaborative device on the first task data.
[0077] Specifically, the first collaborative device may generate permission configuration information according to the configured operating permissions of each second collaborative device on the first task data. The permission configuration information may at least include an identifier of each second collaborative device and specific operating permissions of each second collaborative device on the first task data.
[0078] In some feasible implementations, the permission configuration information may include a data visible party list and a data writable party list, wherein the visible party list includes the identification of the collaborative device in the at least one second collaborative device that has the read permission to the first task data, and the data writable party list includes the identification of the collaborative device in the at least one second collaborative device that has the write permission to the first task data. The data visible party list and the data writable party list can be used to accurately indicate the data operation permission of each participant in each task process, thereby realizing differentiated management capabilities of different participants for data operation permissions.
[0079] 305. Generate a first collaboration data packet using the first task data, the task identifier and the authority configuration information according to a predefined data structure.
[0080] The predefined data structure is used to impose mandatory regulations and constraints on the process and data format of shared data, so as to achieve standardized management of data sharing. The predefined data structure may include multiple fields, such as task identification, authority configuration information, collaboration data, compression algorithm, encryption algorithm, and may further include data version number, digital envelope, etc. The field type and field description of each field may be shown in Table 1 below.
[0081]
[0082] Table 1 Predefined data structure
[0083] Specifically, the first collaborative device can compress and encrypt the first task data according to the compression algorithm type and encryption algorithm type corresponding to the first task data to obtain the encrypted first task data, and can use the public key of each second collaborative device to encrypt the symmetric key of the encrypted first task data to obtain a digital envelope, and then generate a first collaborative data packet according to the above-mentioned predefined data structure using the digital envelope, task identifier, compression algorithm type, encryption algorithm type and permission configuration information.
[0084] 306. Send a call request for the collaboration contract to a node device of the blockchain network, wherein the call request carries the first collaboration data packet, and the call request is used to instruct the node device to write the first collaboration data packet into the blockchain by calling the collaboration contract, and send a collaboration request to each second collaboration device.
[0085] The specific implementation of step 306 can refer to the relevant description of step 203 in the above embodiment, which will not be repeated here.
[0086] In an embodiment of the present application, a first collaborative device can obtain a next task flow of a target collaborative task, determine at least one second collaborative device for processing the next task flow and the operating authority of each second collaborative device on the first task data, generate authority configuration information based on the operating authority of each second collaborative device on the first task data, the authority configuration information includes an identifier of each second collaborative device and the operating authority of each second collaborative device on the first task data, generate a first collaborative data packet using the first task data, task identifier and authority configuration information according to a predefined collaborative data structure, and send a call request for a collaborative contract to a node device of the blockchain network, the call request carries the first collaborative data packet, and can instruct the node device to write the first collaborative data packet into the blockchain by calling the collaborative contract, and send a collaborative request to each second collaborative device, so that the predefined data structure can be used to make mandatory provisions and constraints on the process and data format of shared data, realize standardized management of data sharing, and have strong versatility. At the same time, with the help of the data tamper-proof and traceable capabilities of the blockchain, data sharing can be realized safely and efficiently, ensuring data security and privacy when information is shared across organizations, and can be used to quickly complete collaborative tasks in various scenarios.
[0087] See also Figure 4 , is the embodiment of this application based on Figure 1a The data processing system shown in FIG. 1 is a flow chart of another data processing method provided by the data processing system. The data processing method of the embodiment of the present application is mainly described from the node device side of the blockchain network. The data processing method includes the following steps:
[0088] 401. Receive a call request for a collaborative contract sent by a first collaborative device, wherein the call request includes a first collaborative data packet, wherein the first collaborative data packet includes a task identifier of a target collaborative task, encrypted first task data, and permission configuration information, wherein the permission configuration information is used to indicate the operation authority of at least one second collaborative device over the first task data.
[0089] Among them, the node device is used to run the collaborative contract and store the data generated in each task process of the target collaborative task in the blockchain, such as the first collaborative data packet generated by the first collaborative device.
[0090] In some feasible implementations, before the target collaborative task is started, the contract issuing device needs to register the information of the relevant participants on the blockchain. For example, the node device can receive the collaborative contract and collaborative device registration information sent by the contract issuing device, and the collaborative device registration information includes the identification of all collaborative devices participating in each task flow of the target collaborative task, and all collaborative devices include the first collaborative device and the second collaborative device mentioned above, and the collaborative device registration information can be written into the blockchain, wherein the identification of the collaborative device can be the public key of the collaborative device, or the blockchain account address generated based on the public key, etc.
[0091] 402. In response to the call request, the collaboration contract is called to write the first collaboration data packet into the blockchain.
[0092] Specifically, after receiving the first collaborative data packet, a node device can call the collaborative contract to jointly perform consensus verification on the first collaborative data packet with other node devices. If the consensus verification passes, the first collaborative data packet is written into the blockchain.
[0093] In some feasible implementations, the call request also includes a private key signature of the first collaborative device, and the node device obtains the collaborative device registration information stored in the blockchain. If the collaborative device registration information includes the identifier of the first collaborative device, the public key of the first collaborative device is used to verify the private key signature of the first collaborative device. If the verification passes, the collaborative contract is called in response to the call request to write the first collaborative data packet into the blockchain. By verifying the private key signature, the security of data sharing can be improved.
[0094] 403. Send a collaboration request to each second collaboration device, where the collaboration request carries a task identifier of the target collaboration task, and the task identifier is used by each second collaboration device to obtain the first collaboration data packet from the node device.
[0095] Specifically, the node device can send a collaboration request to each participant of the next task flow of the target collaborative task (i.e., each second collaborative device). The collaboration request carries the task identifier of the target collaborative task. Each second collaborative device can use the task identifier to obtain the first collaborative data packet from the node device and perform corresponding business processing.
[0096] In some feasible implementations, the node device may receive a data query request sent by the target collaborative device in response to a collaborative request, the data query request carries a task identifier of the target collaborative task, and the target collaborative device is any one of the at least one second collaborative devices. The node device obtains a first collaborative data packet from the blockchain according to the task identifier of the target collaborative task, and if the target collaborative device is the second collaborative device indicated by the authority configuration information, that is, if the target collaborative device is a participant in the next task flow of the target collaborative task, the node device sends the first collaborative data packet to the target collaborative device.
[0097] In some feasible implementations, as shown in Table 1, the predefined data structure may include a data version number for indicating different data versions of the target collaborative task. For example, the first collaborative data packet also includes the first data version number of the target collaborative task. After the target collaborative device processes the encrypted first task data included in the first collaborative data packet, the target collaborative device may generate a third collaborative data packet according to the processing result. The third collaborative data packet includes the second data version number of the target collaborative task. The second data version number is obtained by adding a preset value to the first data version number of the target collaborative task included in the first collaborative data packet after the target collaborative device obtains the first collaborative data packet. The preset value may be 1, for example. The target collaborative device increases the first data version number by 1 to obtain the second data version number. The node device receives a call request for a collaborative contract sent by a target collaborative device, where the call request includes a third collaborative data packet. If the first data version number differs from the second data version number by a preset value (for example, the preset value is 1), the node device responds to the call request to call the collaborative contract to write the third collaborative data packet into the blockchain. At this time, the latest data version number of the target collaborative task stored in the blockchain becomes the second data version number. If other collaborative devices concurrently update the latest collaborative data packet in the blockchain with the target collaborative device, for example, after the node device writes the third collaborative data packet into the blockchain, the other collaborative devices send a fourth collaborative data packet to the node device, and the fourth collaborative data packet includes the third data version number of the target collaborative task, which is obtained by adding a preset value to the first data version number of the target collaborative task. Since the latest data version number stored in the blockchain at this time is the second data version number, and the second data version number is the same as the third data version number, the second data version number and the third data version number do not differ by a preset value. The node device does not respond to the fourth collaborative data packet sent by other collaborative devices, which can prevent multiple participants from modifying data at the same time and ensure orderly and correct updating of data.
[0098] In some feasible implementations, blockchain can be used to effectively supervise the processing time of each link, and can be used to trace and hold accountable situations such as delayed task execution progress, and can also incentivize collaborative parties with higher task execution efficiency.
[0099] In the specific implementation, the reference processing time of each task flow of the target collaborative task can be set. For example, it can be set by a contract distribution device or a node device. The node device can write the reference processing time of each task flow into the blockchain; the reference processing time can be related to the specific task flow. When the task flow is complex, the corresponding reference processing time can be set longer (such as 5 minutes). When the task flow is simple, the corresponding reference processing time can be set shorter (such as 1 minute).
[0100] The node device can record the time consumed by each collaborative device in processing the corresponding task flow, and compare the consumed time with the corresponding reference processing time. If the consumed time of a certain collaborative device (which can be recorded as the fourth collaborative device) is less than the reference processing time, the node device can reward the collaborative party corresponding to the fourth collaborative device, for example, by transferring an on-chain asset to the blockchain account of the collaborative party corresponding to the fourth collaborative device as a reward; if the consumed time of a certain collaborative device (which can be recorded as the fifth collaborative device) is greater than the reference processing time, and the time difference between the consumed time and the reference processing time exceeds a certain threshold, the node device can mark the fifth collaborative device and the corresponding collaborative party, and write the marking information into the blockchain.
[0101] Among them, the node device can record the first time of sending a collaboration request to the collaboration device and the second time of receiving a collaboration data packet sent by the collaboration device, and determine the time consumed by the collaboration device to process the corresponding task flow based on the first time and the second time.
[0102] Furthermore, the node device can also write the corresponding time consumed by each collaborative device into the blockchain. When receiving a time-consuming query request from the query party for a collaborative device, the node device can read the corresponding time consumed from the blockchain and send it to the query party. The query party can refer to the collaborative device corresponding to the unexecuted task flow of the target collaborative task, or it can refer to the collaborative device corresponding to any task flow of the target collaborative task. This can effectively supervise the processing time of each link, and can also hold the relevant collaborative parties accountable when the task execution progress lags behind.
[0103] In some feasible implementations, during the execution of the target collaborative task, the node device can dynamically adjust the reference processing time of each task process that has not been executed according to the time consumed by each task process that has been executed in the target collaborative task. Specifically, the node device can calculate the reference total time of the target collaborative task according to the reference processing time of each task process of the set target collaborative task. During the execution of the target collaborative task, the node device calculates the total time consumed according to the time consumed by each task process that has been executed in the target collaborative task, and then adjusts the reference processing time of each task process that has not been executed according to the difference between the reference total time and the total time consumed, notifies the corresponding collaborative device of the adjusted reference processing time, and determines whether it is necessary to reward or add a mark to the corresponding collaborative party of the relevant collaborative device according to the adjusted reference processing time, so that the node device can flexibly adjust the reference processing time of each task process that has not been executed according to the actual time consumed by each task process that has been executed, and incentivize or mark it, which can improve the execution efficiency of the collaborative task.
[0104] In an embodiment of the present application, a node device receives a call request for a collaboration contract sent by a first collaboration device, the call request includes a first collaboration data packet, the first collaboration data packet includes a task identifier of a target collaboration task, encrypted first task data and permission configuration information, the permission configuration information is used to indicate the operation authority of at least one second collaboration device over the first task data, and calls the collaboration contract to write the first collaboration data packet into the blockchain, and then sends a collaboration request to each second collaboration device, the collaboration request carries the task identifier of the target collaboration task, and is used for each second collaboration device to obtain the first collaboration data packet from the node device. By leveraging the data tamper-proof and traceable capabilities of the blockchain, data sharing can be achieved safely and efficiently, ensuring data security and privacy when sharing information across organizations, and can be used to quickly complete collaboration tasks in various scenarios.
[0105] See also Figure 5 , is the embodiment of this application based on Figure 1a The data processing system shown in FIG. 1 is a flow chart of another data processing method provided by the data processing system. The data processing method of the embodiment of the present application is mainly described from multiple aspects of the blockchain network, the collaborating party, and the contract issuing party. The data processing method includes the following steps:
[0106] 501. The contract publisher publishes the collaboration contract.
[0107] 502. The contract issuer registers the collaborating party in the blockchain network.
[0108] The collaborating parties may include, for example, collaborating party A, collaborating party B, and the like.
[0109] 503. Collaborator A organizes the collaborative data and determines the collaborator B of the next link.
[0110] Among them, collaborator A can serve as the initiator of the target collaborative task, for example, it can be the first collaborative device mentioned above, and collaborator B can be a participant in the next link (such as the next task process of the target collaborative task), for example, it can be the second collaborative device mentioned above, and collaborator B can be one or more, which is not limited to the embodiments of the present application.
[0111] 504. Collaborating party A initiates a call to the collaboration contract to the blockchain network.
[0112] When calling, the task identifier of the target collaborative task, such as ID: 001, may be carried in the request.
[0113] 505. The blockchain network determines whether the initiator (ie, collaborator A) has been registered.
[0114] 506. If the initiator has registered, the blockchain network checks the signature, executes other contract logic, and completes the consensus of the collaborative data.
[0115] 507. The blockchain network notifies collaborating party A that the blockchain is successfully uploaded.
[0116] 508. The blockchain network notifies collaborator B of a new collaboration request.
[0117] The collaboration request may carry a task identifier of the target collaboration task.
[0118] 509. Collaborator B queries the blockchain network for collaboration data.
[0119] 510. The blockchain network determines whether the caller (i.e., collaborator B) has been registered.
[0120] 511. If the caller is registered, the blockchain network obtains the collaboration data.
[0121] 512. The blockchain network determines whether the collaborator B is the designated participant of the next stage of this collaborative task.
[0122] 513. If it is a designated participant, the blockchain network returns the collaboration data to collaborating party B.
[0123] 514. Collaborating party B decrypts the collaborative data and performs data and business logic processing.
[0124] 515. Collaborator B determines the collaborator for the next link, assembles the collaboration data and uploads it to the chain.
[0125] The specific implementation of steps 501 to 515 may refer to the relevant description in the aforementioned embodiment, which will not be repeated here.
[0126] In some possible implementations, such as Figure 6 As shown, it is a flow chart of another data processing method provided by an embodiment of the present application. Among them, the collaborative task is initiated by the collaborative party A (collaboration step 1), and then the first task flow (collaboration step 2) is processed by the collaborative party B, and then the next task flow (collaboration step 3) is processed by the collaborative party C, ..., until all the task flows of the collaborative task are processed, then this collaborative task is completed. In the processing process of the collaborative task, the collaborative party responsible for processing the corresponding task flow has the read and write permissions to the corresponding collaborative data, and writes the generated collaborative data packet into the blockchain through the node device, and the auditor, as a supervisor, can only have the permission to read the collaborative data generated in each task flow of the collaborative task, thereby realizing the differentiated allocation capability of the data read and write permissions of different participating members, with the data tamper-proof and traceable capabilities of the blockchain, data sharing can be realized safely and efficiently, and can be used to quickly complete collaborative tasks in various scenarios.
[0127] See also Figure 7 , is a schematic diagram of the structure of a data processing device in an embodiment of the present application. The data processing device in an embodiment of the present application can be applied to a collaboration device, such as the first collaboration device mentioned above, and the device includes:
[0128] The acquisition module 701 is used to acquire the first task data and task identifier of the target collaborative task.
[0129] Processing module 702 is used to generate a first collaborative data packet based on the first task data and task identifier of the target collaborative task, wherein the first collaborative data packet includes the task identifier, encrypted first task data and permission configuration information, and the permission configuration information is used to indicate the operation authority of at least one second collaborative device over the first task data.
[0130] The sending module 703 is used to send a call request for the collaboration contract to a node device of the blockchain network, wherein the call request carries the first collaboration data packet, and the call request is used to instruct the node device to write the first collaboration data packet into the blockchain by calling the collaboration contract, and send a collaboration request to each second collaboration device.
[0131] Optionally, the acquisition module 701 is specifically used to:
[0132] Initial task data of a target collaborative task is determined, and the initial task data is used as first task data of the target collaborative task.
[0133] A task identifier of the target collaborative task is generated.
[0134] Optionally, the acquisition module 701 is specifically used to:
[0135] A collaboration request sent by a node device of the blockchain network is received, wherein the collaboration request carries a task identifier of a target collaboration task.
[0136] In response to the collaboration request, a data query request is sent to the node device, where the data query request carries a task identifier of the target collaboration task.
[0137] A second collaboration data packet sent by the node device is received, where the second collaboration data packet includes encrypted second task data of the target collaboration task.
[0138] The encrypted second task data is processed to obtain the first task data of the target collaborative task.
[0139] Optionally, the second collaboration data packet further includes a compression algorithm type and an encryption algorithm type of the second task data. The acquisition module 701 is specifically configured to:
[0140] The encrypted second task data is decrypted using the compression algorithm type and encryption algorithm type of the second task data to obtain the second task data.
[0141] The second task data is subjected to business processing corresponding to the current task flow of the target collaborative task to obtain the first task data of the target collaborative task.
[0142] Optionally, the processing module 702 is specifically configured to:
[0143] Obtain the next task flow of the target collaborative task.
[0144] At least one second collaboration device for processing the next task flow and the operation authority of each second collaboration device on the first task data are determined.
[0145] Permission configuration information is generated according to the operation permission of each second collaboration device on the first task data, and the permission configuration information includes an identifier of each second collaboration device and the operation permission of each second collaboration device on the first task data.
[0146] A first collaboration data packet is generated using the first task data, the task identifier and the authority configuration information according to a predefined data structure.
[0147] Optionally, the processing module 702 is specifically configured to:
[0148] The first task data is processed according to the compression algorithm type and the encryption algorithm type corresponding to the first task data to obtain encrypted first task data.
[0149] The public key of each second cooperative device is used to encrypt the symmetric key of the encrypted first task data to obtain a digital envelope.
[0150] According to a predefined data structure, a first collaborative data packet is generated using the digital envelope, the task identifier, the compression algorithm type, the encryption algorithm type and the authority configuration information.
[0151] Optionally, the permission configuration information includes a data visible party list and a data writable party list, the data visible party list includes the identification of collaborative devices in the at least one second collaborative device that have read permission for the first task data, and the data writable party list includes the identification of collaborative devices in the at least one second collaborative device that have write permission for the first task data.
[0152] It should be noted that the functions of each functional module of the data processing device in the embodiment of the present application can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.
[0153] See also Figure 8 , is a schematic diagram of the structure of another data processing device in an embodiment of the present application. The data processing device in an embodiment of the present application can be applied to a node device of a blockchain network, and the device includes:
[0154] The receiving module 801 is used to receive a call request for a collaborative contract sent by a first collaborative device, wherein the call request includes a first collaborative data packet, wherein the first collaborative data packet includes a task identifier of a target collaborative task, encrypted first task data and permission configuration information, and the permission configuration information is used to indicate the operation authority of at least one second collaborative device over the first task data.
[0155] The processing module 802 is used to call the collaboration contract in response to the call request and write the first collaboration data packet into the blockchain.
[0156] The sending module 803 is used to send a collaboration request to each second collaboration device, where the collaboration request carries a task identifier of the target collaboration task, and the task identifier is used by each second collaboration device to obtain the first collaboration data packet from the node device.
[0157] Optionally, the receiving module 801 is further configured to receive a collaboration contract and collaboration device registration information sent by a contract issuing device, where the collaboration device registration information includes an identifier of the first collaboration device and an identifier of each of the second collaboration devices.
[0158] The processing module 802 is further configured to write the collaboration device registration information into the blockchain.
[0159] Optionally, the call request further includes a private key signature of the first collaboration device, and the apparatus further includes an acquisition module 804, wherein:
[0160] The acquisition module 804 is used to acquire the collaboration device registration information stored in the blockchain.
[0161] The processing module 802 is also used to verify the private key signature of the first collaborative device using the public key of the first collaborative device if the collaborative device registration information includes the identification of the first collaborative device, and if the verification passes, execute the step of calling the collaborative contract in response to the call request to write the first collaborative data packet into the blockchain.
[0162] Optionally, the receiving module 801 is further used to receive a data query request sent by a target collaborative device in response to the collaborative request, wherein the data query request carries a task identifier of the target collaborative task, and the target collaborative device is any one of the at least one second collaborative device.
[0163] The acquisition module 804 is further used to acquire the first collaboration data packet from the blockchain according to the task identifier of the target collaboration task.
[0164] The sending module 803 is further configured to send the first collaboration data packet to the target collaboration device if the target collaboration device is the second collaboration device indicated by the permission configuration information.
[0165] Optionally, the first collaboration data packet also includes a first data version number of the target collaboration task.
[0166] The receiving module 801 is also used to receive a call request for a collaborative contract sent by the target collaborative device, the call request includes a third collaborative data packet, the third collaborative data packet includes a second data version number of the target collaborative task, and the third collaborative data packet is generated by the target collaborative device after processing the encrypted first task data included in the first collaborative data packet.
[0167] The processing module 802 is further configured to, if the first data version number differs from the second data version number by a preset value, respond to the call request to call the collaboration contract to write the third collaboration data packet into the blockchain.
[0168] It should be noted that the functions of each functional module of the data processing device in the embodiment of the present application can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.
[0169] See also Fig. 9 , is a schematic diagram of the structure of a computer device in an embodiment of the present application, wherein the computer device in an embodiment of the present application includes a power supply module and other structures, and includes a processor 901, a storage device 902, and a network interface 903. The processor 901, the storage device 902, and the network interface 903 can exchange data.
[0170] The storage device 902 may include a volatile memory, such as a random-access memory (RAM); the storage device 902 may also include a non-volatile memory, such as a flash memory, a solid-state drive (SSD), etc.; the storage device 902 may also include a combination of the above-mentioned types of memory.
[0171] The processor 901 may be a central processing unit (CPU) 901. In one embodiment, the processor 901 may also be a graphics processing unit (GPU) 901. The processor 901 may also be a combination of a CPU and a GPU. In one embodiment, the storage device 902 is used to store program instructions.
[0172] In some feasible implementations, when the computer device is the first collaborative device described above, the processor 901 may call the program instruction to perform the following operations:
[0173] Obtain the first task data and task identifier of the target collaborative task.
[0174] A first collaborative data packet is generated based on the first task data and task identifier of the target collaborative task, wherein the first collaborative data packet includes the task identifier, encrypted first task data and permission configuration information, and the permission configuration information is used to indicate the operation authority of at least one second collaborative device over the first task data.
[0175] The calling network interface 903 sends a call request for the collaboration contract to the node device of the blockchain network, and the call request carries the first collaboration data packet. The call request is used to instruct the node device to write the first collaboration data packet into the blockchain by calling the collaboration contract, and send a collaboration request to each second collaboration device.
[0176] Optionally, the processor 901 is specifically configured to:
[0177] Initial task data of a target collaborative task is determined, and the initial task data is used as first task data of the target collaborative task.
[0178] A task identifier of the target collaborative task is generated.
[0179] Optionally, the processor 901 is specifically configured to:
[0180] The network interface 903 is called to receive a collaboration request sent by a node device of the blockchain network, wherein the collaboration request carries a task identifier of a target collaboration task.
[0181] In response to the collaboration request, the network interface 903 is called to send a data query request to the node device, where the data query request carries the task identifier of the target collaboration task.
[0182] The network interface 903 is called to receive a second collaboration data packet sent by the node device, where the second collaboration data packet includes encrypted second task data of the target collaboration task.
[0183] The encrypted second task data is processed to obtain the first task data of the target collaborative task.
[0184] Optionally, the second collaboration data packet further includes a compression algorithm type and an encryption algorithm type of the second task data, and the processor 901 is specifically configured to:
[0185] The encrypted second task data is decrypted using the compression algorithm type and encryption algorithm type of the second task data to obtain the second task data.
[0186] The second task data is subjected to business processing corresponding to the current task flow of the target collaborative task to obtain the first task data of the target collaborative task.
[0187] Optionally, the processor 901 is specifically configured to:
[0188] Obtain the next task flow of the target collaborative task.
[0189] At least one second collaboration device for processing the next task flow and the operation authority of each second collaboration device on the first task data are determined.
[0190] Permission configuration information is generated according to the operation permission of each second collaboration device on the first task data, and the permission configuration information includes an identifier of each second collaboration device and the operation permission of each second collaboration device on the first task data.
[0191] A first collaboration data packet is generated using the first task data, the task identifier and the authority configuration information according to a predefined data structure.
[0192] Optionally, the processor 901 is specifically configured to:
[0193] The first task data is processed according to the compression algorithm type and the encryption algorithm type corresponding to the first task data to obtain encrypted first task data.
[0194] The public key of each second cooperative device is used to encrypt the symmetric key of the encrypted first task data to obtain a digital envelope.
[0195] According to a predefined data structure, a first collaborative data packet is generated using the digital envelope, the task identifier, the compression algorithm type, the encryption algorithm type and the authority configuration information.
[0196] Optionally, the permission configuration information includes a data visible party list and a data writable party list, the data visible party list includes the identification of collaborative devices in the at least one second collaborative device that have read permission for the first task data, and the data writable party list includes the identification of collaborative devices in the at least one second collaborative device that have write permission for the first task data.
[0197] In some feasible implementations, when the computer device is a node device of the above-mentioned blockchain network, the processor 901 may call the program instructions to perform the following operations:
[0198] The calling network interface 903 receives a calling request for a collaborative contract sent by a first collaborative device, wherein the calling request includes a first collaborative data packet, wherein the first collaborative data packet includes a task identifier of a target collaborative task, encrypted first task data, and permission configuration information, wherein the permission configuration information is used to indicate the operating authority of at least one second collaborative device over the first task data.
[0199] In response to the call request, the collaboration contract is called to write the first collaboration data packet into the blockchain.
[0200] The network interface 903 is called to send a collaboration request to each second collaboration device, where the collaboration request carries a task identifier of the target collaboration task, and the task identifier is used by each second collaboration device to obtain the first collaboration data packet from the node device.
[0201] Optionally, the processor 901 is further configured to:
[0202] The network interface 903 is called to receive the collaboration contract and collaboration device registration information sent by the contract issuing device, where the collaboration device registration information includes the identifier of the first collaboration device and the identifier of each second collaboration device.
[0203] The collaboration device registration information is written into the blockchain.
[0204] Optionally, the calling request further includes a private key signature of the first collaboration device, and the processor 901 is further configured to:
[0205] Get the collaborative device registration information stored in the blockchain.
[0206] If the collaborative device registration information includes the identifier of the first collaborative device, the private key signature of the first collaborative device is verified using the public key of the first collaborative device. If the verification passes, the step of calling the collaborative contract in response to the call request to write the first collaborative data packet into the blockchain is executed.
[0207] Optionally, the processor 901 is further configured to:
[0208] The network interface 903 is called to receive a data query request sent by a target collaborative device in response to the collaborative request, wherein the data query request carries a task identifier of the target collaborative task, and the target collaborative device is any one of the at least one second collaborative device.
[0209] The first collaborative data packet is obtained from the blockchain according to the task identifier of the target collaborative task.
[0210] If the target collaboration device is the second collaboration device indicated by the permission configuration information, the network interface 903 is called to send the first collaboration data packet to the target collaboration device.
[0211] Optionally, the first collaboration data packet further includes a first data version number of the target collaboration task, and the processor 901 is further configured to:
[0212] The network interface 903 is called to receive a call request for a collaboration contract sent by the target collaboration device, the call request includes a third collaboration data packet, the third collaboration data packet includes a second data version number of the target collaboration task, and the third collaboration data packet is generated by the target collaboration device after processing the encrypted first task data included in the first collaboration data packet.
[0213] If the first data version number differs from the second data version number by a preset value, the collaboration contract is called in response to the call request to write the third collaboration data packet into the blockchain.
[0214] In a specific implementation, the processor 901, the storage device 902, and the network interface 903 described in the embodiments of the present application can execute the embodiments of the present application. Figure 2 to Figure 6 The implementation method described in the relevant embodiments of the data processing method provided can also be implemented in the embodiments of the present application Figure 7 , Figure 8 The implementation methods described in the relevant embodiments of the provided data processing device will not be repeated here.
[0215] In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform all or part of the steps of the above methods of each embodiment of the present application. Among them, the aforementioned storage medium may include: U disk, mobile hard disk, magnetic disk, optical disk, read-only memory (English: Read-Only Memory, abbreviated: ROM) or random access memory (English: Random Access Memory, abbreviated: RAM) and other media that can store program codes.
[0216] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A data processing method based on a blockchain network, characterized in that: Applied to a first collaboration device, the method includes: Acquire the first task data and task identifier of the target collaborative task; A first collaborative data packet is generated according to the first task data and task identifier of the target collaborative task, wherein the first collaborative data packet includes the task identifier, the encrypted first task data and permission configuration information, wherein the permission configuration information is used to indicate the operation authority of at least one second collaborative device on the first task data; the at least one second collaborative device is a collaborative device that processes the next task flow of the target collaborative task; A call request for a collaboration contract is sent to a node device of a blockchain network, wherein the call request carries the first collaboration data packet, and is used to instruct the node device to write the first collaboration data packet into the blockchain by calling the collaboration contract, and to send a collaboration request to each second collaboration device, and determine a processing method for a collaboration party corresponding to each collaboration device according to the time taken by each collaboration device to process the corresponding task flow and the reference processing time of each task flow of the target collaboration task, wherein the processing method includes transferring on-chain assets to the blockchain account of the collaboration party or marking the collaboration party; wherein the collaboration request is used to instruct each second collaboration device to process the next task flow of the target collaboration task according to the first collaboration data packet.
2. The method according to claim 1, characterized in that The step of obtaining the first task data and task identifier of the target collaborative task includes: Determine initial task data of the target collaborative task, and use the initial task data as first task data of the target collaborative task; A task identifier of the target collaborative task is generated.
3. The method according to claim 1, characterized in that The step of obtaining the first task data and task identifier of the target collaborative task includes: Receive a collaboration request sent by a node device of the blockchain network, wherein the collaboration request carries a task identifier of a target collaboration task; In response to the collaboration request, a data query request is sent to the node device, wherein the data query request carries a task identifier of the target collaboration task; receiving a second collaboration data packet sent by the node device, wherein the second collaboration data packet includes encrypted second task data of the target collaboration task; The encrypted second task data is processed to obtain the first task data of the target collaborative task.
4. The method according to claim 3, characterized in that The second collaboration data packet also includes a compression algorithm type and an encryption algorithm type of the second task data, and the processing of the encrypted second task data to obtain the first task data of the target collaboration task includes: Decrypting the encrypted second task data using the compression algorithm type and encryption algorithm type of the second task data to obtain the second task data; The second task data is subjected to business processing corresponding to the current task flow of the target collaborative task to obtain the first task data of the target collaborative task.
5. The method according to any one of claims 1 to 4, characterized in that The generating a first collaboration data packet according to the first task data and the task identifier of the target collaboration task includes: Obtaining the next task flow of the target collaborative task; Determining at least one second collaboration device for processing the next task flow and the operation authority of each second collaboration device on the first task data; Generate permission configuration information according to the operation permission of each second collaboration device on the first task data, the permission configuration information including the identifier of each second collaboration device and the operation permission of each second collaboration device on the first task data; According to a predefined collaboration data structure, a first collaboration data packet is generated using the first task data, the task identifier and the authority configuration information.
6. The method according to claim 5, characterized in that The step of generating a first collaboration data packet by using the first task data, the task identifier and the authority configuration information according to the predefined collaboration data structure includes: Processing the first task data according to the compression algorithm type and encryption algorithm type corresponding to the first task data to obtain encrypted first task data; Using the public key of each second collaborative device, encrypt the symmetric key of the encrypted first task data to obtain a digital envelope; According to a predefined data structure, a first collaborative data packet is generated using the digital envelope, the task identifier, the compression algorithm type, the encryption algorithm type and the authority configuration information.
7. The method according to claim 1, characterized in that The permission configuration information includes a data visible party list and a data writable party list. The data visible party list includes the identification of the collaborative device in the at least one second collaborative device that has the read permission for the first task data, and the data writable party list includes the identification of the collaborative device in the at least one second collaborative device that has the write permission for the first task data.
8. A data processing method based on a blockchain network, characterized in that: The method is applied to a node device of the blockchain network, and comprises: Receive a call request for a collaboration contract sent by a first collaboration device, the call request including a first collaboration data packet, the first collaboration data packet including a task identifier of a target collaboration task, encrypted first task data, and permission configuration information, the permission configuration information being used to indicate the operation permission of at least one second collaboration device on the first task data; the at least one second collaboration device is a collaboration device that processes a next task flow of the target collaboration task; In response to the call request, the collaboration contract is called to write the first collaboration data packet into the blockchain; Sending a collaboration request to each second collaboration device, wherein the collaboration request carries a task identifier of the target collaboration task, and the task identifier is used by each second collaboration device to obtain the first collaboration data packet from the node device and process the next task flow of the target collaboration task according to the first collaboration data packet; Obtain the time taken by each collaborative device to process the corresponding task flow; Based on the time consumed by each collaborative device to process the corresponding task flow and the reference processing time of each task flow of the target collaborative task, the processing method of the collaborative party corresponding to each collaborative device is determined, and the processing method includes transferring on-chain assets to the blockchain account of the collaborative party or marking the collaborative party.
9. The method according to claim 8, characterized in that The method further comprises: Receive a collaboration contract and collaboration device registration information sent by a contract issuing device, where the collaboration device registration information includes an identifier of the first collaboration device and an identifier of each of the second collaboration devices; The collaboration device registration information is written into the blockchain.
10. The method according to claim 8 or 9, characterized in that: The call request further includes a private key signature of the first collaboration device. Before the collaboration contract is called in response to the call request to write the first collaboration data packet into the blockchain, the method further includes: Get the collaborative device registration information stored in the blockchain; If the collaboration device registration information includes the identifier of the first collaboration device, verifying the private key signature of the first collaboration device using the public key of the first collaboration device; If the verification is successful, the step of calling the collaboration contract in response to the call request and writing the first collaboration data packet into the blockchain is executed.
11. The method according to claim 8 or 9, characterized in that: After sending the collaboration request to each second collaboration device, the method further includes: Receive a data query request sent by a target collaboration device in response to the collaboration request, wherein the data query request carries a task identifier of the target collaboration task, and the target collaboration device is any one of the at least one second collaboration device; Acquire the first collaborative data packet from the blockchain according to the task identifier of the target collaborative task; If the target collaborative device is the second collaborative device indicated by the permission configuration information, the first collaborative data packet is sent to the target collaborative device.
12. The method according to claim 11, characterized in that The first collaboration data packet also includes a first data version number of the target collaboration task, and the method further includes: Receive a call request for a collaboration contract sent by the target collaboration device, the call request including a third collaboration data packet, the third collaboration data packet including a second data version number of the target collaboration task, the third collaboration data packet being generated by the target collaboration device after processing the encrypted first task data included in the first collaboration data packet; If the first data version number differs from the second data version number by a preset value, the collaboration contract is called in response to the call request to write the third collaboration data packet into the blockchain.
13. A data processing device, characterized in that: The device comprises: An acquisition module, used to acquire first task data and task identifier of a target collaborative task; A processing module, used to generate a first collaborative data packet according to the first task data and task identifier of the target collaborative task, wherein the first collaborative data packet includes the task identifier, the encrypted first task data and permission configuration information, wherein the permission configuration information is used to indicate the operation authority of at least one second collaborative device on the first task data; the at least one second collaborative device is a collaborative device that processes the next task flow of the target collaborative task; A sending module is used to send a call request of a collaboration contract to a node device of a blockchain network, wherein the call request carries the first collaboration data packet, and is used to instruct the node device to write the first collaboration data packet into the blockchain by calling the collaboration contract, and to send a collaboration request to each second collaboration device, and to determine a processing method for a collaboration party corresponding to each collaboration device according to the time taken by each collaboration device to process the corresponding task flow and the reference processing time of each task flow of the target collaboration task, wherein the processing method includes transferring on-chain assets to the blockchain account of the collaboration party or marking the collaboration party; wherein the collaboration request is used to instruct each second collaboration device to process the next task flow of the target collaboration task according to the first collaboration data packet.
14. A data processing device, characterized in that: The device comprises: A receiving module, configured to receive a call request for a collaboration contract sent by a first collaboration device, wherein the call request includes a first collaboration data packet, wherein the first collaboration data packet includes a task identifier of a target collaboration task, encrypted first task data, and permission configuration information, wherein the permission configuration information is used to indicate the operation permission of at least one second collaboration device on the first task data; the at least one second collaboration device is a collaboration device for processing a next task flow of the target collaboration task; A processing module, configured to call the collaboration contract in response to the call request and write the first collaboration data packet into the blockchain; A sending module, used to send a collaboration request to each second collaboration device, wherein the collaboration request carries a task identifier of the target collaboration task, and the task identifier is used by each second collaboration device to obtain the first collaboration data packet from the node device and process the next task flow of the target collaboration task according to the first collaboration data packet; The processing module is also used to obtain the time consumed by each collaborative device to process the corresponding task flow; determine the processing method of the collaborative party corresponding to each collaborative device based on the time consumed by each collaborative device to process the corresponding task flow and the reference processing time of each task flow of the target collaborative task, and the processing method includes transferring on-chain assets to the blockchain account of the collaborative party or marking the collaborative party.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. The program instructions are executed by a processor to execute the data processing method based on a blockchain network as described in any one of claims 1 to 7, or the data processing method based on a blockchain network as described in any one of claims 8 to 12.
16. A computer program product, characterized in that The computer program product includes a computer program, which, when executed by a processor, implements the data processing method based on a blockchain network as described in any one of claims 1 to 7, or the data processing method based on a blockchain network as described in any one of claims 8 to 12.
Citation Information
Patent Citations
Blockchain collaborative permission control method and device
CN112235294A
Collaboration hub with blockchain verification
US20210105148A1