CN115714656A - Data processing method and device based on block chain network and storage medium - Google Patents

Data processing method and device based on block chain network and storage medium Download PDF

Info

Publication number
CN115714656A
CN115714656A CN202110955601.8A CN202110955601A CN115714656A CN 115714656 A CN115714656 A CN 115714656A CN 202110955601 A CN202110955601 A CN 202110955601A CN 115714656 A CN115714656 A CN 115714656A
Authority
CN
China
Prior art keywords
task
data
cooperation
collaboration
cooperative
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110955601.8A
Other languages
Chinese (zh)
Inventor
王宗友
蓝虎
时一防
张慧
黄桂鸿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110955601.8A priority Critical patent/CN115714656A/en
Publication of CN115714656A publication Critical patent/CN115714656A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a data processing method, a device and a storage medium based on a block chain network, wherein the method comprises the following steps: acquiring first task data and a task identifier of a target cooperation task; generating a first cooperation data packet according to first task data and a task identifier of the target cooperation task, wherein the first cooperation data packet comprises the task identifier, the encrypted first task data and permission configuration information, and the permission configuration information is used for indicating the operation permission of at least one second cooperation device on the first task data; and sending a calling request of a collaboration contract to node equipment of a block chain network, wherein the calling request carries the first collaboration data packet, and the calling request is used for indicating the node equipment to write the first collaboration data packet into the block chain by calling the collaboration contract and sending a collaboration request to each second collaboration equipment, so that data sharing can be safely and efficiently realized, and a collaboration task can be quickly completed.

Description

Data processing method and device based on block chain network and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method and apparatus based on a blockchain network, and a storage medium.
Background
The block chain is a technical system which is commonly maintained by multiple parties, stores data in a block chain structure, ensures transmission and access safety by using cryptography, and can realize consistent storage, tampering and repudiation of the data. In the existing model for data sharing by means of a block chain, the common practice is to directly share each data among a plurality of participants, the security is poor, the flow of the shared data and the format of the data are not compulsorily regulated and restricted, and the differentiated management capability of the data operation authority is lacked. Therefore, how to provide a safe and efficient data sharing scheme becomes a problem to be solved urgently.
Disclosure of Invention
The embodiment of the application provides a data processing method, a data processing device and a storage medium based on a block chain network, which can safely and efficiently realize data sharing and quickly complete a cooperation task.
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 cooperative device, and the method includes:
first task data and a task identifier of the target cooperation task are obtained.
And generating a first cooperation data packet according to the first task data and the task identifier of the target cooperation task, wherein the first cooperation data packet comprises the task identifier, the encrypted first task data and authority configuration information, and the authority configuration information is used for indicating the operation authority of at least one second cooperation device on the first task data.
And sending a calling request of a cooperation contract to node equipment of a block chain network, wherein the calling request carries the first cooperation data packet, and the calling request is used for indicating the node equipment to write the first cooperation data packet into the block chain by calling the cooperation contract and sending a cooperation request to each second cooperation equipment.
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:
receiving a calling request of a collaboration contract sent by a first collaboration device, wherein the calling request comprises a first collaboration data packet, the first collaboration data packet comprises a task identifier of a target collaboration task, encrypted first task data and permission configuration information, and the permission configuration information is used for indicating operation permission of at least one second collaboration device on the first task data.
And calling the collaboration contract to write the first collaboration data packet into a block chain in response to the calling request.
And sending a cooperation request to each second cooperative device, where the cooperation request carries a task identifier of the target cooperation task, and the task identifier is used for each second cooperative device to obtain the first cooperation data packet from the node device.
In a third aspect, an embodiment of the present application provides a data processing apparatus, where the apparatus includes:
the acquisition module is used for acquiring first task data and task identification of the target cooperation task.
The processing module is configured to generate a first collaboration data packet according to the first task data of the target collaboration task and the task identifier, where the first collaboration data packet includes the task identifier, the encrypted first task data, and permission configuration information, and the permission configuration information is used to indicate an operation permission of at least one second collaboration device on the first task data.
A sending module, configured to send a call request of a cooperation contract to a node device of a block link network, where the call request carries the first cooperation data packet, and the call request is used to instruct the node device to write the first cooperation data packet into a block link by calling the cooperation contract, and send a cooperation request to each second cooperation device.
In a fourth aspect, an embodiment of the present application provides a data processing apparatus, where the apparatus includes:
the receiving module is configured to receive a call request of a collaboration contract sent by a first collaboration device, where 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, and the permission configuration information is used to indicate an operation permission of at least one second collaboration device on the first task data.
And the processing module is used for responding to the calling request and calling the cooperation contract to write the first cooperation data packet into the block chain.
A sending module, configured to send a cooperation request to each second cooperative device, where the cooperation request carries a task identifier of the target cooperative task, and the task identifier is used for each second cooperative device to obtain the first cooperative data packet from the node device.
In a fifth aspect, the present application provides a computer device, which includes a processor, a network interface, and a storage device, where the processor, the network interface, and the storage device are connected to each other, where the network interface is controlled by the processor for transceiving data, and the storage device is used for storing a computer program, where the computer program includes program instructions, and the processor is configured to call the program instructions for executing the data processing method based on a blockchain network according to the first aspect.
In a sixth aspect, the present application provides a computer device, where the computer device includes a processor, a network interface, and a storage device, where the processor, the network interface, and the storage device are connected to each other, where the network interface is controlled by the processor to transmit and receive data, and the storage device is used to store a computer program, where the computer program includes program instructions, and the processor is configured to call the program instructions to execute the data processing method based on the blockchain network according to the second aspect.
In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program includes program instructions, where the program instructions are executed by a processor, to perform the data processing method based on a blockchain network according to the first aspect.
In an eighth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, where 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 according to the second aspect.
In a ninth aspect, embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the data processing method based on the blockchain network according to the first aspect.
In a tenth aspect, embodiments of the present application provide a computer program product or a computer program, which includes computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the data processing method based on the blockchain network according to the second aspect.
In the embodiment of the application, after acquiring first task data and a task identifier of a target cooperative task, a first cooperative device may generate a first cooperative data packet according to the first task data and the task identifier of the target cooperative task, where the first cooperative data packet includes encrypted first task data and authority configuration information of an operation authority of at least one second cooperative device on the first task data, and sends a call request of a cooperative contract to a node device of a block chain network, where the call request carries the first cooperative data packet to instruct the node device to write the first cooperative data packet into the block chain by calling the cooperative contract, and send a cooperative request to each second cooperative device, so that data sharing may be safely and efficiently achieved by using the data tamper-resistant and traceable capabilities of the block chain, and a cooperative task may be completed quickly.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1a is a block diagram of a data processing system according to an embodiment of the present application;
fig. 1b is a schematic structural diagram of a block chain according to an embodiment of the present application;
FIG. 1c is a schematic diagram of a process for generating a new block according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a data processing method according to an embodiment of the present application;
FIG. 3 is a schematic flow chart diagram of another data processing method provided in the embodiments of the present application;
FIG. 4 is a schematic flow chart diagram illustrating a further data processing method provided in an embodiment of the present application;
FIG. 5 is a schematic flowchart of another data processing method provided in an embodiment of the present application;
FIG. 6 is a schematic flowchart of another data processing method provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
Referring to fig. 1a, it is a schematic structural diagram of a data processing system provided in an embodiment of the present application, where the data processing system includes a blockchain network 10 and a plurality of cooperative devices 20, where:
the blockchain network 10 refers to a network for performing data sharing between nodes, and a plurality of nodes 101 may be included in the blockchain network. Each node 101 may receive input information and maintain shared data (i.e., blockchains) within the blockchain network based on the received input information while operating normally. In order To ensure information intercommunication in a block chain network, information connection may exist between each node, and point-To-point (Peer To Peer, P2P) communication may be implemented between any two nodes, specifically, P2P communication may be implemented through a wired communication link or a wireless communication link. For example, when any node in the blockchain network receives input information, other nodes acquire the input information according to a consensus algorithm, and store the input information as data in shared data, so that the data stored on all nodes in the blockchain network are consistent.
The collaboration device 20 may access the blockchain network and may communicate with nodes in the blockchain network, such as submitting data to the nodes (e.g., created collaboration packets), querying data from the nodes, and so on. The collaboration device 20 may specifically be a smart phone, a tablet computer, a notebook computer, a desktop computer, a vehicle-mounted smart terminal, and the like, which is not limited in this embodiment of the application.
It should be noted that the number of nodes shown in fig. 1a is only illustrative, and any number of nodes may be deployed according to actual needs.
Each node in the blockchain network has a node identifier corresponding thereto, and each node in the blockchain network can store the node identifiers of other nodes in the blockchain network, so that the generated block can be broadcast to other nodes in the blockchain network according to the node identifiers of other nodes in the blockchain network. Each node may maintain a node identifier list as shown in the following table, and store the node name and the node identifier in the node identifier list correspondingly. The node identifier may be an Internet Protocol (IP) address or any other information that can be used to identify the node, and the table is described by taking the IP address as an example.
Node name Node identification
Node 1 117.114.151.174
Node 2 117.116.189.145
Node N 119.123.789.258
Each node in the blockchain network stores one identical blockchain. The block chain is composed of a plurality of blocks, referring to fig. 1b, the block chain is composed of a plurality of blocks, the starting block includes a block header and a block main body, the block header stores an input information characteristic value, a version number, a timestamp and a difficulty value, and the block main body stores input information; the next block of the starting block takes the starting block as a parent block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the parent block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain is associated with the block data stored in the parent block, and the safety of the input information in the block is ensured.
When each block in the block chain is generated, referring to fig. 1c, when a node where the block chain is located receives input information, the input information is verified, after the verification is completed, the input information is stored in a memory pool, and a hash tree used for recording the input information is updated; and then, updating the updating time stamp to the time when the input information is received, trying different random numbers, and calculating the characteristic value for multiple times, so that the calculated characteristic value can meet the following formula:
SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET
wherein, SHA256 is a characteristic value algorithm used for calculating a characteristic value; version is version information of the relevant block protocol in the block chain; prev _ hash is a block head characteristic value of a parent block of the current block; merkle _ root is a characteristic value of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, is a fixed value within a period of time, and is determined again after exceeding a fixed time period; x is a random number; TARGET is a feature threshold, which can be determined from nbits.
Therefore, when the random number meeting the formula is obtained through calculation, the information can be correspondingly stored, and the block header and the block main body are generated to obtain the current block. And then, the node where the block chain is located respectively sends the newly generated blocks to other nodes in the block chain network where the newly generated blocks are located according to the node identifications of the other nodes in the block chain network, the newly generated blocks are verified by the other nodes, and the newly generated blocks are added to the block chain stored in the newly generated blocks after the verification is completed.
The intelligent contract can be operated on the nodes of the block chain network, the intelligent contract is realized by codes executed when a certain condition is met, developers can define contract logic through a programming language, issue the contract logic to the block chain (intelligent contract registration), and call keys or other events to trigger execution according to the logic of contract terms to complete the contract logic and simultaneously provide the functions of upgrading and cancelling the intelligent contract.
In some possible embodiments, a certain collaboration device 20 (which may be referred to as a first collaboration device) may obtain first task data and a task identifier of a target collaboration task, where the target collaboration task may refer to a specific business process; the task identification can uniquely indicate the target cooperation service, and different cooperation tasks are distinguished through the task identification; the first task data may refer to data that needs to be processed by a next task flow of the target collaboration task. Then, the cooperative device 20 may generate a first cooperative data packet according to the first task data of the target cooperative task and the task identifier, where the first cooperative data packet includes the task identifier, the encrypted first task data, and permission configuration information, the permission configuration information is used to indicate an operation permission of at least one second cooperative device for the first task data, and the second cooperative device is a device for processing a next task process, and may be any one or more cooperative devices except the first cooperative device in fig. 1 a. The cooperative device 20 sends a call request of a cooperative contract to a certain node 101 of the block chain network, where the cooperative contract may specifically be an intelligent contract, and runs on each node 101, and the call request carries the first cooperative data packet, and the node 101 may write the first cooperative data packet into the block chain by calling the cooperative contract, and send the cooperative request to each second cooperative device, so that the second cooperative device may execute the next task flow, that is, obtain the first cooperative data packet from the block chain, and perform corresponding processing on the first task data therein, thereby safely and efficiently implementing data sharing and quickly completing a cooperative task.
In some possible embodiments, the data processing system may further include a contract issuing device (not shown in fig. 1 a), which may be any one of the plurality of cooperation devices 20 included in fig. 1a, or another device. The contract issuing device may issue a collaboration contract and collaboration device registration information to the nodes 101 of the blockchain network, the collaboration contract may run on each node 101, and the nodes 101 may write the collaboration device registration information into the blockchain, the collaboration device registration information including the identification of all participants of the target collaboration service.
The implementation details of the technical solution of the embodiment of the present application are set forth in detail below:
please refer to fig. 2, which is a flowchart illustrating a data processing method provided by the data processing system shown in fig. 1a according to an embodiment of the present application, where the data processing method according to the embodiment of the present application is mainly described from a side of a certain cooperative device (e.g., a first cooperative device), and the data processing method includes the following steps:
201. first task data and task identification of the target cooperation task are obtained.
The target cooperation task may refer to a specific business processing process, the business processing process may include a plurality of task processes, and the plurality of collaborators participate in the business processing process together, and each task process needs to be completed by a corresponding collaborator, for example, the target cooperation task may include an electronic invoice issuing service, a bill reimbursement service, an export tax refund service, and the like; the task identification can uniquely indicate the target cooperation service, and different cooperation tasks are distinguished through the task identification; the first task data may refer to data that needs to be processed by a next task flow of the target collaboration task. The first collaboration device corresponds to a participant (or a collaboration party) of the target collaboration task, and the first collaboration device may refer to a device responsible for initiating the target collaboration task, or may refer to a device responsible for processing a current task flow of the target collaboration task, where the current task flow may be any one task flow included in the target collaboration service.
It should be noted that the node device may also be used as a cooperative device, which is not limited in this embodiment of the present application.
Specifically, the first cooperative device may directly specify the first task data and the task identifier of the target cooperative task, or may obtain the first task data uploaded by other cooperative devices and the task identifier of the target cooperative task from a node device of the block chain network.
202. And generating a first cooperation data packet according to the first task data and the task identifier of the target cooperation task, wherein the first cooperation data packet comprises the task identifier, the encrypted first task data and permission configuration information, and the permission configuration information is used for indicating the operation permission of at least one second cooperation device on the first task data.
Specifically, the first cooperative device may perform data encapsulation on first task data and a task identifier of a target cooperative task according to a predefined data structure to generate a corresponding cooperative data packet (denoted as a first cooperative data packet), where the first cooperative data packet may include, in addition to the task identifier of the target cooperative task and the encrypted first task data, permission configuration information of at least one cooperative device that processes the first task data in a next task flow, the cooperative device may be denoted as a second cooperative device, the permission configuration information indicates an operation permission of each second cooperative device on the first task data, and the operation permission may include a read permission and a write permission, so that a unified data structure is used to indicate the permission information of a participant in a next link and each participant, it may be ensured that mandatory regulations and constraints are provided for a flow of shared data and a format of the data, a differentiated management capability of different participants on data operation permission is implemented, data correspondingly processed in different links are only open to the participant corresponding to the link, and direct read-write permission of the data between different participants is avoided.
203. And sending a calling request of a collaboration contract to node equipment of a block chain network, wherein the calling request carries the first collaboration data packet, and the calling request is used for indicating the node equipment to write the first collaboration data packet into the block chain by calling the collaboration contract and sending a collaboration request to each second collaboration equipment.
Specifically, after a first cooperation device organizes a first cooperation data packet, a call request of a cooperation contract may be initiated to a node device of a blockchain network, and the first cooperation data packet is carried in the call request to trigger the start of a target cooperation task or the target cooperation task to enter a next task flow, and the node device writes the first cooperation data packet into the blockchain by calling the cooperation contract and sends a cooperation request to each second cooperation device, so that the second cooperation devices may execute the next task flow, that is, obtain the first cooperation data packet from the blockchain and perform corresponding processing on first task data therein.
It can be understood that, if the task flow of the target cooperative task is not finished yet, after the first task data is processed correspondingly, the second cooperative device may determine a participant of a next task flow, and create a new cooperative data packet by using the processed data, and submit the new cooperative data packet to the node device of the blockchain network for uplink.
In some possible embodiments, data operation permissions of different participants can be managed differentially by combining block chains, and the execution process of a cooperative task can be effectively supervised.
In the specific implementation, the operation permission of all cooperative devices participating in a certain cooperative task on task data can be indicated in the cooperative data packet, so that in the execution process of the cooperative task, each cooperative device can accurately acquire the data processing result of the cooperative device processing each task flow from the blockchain, and thus, the effective supervision of all participants on the execution process of the cooperative task is realized. For example, for the target cooperation task, a cooperative device for processing a next task flow of the target cooperation task is denoted as a second cooperative device, and a cooperative device other than the second cooperative device among all cooperative devices participating in the target cooperation task is denoted as a third cooperative device, which is also a cooperative device for processing other task flows of the target cooperation task; the other task flows may include task flows that are not executed after the next task flow in the target collaboration task, or the other task flows may also include all executed task flows and all task flows that are not executed except the next task flow in the target collaboration task; for the first task data, the first cooperative device may indicate, in the permission configuration information of the cooperative data packet, the operation permission of each second cooperative device on the first task data and the operation permission of each third cooperative device on the first task data, and after the node device writes the cooperative data packet into the block chain, the node device may provide, according to the permission configuration information in the cooperative data packet, a read service or a write service of the first task data to each cooperative device participating in the target cooperative task. Specifically, the operation authority of the second cooperative device on the first task data may include a read authority and a write authority to ensure that the second cooperative device can normally process the next task flow of the target cooperative task, and the operation authority of the third cooperative device on the first task data may include only the read authority to ensure that participants of other links of the target cooperative task can read task data from the block chain to realize supervision on data in the task execution process, so that authority information of the participants of each link of the target cooperative task is indicated by using a unified data structure, thereby not only realizing differentiated management capability of different participants on data operation authority, but also realizing effective supervision of the participants of each link on the execution process of the cooperative task.
In the embodiment of the application, after acquiring the first task data and the task identifier of the target cooperative task, the first cooperative device may generate a first cooperative data packet according to the first task data and the task identifier of the target cooperative task, where the first cooperative data packet includes encrypted first task data and authority configuration information of an operation authority of at least one second cooperative device on the first task data, and sends a call request of a cooperative contract to a node device of a block chain network, where the call request carries the first cooperative data packet, and may instruct the node device to write the first cooperative data packet into the block chain by calling the cooperative contract, and send a cooperative request to each second cooperative device, so that data sharing may be safely and efficiently achieved by using the data tamper-resistant and traceable capabilities of the block chain, and the first cooperative device may be used to quickly complete cooperative tasks in various scenarios.
Please refer to fig. 3, which is a schematic flow chart of another data processing method provided by the data processing system shown in fig. 1a according to the embodiment of the present application, where the data processing method according to the embodiment of the present application is mainly described from a side of a certain cooperative device (e.g., a first cooperative device), and the data processing method includes the following steps:
301. first task data and a task identifier of the target cooperation task are obtained.
Specifically, when the first collaboration device is a device responsible for initiating the target collaboration task, the first collaboration device may determine initial task data of the target collaboration task, where the initial task data may be, for example, a consumption record to be billed by a user, use the initial task data as first task data of the target collaboration task, and generate a task identifier of the target collaboration task; when the first cooperative device is responsible for processing a current task flow of the target cooperative task, the first cooperative device may receive a cooperation request sent by a node device of a block chain network, where the cooperation request carries a task identifier of the target cooperative task, and may send a data query request to the node device in response to the cooperation request, where the data query request carries the task identifier of the target cooperative task, and the node device may query a second cooperative data packet stored in the block chain, where the second cooperative data packet may be generated according to a predefined data structure after other cooperative devices complete a previous task flow of the current task flow, the first cooperative device receives the second cooperative data packet sent by the node device, and the second cooperative data packet includes encrypted second task data of the target cooperative task, where the second task data is data that needs to be processed by the current task flow of the target cooperative task, and the first cooperative device processes the encrypted second task data to obtain first task data of the target cooperative task.
In some feasible embodiments, the second collaboration data packet may further include a compression algorithm type and an encryption algorithm type of the second task data, and the first collaboration device may decrypt the encrypted second task data by using the compression algorithm type and the encryption algorithm type of the second task data to obtain the second task data, and then perform service processing corresponding to the current task flow of the target collaboration task on the second task data to obtain the first task data of the target collaboration task.
302. And acquiring the next task flow of the target cooperation task.
Specifically, if the first cooperative device is a device responsible for initiating the target cooperative task, the first cooperative device may use a first task flow of the target cooperative task as the next task flow; if the first cooperative device is a device responsible for processing the current task flow of the target cooperative task, the first cooperative device may determine a next task flow according to an execution sequence between task flows included in the target cooperative task, or the first cooperative device may flexibly specify the next task flow of the target cooperative task according to actual business requirements.
303. And determining at least one second cooperative device for processing the next task flow and the operation authority of each second cooperative device on the first task data.
Specifically, the first cooperative device may flexibly specify a cooperative device (denoted as a second cooperative device) for processing a next task flow, and the number of the second cooperative devices may be one or multiple, if the number of the second cooperative devices is multiple, the multiple second cooperative devices may cooperate to complete the next task flow, or the multiple second cooperative devices complete the next task flow in a competitive manner, that is, only one processing result of the second cooperative device is valid. In addition, the first cooperative apparatus may further specify an operation right of each second cooperative apparatus to the first task data.
304. And generating permission configuration information according to the operation permission of each second cooperative device on the first task data, wherein the permission configuration information comprises the identification of each second cooperative device and the operation permission of each second cooperative device on the first task data.
Specifically, the first cooperative device may generate permission configuration information according to the configured operation permission of each second cooperative device on the first task data, where the permission configuration information may include at least an identifier of each second cooperative device and a specific operation permission of each second cooperative device on the first task data.
In some possible embodiments, the permission configuration information may include a data visible party list and a data writable party list, where the visible party list includes an identifier of a collaboration device in the at least one second collaboration device that has a read permission for the first task data, and the data writable party list includes an identifier of a collaboration device in the at least one second collaboration device that has a write permission for the first task data, and the operation permissions of the respective participants in each task flow may be accurately indicated by using the data visible party list and the data writable party list, so that the differential management capabilities of the different participants on the data operation permissions are achieved.
305. And generating a first cooperation data packet by using the first task data, the task identifier and the authority configuration information according to a predefined data structure.
The predefined data structure is used for compulsorily stively stipulating and restricting the flow and the data format of the shared data, and realizing the standardized management of the data sharing. The predefined data structure may specifically include a plurality of fields, for example, may include task identification, authority configuration information, collaboration data, compression algorithm, encryption algorithm, and may further include a data version number, a digital envelope, and the like, and a field type and a field description of each field may be as shown in table 1 below.
Figure BDA0003220088180000121
TABLE 1 predefined data Structure
Specifically, the first cooperative device may compress and encrypt the first task data according to a compression algorithm type and an encryption algorithm type corresponding to the first task data to obtain encrypted first task data, may encrypt a symmetric key of the encrypted first task data by using a public key of each second cooperative device to obtain a digital envelope, and then generates the first cooperative data packet by using the digital envelope, the task identifier, the compression algorithm type, the encryption algorithm type, and the right configuration information according to the predefined data structure.
306. And sending a calling request of a collaboration contract to node equipment of a block chain network, wherein the calling request carries the first collaboration data packet, and the calling request is used for indicating the node equipment to write the first collaboration data packet into the block chain by calling the collaboration contract and sending a collaboration request to each second collaboration equipment.
For specific implementation of step 306, reference may be made to related description in step 203 in the foregoing embodiment, and details are not described here again.
In the embodiment of the application, a first cooperative device may obtain a next task flow of a target cooperative task, determine at least one second cooperative device for processing the next task flow and an operation authority of each second cooperative device on first task data, generate authority configuration information according to the operation authority of each second cooperative device on the first task data, where the authority configuration information includes an identifier of each second cooperative device and an operation authority of each second cooperative device on the first task data, generate a first cooperative data packet by using the first task data, the task identifier and the authority configuration information according to a predefined cooperative data structure, and send a call request of a cooperative contract to a node device of a block chain network, where the call request carries the first cooperative data packet, and may instruct the node device to write the first cooperative data packet into a block chain by calling the cooperative contract, and send the cooperative request to each second cooperative device, so that a predefined data structure may perform mandatory regulation and constraint on the flow and data format of shared data, implement standardized management on data sharing, have strong general property, and may simultaneously ensure cross-block data security and tamper resistance of the data, and implement efficient cooperative data sharing in a scene when sharing data, and a security and a shared data structure can implement quick coordinated management on shared data.
Please refer to fig. 4, which is a schematic flow chart of another data processing method provided by the data processing system shown in fig. 1a according to the embodiment of the present application, wherein the data processing method in the embodiment of the present application is mainly described from the node device side of the blockchain network, and the data processing method includes the following steps:
401. receiving a calling request of a collaboration contract sent by a first collaboration device, wherein the calling request comprises a first collaboration data packet, the first collaboration data packet comprises a task identifier of a target collaboration task, encrypted first task data and permission configuration information, and the permission configuration information is used for indicating operation permission of at least one second collaboration device on the first task data.
The node device is configured to run a collaboration contract and store, in the blockchain, data generated in each task flow of the target collaboration task, for example, a first collaboration data packet generated by the first collaboration device.
In some possible embodiments, the contract issuing device needs to register information of the relevant participant on the blockchain before the target collaboration task is initiated. For example, the node device may receive a collaboration contract and collaboration device registration information sent by the contract issuing device, where the collaboration device registration information includes identifiers of all collaboration devices participating in each task flow of the processing target collaboration task, and the all collaboration devices include the first collaboration device and the second collaboration device described above, and may write the collaboration device registration information into the block chain, where the identifier of the collaboration device may be a public key of the collaboration device, or a block chain account address generated based on the public key, or the like.
402. And calling the collaboration contract to write the first collaboration data packet into a block chain in response to the calling request.
Specifically, after receiving the first cooperation data packet, a certain node device may invoke a cooperation contract to perform consensus verification on the first cooperation data packet together with other node devices, and if the consensus verification passes, write the first cooperation data packet into the block chain.
In some feasible embodiments, the invocation request further includes a private key signature of the first collaboration device, the node device obtains the collaboration device registration information stored in the block chain, if the collaboration device registration information includes an identifier of the first collaboration device, the private key signature of the first collaboration device is verified by using a public key of the first collaboration device, if the verification is passed, the invocation request is responded, a collaboration contract is invoked to write the first collaboration data packet into the block chain, and the security during data sharing can be improved by verifying the private key signature.
403. And sending a cooperation request to each second cooperative device, where the cooperation request carries a task identifier of the target cooperation task, and the task identifier is used for each second cooperative device to obtain the first cooperation data packet from the node device.
Specifically, the node device may send a cooperation request to each participant (i.e., each second cooperative device) of the next task flow of the target cooperative task, where the cooperation request carries a task identifier of the target cooperative task, and each second cooperative device may obtain the first cooperative data packet from the node device by using the task identifier, and perform corresponding service processing.
In some feasible embodiments, the node device may receive a data query request sent by the target cooperative device in response to the cooperation request, where the data query request carries a task identifier of the target cooperative task, and the target cooperative device is any one of the at least one second cooperative device. The node device acquires a first cooperation data packet from the block chain according to the task identifier of the target cooperation task, and if the target cooperation device is a second cooperation device indicated by the permission configuration information, that is, if the target cooperation device is a participant of a next task flow of the target cooperation task, the node device sends the first cooperation data packet to the target cooperation device.
In some possible embodiments, as shown in table 1, the predefined data structure may include a data version number used to indicate a different data version of the target cooperation task, for example, the first cooperation data packet further includes a first data version number of the target cooperation task, the target cooperation device may generate a third cooperation data packet according to a processing result after processing the encrypted first task data included in the first cooperation data packet, the third cooperation data packet includes a second data version number of the target cooperation task, the second data version number is obtained after the target cooperation device obtains the first cooperation data packet and adds a preset value to the first data version number of the target cooperation task included in the first cooperation data packet, where the preset value may be 1, and the target cooperation device adds 1 to the first data version number to obtain the second data version number. The node device receives a call request of a collaboration contract sent by a target collaboration device, the call request includes a third collaboration data packet, if a difference between a first data version number and a second data version number is a preset value (for example, the preset value is 1), the node device calls the collaboration contract to write the third collaboration data packet into a block chain in response to the call request, the latest data version number of a target collaboration task stored in the block chain is changed into a second data version number, if other collaboration devices update the latest collaboration data packet in the block chain concurrently with the target collaboration device, for example, after the node device writes the third collaboration data packet into the block chain, the other collaboration devices send a fourth collaboration data packet to the node device, the fourth collaboration data packet includes a third data version number of the target collaboration task, the third data version number is obtained after adding the preset value to the first data version number of the target collaboration task, and since the latest data version number stored in the block chain at this time is the second data version number, the second data version number is the same as the third data version number, the third data version number is not different from the third data version number, and the node device does not guarantee that the node device does not update the latest data version number, and does not respond to the cooperation data version number correctly.
In some feasible embodiments, the processing duration of each link can be effectively supervised by combining a block chain, and the method can be used for tracing the source and the responsibility of conditions such as task execution progress lag and the like, and can also be used for exciting a cooperative party with higher task execution efficiency.
In a specific implementation, the reference processing duration of each task flow of the target collaborative task may be set, for example, the reference processing duration may be set by a contract distribution device or a node device, and the node device may write the reference processing duration of each task flow into a block chain; the reference processing time may be related to a specific task flow, when the task flow is complex, the corresponding reference processing time may be set to be longer (e.g., 5 minutes), and when the task flow is simple, the corresponding reference processing time may be set to be shorter (e.g., 1 minute).
The node device may record the consumed duration of each cooperative device when processing the corresponding task flow, compare the consumed duration with the corresponding reference processing duration, and if the consumed duration of a certain cooperative device (which may be denoted as a fourth cooperative device) is less than the reference processing duration, the node device may award the cooperative party corresponding to the fourth cooperative device, for example, may transfer a chain asset to a block chain account of the cooperative party corresponding to the fourth cooperative device as an award; if the consumed duration of a certain cooperative device (which may be denoted as a fifth cooperative device) is longer than the reference processing duration, and the time difference when the consumed duration exceeds the reference processing duration exceeds a certain threshold, the node device may mark the fifth cooperative device and the corresponding cooperative party, and write the mark information into the block chain.
The node device may record a first time for sending the cooperation request to the cooperative device and a second time for receiving the cooperation data packet sent by the cooperative device, and determine a consumed duration when the cooperative device processes the corresponding task flow according to the first time and the second time.
Further, the node device may also write the consumed time corresponding to each cooperative device into the blockchain, and when receiving a consumed time query request for a certain cooperative device from a querying party, the node device may read the corresponding consumed time from the blockchain and send the read consumed time to the querying party, where the querying party may refer to a cooperative device corresponding to an unexecuted task flow of the target cooperative task or a cooperative device corresponding to any task flow of the target cooperative task, so that effective supervision on the processing time of each link may be achieved, and responsibility may be taken for a relevant cooperative party when the task execution progress is delayed.
In some possible embodiments, in the process of executing the target cooperation task, the node device may dynamically adjust the reference processing duration of each task flow that is not executed according to the consumed duration of each task flow that has been executed in the target cooperation task. Specifically, the node device may calculate the total reference duration of the target cooperative task according to the set reference processing duration of each task flow of the target cooperative task. In the process of executing the target cooperative task, the node device calculates the consumed total time according to the consumed time of each task flow executed in the target cooperative task, then adjusts the reference processing time of each task flow which is not executed according to the difference value between the reference total time and the consumed total time, notifies the corresponding cooperative device of the adjusted reference processing time, and judges whether reward or mark addition needs to be carried out on a cooperative party corresponding to the related cooperative device according to the adjusted reference processing time, so that the node device can flexibly adjust the reference processing time of each task flow which is not executed according to the actual consumed time of each task flow which is executed, and can stimulate or mark the actual consumed time, and the execution efficiency of the cooperative task can be improved.
In the embodiment of the application, a node device receives a call request of 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 for indicating operation permission of at least one second collaboration device on the first task data, the collaboration contract is called to write the first collaboration data packet into a block chain, then a collaboration request is sent to each second collaboration device, the collaboration request carries the task identifier of the target collaboration task, the collaboration request is used for each second collaboration device to obtain the first collaboration data packet from the node device, data sharing can be safely and efficiently realized through data tamper-proof and traceability capabilities of the block chain, data safety and privacy during information sharing across organizations are guaranteed, and the method can be used for quickly completing collaboration tasks of various scenes.
Please refer to fig. 5, which is a schematic flow diagram of another data processing method provided by the data processing system shown in fig. 1a according to the embodiment of the present application, where the data processing method according to the embodiment of the present application is mainly described from multiple sides of a blockchain network, a collaborating party, and a contract issuing party, and the data processing method includes the following steps:
501. the contract issuing party issues the collaborative contract.
502. The contract issuer block chain network registers the cooperator.
The collaborators may include, for example, collaborator a, collaborator B, and the like.
503. And the cooperative party A organizes the cooperative data and determines a cooperative party B of the next link.
The collaborator a may be an initiator of a target collaboration task, for example, the first collaborating device may be used, the collaborator B may be a participant of a next link (for example, a next task flow of the target collaboration task), for example, the second collaborating device may be used, and the collaborator B may be one or more than one collaborating device, which is not limited in the embodiment of the present application.
504. The collaboration party a initiates a call of a collaboration contract to the blockchain network.
When called, the request may carry a task identifier of the target cooperative task, such as an ID:001.
505. the blockchain network determines whether the initiator (i.e., cooperator a) is registered.
506. If the initiator is registered, the blockchain network checks the signature, performs other logic of the contract, and completes consensus of the collaboration data.
507. The blockchain network informs cooperator a that the uplink was successful.
508. The blockchain network informs the cooperator B that there is a new cooperation request.
The cooperation request may carry a task identifier of the target cooperation task.
509. The cooperator B queries the blockchain network for cooperation data.
510. The blockchain network determines whether the caller (i.e., cooperator B) is registered.
511. If the caller is registered, the blockchain network obtains the collaboration data.
512. And the block chain network judges whether the cooperative party B is a designated participant in the next link of the cooperative task.
513. If the participant is the designated participant, the blockchain network returns the collaboration data to the collaboration party B.
514. And the cooperative party B decrypts the cooperative data and performs data and business logic processing.
515. And the cooperative party B determines the cooperative party of the next link, assembles cooperative data and uplinks the cooperative data.
For specific implementation of steps 501 to 515, reference may be made to relevant descriptions in the foregoing embodiments, and details are not described here again.
In some possible implementations, as shown in fig. 6, a schematic flow chart of another data processing method provided in the embodiments of the present application is shown. The method comprises the steps that a collaboration task is initiated by a collaboration party A (collaboration step 1), then a collaboration party B processes a first task flow (collaboration step 2), then a collaboration party C processes a next task flow (collaboration step 3), \8230, and the current collaboration task is completed until all task flows of the collaboration task are processed. In the processing process of the cooperative task, a cooperative party responsible for processing the corresponding task flow has read-write permission for corresponding cooperative data, the generated cooperative data packet is written into the block chain through the node equipment, and the auditor is used for supervision and can only have permission for reading the cooperative data generated in each task flow of the cooperative task, so that the differentiated distribution capacity of the data read-write permission of different participating members is realized, and by means of the data tamper-proof and traceability capacity of the block chain, data sharing can be safely and efficiently realized, and the cooperative task of various scenes can be quickly completed.
Please refer to fig. 7, which is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application, where the data processing apparatus according to the embodiment of the present application may be applied to a cooperative device, such as the first cooperative device described above, and the apparatus includes:
the obtaining module 701 is configured to obtain first task data and a task identifier of a target collaboration task.
A processing module 702, configured to generate a first collaboration data packet according to the first task data of the target collaboration task and the task identifier, where the first collaboration data packet includes the task identifier, the encrypted first task data, and permission configuration information, and the permission configuration information is used to indicate an operation permission of at least one second collaboration device on the first task data.
A sending module 703 is configured to send a call request of a collaboration contract to a node device of a blockchain network, where 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 a blockchain by calling the collaboration contract, and send a collaboration request to each second collaboration device.
Optionally, the obtaining module 701 is specifically configured to:
determining initial task data of a target cooperation task, and taking the initial task data as first task data of the target cooperation task.
And generating a task identifier of the target cooperation task.
Optionally, the obtaining module 701 is specifically configured to:
receiving a cooperation request sent by node equipment of a block chain network, wherein the cooperation request carries a task identifier of a target cooperation task.
And responding to the cooperation request to send a data query request to the node equipment, wherein the data query request carries the task identifier of the target cooperation task.
And receiving a second cooperation data packet sent by the node equipment, wherein the second cooperation data packet comprises encrypted second task data of the target cooperation task.
And processing the encrypted second task data to obtain first task data of the target cooperation task.
Optionally, the second cooperative data packet further includes a compression algorithm type and an encryption algorithm type of the second task data, and the obtaining module 701 is specifically configured to:
and decrypting the encrypted second task data by using the compression algorithm type and the encryption algorithm type of the second task data to obtain the second task data.
And performing business processing corresponding to the current task flow of the target cooperation task on the second task data to obtain first task data of the target cooperation task.
Optionally, the processing module 702 is specifically configured to:
and acquiring the next task flow of the target cooperation task.
And determining at least one second cooperative device for processing the next task flow and the operation authority of each second cooperative device on the first task data.
And generating permission configuration information according to the operation permission of each second cooperative device on the first task data, wherein the permission configuration information comprises the identification of each second cooperative device and the operation permission of each second cooperative device on the first task data.
And generating a first cooperation data packet by using the first task data, the task identifier and the authority configuration information according to a predefined data structure.
Optionally, the processing module 702 is specifically configured to:
and processing the first task data according to the compression algorithm type and the encryption algorithm type corresponding to the first task data to obtain encrypted first task data.
And encrypting the encrypted symmetric key of the first task data by using the public key of each second cooperative device to obtain a digital envelope.
And generating a first cooperation data packet by using the digital envelope, the task identifier, the compression algorithm type, the encryption algorithm type and the authority configuration information according to a predefined data structure.
Optionally, the permission configuration information includes a data visible party list and a data writable party list, where the data visible party list includes an identifier of a cooperative device in the at least one second cooperative device that has a read permission for the first task data, and the data writable party list includes an identifier of a cooperative device in the at least one second cooperative device that has a write permission for the first task data.
It should be noted that the functions of the functional modules of the data processing apparatus in the embodiment of the present application may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the related description of the foregoing method embodiment, which is not described herein again.
Please refer to fig. 8, which is a schematic structural diagram of another data processing apparatus according to an embodiment of the present application, where the data processing apparatus according to the embodiment of the present application may be applied to a node device of a blockchain network, and the apparatus includes:
a receiving module 801, configured to receive a call request of a collaboration contract sent by a first collaboration device, where 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, and the permission configuration information is used to indicate an operation permission of at least one second collaboration device on the first task data.
A processing module 802, configured to invoke the collaboration contract to write the first collaboration data packet into a blockchain in response to the call request.
A sending module 803, configured to send a cooperation request to each second cooperative device, where the cooperation request carries a task identifier of the target cooperation task, and the task identifier is used for each second cooperative device to obtain the first cooperation data packet from the node device.
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 second collaboration device.
The processing module 802 is further configured to write the cooperative apparatus registration information into a block chain.
Optionally, the invocation request further includes a private key signature of the first collaboration device, and the apparatus further includes an obtaining module 804, where:
the obtaining module 804 is configured to obtain the registration information of the cooperative device stored in the block chain.
The processing module 802 is further configured to verify a private key signature of the first cooperative device by using the public key of the first cooperative device if the cooperative device registration information includes the identifier of the first cooperative device, and if the verification is passed, execute the step of invoking the cooperation contract to write the first cooperation data packet into the block chain in response to the invocation request.
Optionally, the receiving module 801 is further configured to receive a data query request sent by a target cooperative device in response to the cooperation request, where the data query request carries a task identifier of the target cooperative task, and the target cooperative device is any one of the at least one second cooperative device.
The obtaining module 804 is further configured to obtain the first collaboration data packet from the block chain according to the task identifier of the target collaboration task.
The sending module 803 is further configured to send the first cooperation data packet to the target cooperative apparatus if the target cooperative apparatus is the second cooperative apparatus indicated by the permission configuration information.
Optionally, the first collaboration data packet further includes a first data version number of the target collaboration task,
the receiving module 801 is further configured to receive a call request of a collaboration contract sent by the target collaboration device, where 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.
The processing module 802 is further configured to call the collaboration contract to write the third collaboration data packet into the block chain in response to the call request if the difference between the first data version number and the second data version number is a preset value.
It should be noted that the functions of each functional module of the data processing apparatus in the embodiment of the present application may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the relevant description of the foregoing method embodiment, which is not described herein again.
Fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application, where the computer device according to the embodiment of the present application includes a power supply module and the like, and includes a processor 901, a storage 902, and a network interface 903. The processor 901, the storage 902, and the network interface 903 may exchange data with each other.
The storage 902 may include a volatile memory (volatile memory), such as a random-access memory (RAM); the storage 902 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a solid-state drive (SSD), etc.; the storage 902 may also comprise a combination of memories of the kind described above.
The processor 901 may be a Central Processing Unit (CPU). 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 902 is used to store program instructions.
In some possible embodiments, when the computer device is the first collaboration device, the processor 901 may call the program instructions to perform the following operations:
first task data and a task identifier of the target cooperation task are obtained.
And generating a first cooperation data packet according to the first task data and the task identifier of the target cooperation task, wherein the first cooperation data packet comprises the task identifier, the encrypted first task data and permission configuration information, and the permission configuration information is used for indicating the operation permission of at least one second cooperation device on the first task data.
The calling network interface 903 sends a calling request of a collaboration contract to a node device of a blockchain network, where the calling request carries the first collaboration data packet, and the calling request is used to instruct the node device to write the first collaboration data packet into a blockchain by calling the collaboration contract, and send a collaboration request to each second collaboration device.
Optionally, the processor 901 is specifically configured to:
determining initial task data of a target cooperation task, and taking the initial task data as first task data of the target cooperation task.
And generating a task identifier of the target cooperation task.
Optionally, the processor 901 is specifically configured to:
and calling the network interface 903 to receive a cooperation request sent by a node device of the block chain network, wherein the cooperation request carries a task identifier of a target cooperation task.
And responding to the cooperation request, calling the network interface 903 to send a data query request to the node device, where the data query request carries the task identifier of the target cooperation task.
And calling the network interface 903 to receive a second cooperation data packet sent by the node device, where the second cooperation data packet includes the encrypted second task data of the target cooperation task.
And processing the encrypted second task data to obtain first task data of the target cooperation task.
Optionally, the second cooperative 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:
and decrypting the encrypted second task data by using the compression algorithm type and the encryption algorithm type of the second task data to obtain the second task data.
And performing business processing corresponding to the current task flow of the target cooperation task on the second task data to obtain first task data of the target cooperation task.
Optionally, the processor 901 is specifically configured to:
and acquiring the next task flow of the target cooperation task.
And determining at least one second cooperative device for processing the next task flow and the operation authority of each second cooperative device on the first task data.
And generating permission configuration information according to the operation permission of each second cooperative device on the first task data, wherein the permission configuration information comprises the identification of each second cooperative device and the operation permission of each second cooperative device on the first task data.
And generating a first cooperation data packet by using the first task data, the task identifier and the authority configuration information according to a predefined data structure.
Optionally, the processor 901 is specifically configured to:
and processing the first task data according to the compression algorithm type and the encryption algorithm type corresponding to the first task data to obtain encrypted first task data.
And encrypting the encrypted symmetric key of the first task data by using the public key of each second cooperative device to obtain a digital envelope.
And generating a first cooperation data packet by using the digital envelope, the task identifier, the compression algorithm type, the encryption algorithm type and the authority configuration information according to a predefined data structure.
Optionally, the permission configuration information includes a data visible party list and a data writable party list, where the data visible party list includes an identifier of a cooperative device that has a read permission for the first task data in the at least one second cooperative device, and the data writable party list includes an identifier of a cooperative device that has a write permission for the first task data in the at least one second cooperative device.
In some possible embodiments, when the computer device is a node device of the above-mentioned blockchain network, the processor 901 may invoke the program instructions to perform the following operations:
the calling network interface 903 receives a calling request of a collaboration contract sent by a first collaboration device, where the calling 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, and the permission configuration information is used to indicate an operation permission of at least one second collaboration device on the first task data.
And calling the collaboration contract to write the first collaboration data packet into a block chain in response to the calling request.
And calling the network interface 903 to send a cooperation request to each second cooperative device, where the cooperation request carries a task identifier of the target cooperation task, and the task identifier is used for each second cooperative device to obtain the first cooperation data packet from the node device.
Optionally, the processor 901 is further configured to:
and calling the network interface 903 to receive the collaboration contract and the 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.
And writing the cooperative equipment registration information into a block chain.
Optionally, the invocation request further includes a private key signature of the first cooperative device, and the processor 901 is further configured to:
and acquiring the registration information of the cooperative equipment stored in the block chain.
If the cooperative device registration information includes the identifier of the first cooperative device, verifying the private key signature of the first cooperative device by using the public key of the first cooperative device, and if the verification is passed, executing the step of calling the cooperative contract to write the first cooperative data packet into the block chain in response to the calling request.
Optionally, the processor 901 is further configured to:
and calling the network interface 903 to receive a data query request sent by a target cooperative device in response to the cooperation request, wherein the data query request carries a task identifier of the target cooperative task, and the target cooperative device is any one of the at least one second cooperative device.
And acquiring the first cooperation data packet from the block chain according to the task identifier of the target cooperation task.
If the target cooperative device is the second cooperative device indicated by the permission configuration information, the network interface 903 is called to send the first cooperative data packet to the target cooperative device.
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:
the network interface 903 is invoked to receive a call request of a collaboration contract sent by the target collaboration device, where 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 encrypted first task data included in the first collaboration data packet.
And if the difference between the first data version number and the second data version number is a preset value, the third collaboration data packet is written into the block chain by calling the collaboration contract in response to the calling request.
In a specific implementation, the processor 901, the storage device 902, and the network interface 903 described in this embodiment of the present application may execute the implementation described in the related embodiment of the data processing method provided in fig. 2 to fig. 6 in this embodiment of the present application, and may also execute the implementation described in the related embodiment of the data processing device provided in fig. 7 and fig. 8 in this embodiment of the present application, which is not described herein again.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments. The technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be implemented in the form of a software product stored in a storage medium, and including several instructions to enable a computer device (which may be a personal computer, a server, or a network device, and may specifically be a processor in the computer device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. The storage medium may include: a U-disk, a removable hard disk, a magnetic disk, an optical disk, a Read-Only Memory (ROM) or a Random Access Memory (RAM), and other various media capable of storing program codes.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present application.

Claims (15)

1. A data processing method based on a block chain network is applied to a first cooperative device, and the method comprises the following steps:
acquiring first task data and a task identifier of a target cooperation task;
generating a first cooperation data packet according to first task data and a task identifier of the target cooperation task, wherein the first cooperation data packet comprises the task identifier, the encrypted first task data and permission configuration information, and the permission configuration information is used for indicating the operation permission of at least one second cooperation device on the first task data;
and sending a calling request of a cooperation contract to node equipment of a block chain network, wherein the calling request carries the first cooperation data packet, and the calling request is used for indicating the node equipment to write the first cooperation data packet into the block chain by calling the cooperation contract and sending a cooperation request to each second cooperation equipment.
2. The method of claim 1, wherein obtaining the first task data and task identification of the target collaboration task comprises:
determining initial task data of a target cooperation task, and taking the initial task data as first task data of the target cooperation task;
and generating a task identifier of the target cooperation task.
3. The method of claim 1, wherein obtaining the first task data and task identification of the target collaboration task comprises:
receiving a cooperation request sent by node equipment of a block chain network, wherein the cooperation request carries a task identifier of a target cooperation task;
responding the cooperation request to send a data query request to the node equipment, wherein the data query request carries a task identifier of the target cooperation task;
receiving a second cooperation data packet sent by the node device, wherein the second cooperation data packet comprises encrypted second task data of the target cooperation task;
and processing the encrypted second task data to obtain first task data of the target cooperation task.
4. The method according to claim 3, wherein the second collaboration data packet further includes a compression algorithm type and an encryption algorithm type of the second task data, and the processing the encrypted second task data to obtain the first task data of the target collaboration task includes:
decrypting the encrypted second task data by using the compression algorithm type and the encryption algorithm type of the second task data to obtain the second task data;
and performing business processing corresponding to the current task flow of the target cooperation task on the second task data to obtain first task data of the target cooperation task.
5. The method according to any one of claims 1 to 4, wherein the generating a first collaboration data packet according to the first task data and the task identifier of the target collaboration task comprises:
acquiring a next task flow of the target cooperation task;
determining at least one second cooperative device for processing the next task flow and the operation authority of each second cooperative device on the first task data;
generating permission configuration information according to the operation permission of each second cooperative device on the first task data, wherein the permission configuration information comprises the identification of each second cooperative device and the operation permission of each second cooperative device on the first task data;
and generating a first cooperation data packet by using the first task data, the task identifier and the authority configuration information according to a predefined cooperation data structure.
6. The method of claim 5, wherein generating a first collaboration data packet using the first task data, the task identifier, and the permission configuration information according to a predefined collaboration data structure comprises:
processing the first task data according to the compression algorithm type and the encryption algorithm type corresponding to the first task data to obtain encrypted first task data;
encrypting the symmetric key of the encrypted first task data by using the public key of each second cooperative device to obtain a digital envelope;
and generating a first cooperation data packet by using the digital envelope, the task identifier, the compression algorithm type, the encryption algorithm type and the authority configuration information according to a predefined data structure.
7. The method of claim 1, wherein the permission configuration information comprises a data-visible list and a data-writable list, wherein the data-visible list comprises an identification of a collaborating device of the at least one second collaborating device that has a read permission for the first task data, and the data-writable list comprises an identification of a collaborating device of the at least one second collaborating device that has a write permission for the first task data.
8. A data processing method based on a block chain network is applied to a node device of the block chain network, and the method comprises the following steps:
receiving a calling request of a collaboration contract sent by first collaboration equipment, wherein the calling request comprises a first collaboration data packet, the first collaboration data packet comprises a task identifier of a target collaboration task, encrypted first task data and permission configuration information, and the permission configuration information is used for indicating operation permission of at least one second collaboration equipment on the first task data;
calling the collaboration contract to write the first collaboration data packet into a blockchain in response to the call request;
and sending a cooperation request to each second cooperative device, where the cooperation request carries a task identifier of the target cooperation task, and the task identifier is used for each second cooperative device to obtain the first cooperation data packet from the node device.
9. The method of claim 8, further comprising:
receiving a cooperation contract and cooperation device registration information sent by a contract issuing device, wherein the cooperation device registration information comprises the identification of the first cooperation device and the identification of each second cooperation device;
and writing the cooperative equipment registration information into a block chain.
10. The method according to claim 8 or 9, wherein the invocation request further includes a private key signature of the first collaboration device, and wherein the method further comprises, before invoking the collaboration contract to write the first collaboration data packet into a blockchain in response to the invocation request:
acquiring cooperative equipment registration information stored in a block chain;
if the cooperative device registration information includes the identifier of the first cooperative device, verifying a private key signature of the first cooperative device by using a public key of the first cooperative device;
and if the verification is passed, executing the step of calling the collaboration contract to write the first collaboration data packet into the block chain in response to the calling request.
11. Method according to claim 8 or 9, wherein after said sending of a cooperation request to each second cooperative device, the method further comprises:
receiving a data query request sent by a target cooperative device in response to the cooperation request, wherein the data query request carries a task identifier of the target cooperative task, and the target cooperative device is any one of the at least one second cooperative device;
acquiring the first cooperation data packet from the block chain according to the task identifier of the target cooperation task;
and if the target cooperative device is the second cooperative device indicated by the permission configuration information, sending the first cooperative data packet to the target cooperative device.
12. The method of claim 11, wherein the first collaboration data packet further includes a first data version number of the target collaboration task, the method further comprising:
receiving a calling request of a collaboration contract sent by the target collaboration device, where the calling 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 encrypted first task data included in the first collaboration data packet;
and if the difference between the first data version number and the second data version number is a preset value, calling the collaboration contract to write the third collaboration data packet into the block chain in response to the calling request.
13. A data processing apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring first task data and task identification of the target cooperation task;
the processing module is used for generating a first cooperation data packet according to first task data and a task identifier of the target cooperation task, wherein the first cooperation data packet comprises the task identifier, the encrypted first task data and permission configuration information, and the permission configuration information is used for indicating the operation permission of at least one second cooperation device on the first task data;
a sending module, configured to send a call request of a cooperation contract to a node device of a block link network, where the call request carries the first cooperation data packet, and the call request is used to instruct the node device to write the first cooperation data packet into a block link by calling the cooperation contract, and send a cooperation request to each second cooperation device.
14. A data processing apparatus, characterized in that the apparatus comprises:
a receiving module, configured to receive a call request of a collaboration contract sent by a first collaboration device, where 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, and the permission configuration information is used to indicate an operation permission of at least one second collaboration device on the first task data;
the processing module is used for responding to the calling request and calling the collaboration contract to write the first collaboration data packet into a block chain;
a sending module, configured to send a cooperation request to each second cooperative device, where the cooperation request carries a task identifier of the target cooperative task, and the task identifier is used for each second cooperative device to obtain the first cooperative data packet from the node device.
15. A computer-readable storage medium, characterized in that the computer storage medium stores a computer program comprising program instructions which are executed by a processor to perform the method of data processing based on a blockchain network according to any one of claims 1 to 7 or the method of data processing based on a blockchain network according to any one of claims 8 to 12.
CN202110955601.8A 2021-08-19 2021-08-19 Data processing method and device based on block chain network and storage medium Pending CN115714656A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110955601.8A CN115714656A (en) 2021-08-19 2021-08-19 Data processing method and device based on block chain network and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110955601.8A CN115714656A (en) 2021-08-19 2021-08-19 Data processing method and device based on block chain network and storage medium

Publications (1)

Publication Number Publication Date
CN115714656A true CN115714656A (en) 2023-02-24

Family

ID=85230097

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110955601.8A Pending CN115714656A (en) 2021-08-19 2021-08-19 Data processing method and device based on block chain network and storage medium

Country Status (1)

Country Link
CN (1) CN115714656A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116827682A (en) * 2023-08-23 2023-09-29 腾讯科技(深圳)有限公司 Data processing method and device and computer equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116827682A (en) * 2023-08-23 2023-09-29 腾讯科技(深圳)有限公司 Data processing method and device and computer equipment
CN116827682B (en) * 2023-08-23 2023-11-24 腾讯科技(深圳)有限公司 Data processing method and device and computer equipment

Similar Documents

Publication Publication Date Title
WO2021179661A1 (en) Cross-blockchain data mutual storage method, apparatus and device, and storage medium
WO2020082894A1 (en) Blockchain-based data deposit and acquisition methods and devices
CN110870254B (en) Method and system for providing distributed private subspaced data structures
WO2020088109A1 (en) Blockchain-based private transactions and usage method and apparatus therefor
CN112003858B (en) Block chain-based platform docking method, electronic device and storage medium
CN111476572B (en) Block chain-based data processing method, device, storage medium and equipment
US20230316273A1 (en) Data processing method and apparatus, computer device, and storage medium
CN110572262A (en) Block chain alliance chain construction method, device and system
TWI727284B (en) Block chain-based privacy transaction method, device and computer equipment, application method based on block chain privacy transaction and computer equipment
CN110569251A (en) Data processing method, related equipment and computer readable storage medium
WO2020125234A1 (en) Blockchain-based data processing method and apparatus
CN111127021B (en) Service request method and device based on block chain
CN110992178A (en) Verification method and device for block chain node, computer equipment and storage medium
CN113255014B (en) Data processing method based on block chain and related equipment
WO2021204044A1 (en) Correction of blockchain data
WO2020140672A1 (en) Blockchain-based asset data processing method, system and storage medium
CN111241557A (en) Service request method and device based on block chain
CN112149077B (en) Supply chain billing method, system and computer equipment based on block chain technology
CN109936620B (en) Block chain-based storage method, device, system and storage medium
CN109840769B (en) Block chain based evidence storing method, device, system and storage medium
CN113011974A (en) Transaction information evidence storing method and system based on block chain
JP2018098564A (en) Distributed ledger system and program
CN108920976A (en) A kind of contract signing method, apparatus and system
CN110659993A (en) Resource management method and device based on block chain network
CN115705601A (en) Data processing method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40088365

Country of ref document: HK