Data processing method, device and equipment based on block chain and readable storage medium
By adopting blockchain-based data processing methods in the online approval system, the problem of insufficient security and fault tolerance of existing systems is solved, and higher security and reliability of the approval process are achieved.
Patent Information
- Application Number
- CN202311554090.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-17
- Publication Date
- 2025-05-20
AI Technical Summary
The existing online approval system relies on a centralized approval flow system, which has problems such as low security and insufficient fault tolerance, which is prone to lag in the approval process or data tampering due to single point of failure or attack.
Using blockchain-based data processing method, by receiving approval application transactions, calling approval application processing contracts to generate target approval application information identification, and storing it in the target approval application information storage space. Then, an approval notice is sent to M approval nodes through the contract, and the approval status is updated according to the node approval results.
By recording all approval data on an immutable blockchain, the transparency and credibility of the approval process are improved, and a single point of failure is avoided to affect the entire approval process, thereby improving the security and fault tolerance of online approval.
Smart Images

Figure CN120020783A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a data processing method, apparatus, device, and readable storage medium based on blockchain. Background Art
[0002] With the rapid development of modern society and technology, online approval has become one of the indispensable management methods for various enterprises, organizations, or departments. Online approval means that the approver submits an approval application online, and then the reviewer approves the approver's approval application online, eliminating the need for the approver to find the reviewer for on-site review, which can save a large amount of manpower and time.
[0003] However, existing online approvals usually adopt a centralized approval flow system, that is, the services of the approval flow system are usually deployed on a single central server or platform. Once the central server or platform on which the approval flow system depends fails or is attacked, problems such as approval process jams and approval data tampering may occur. Therefore, the security of existing online approvals is relatively low. Summary of the Invention
[0004] Embodiments of this application provide a data processing method, apparatus, device, and readable storage medium based on blockchain, which can improve the security and fault tolerance of online approval.
[0005] On the one hand, embodiments of this application provide a data processing method based on blockchain, including:
[0006] Receiving an approval application transaction sent by an approval application object; the approval application transaction includes approval application information;
[0007] Invoking an approval application processing contract according to the approval application transaction, generating a target approval application information identifier for the approval application information through the approval application processing contract, and storing the target approval application information identifier, approval application information, and the being-approved status in a target approval application information storage space;
[0008] Sending an approval notice for the approval application information to M approval nodes through the approval application processing contract; M is a positive integer;
[0009] When receiving the node approval results respectively generated by the M approval nodes according to the approval notice, performing an approval status update process on the being-approved status in the target approval information storage space according to the M node approval results.
[0010] On the one hand, embodiments of this application provide a data processing apparatus based on blockchain, including:
[0011] A receiving module, configured to receive an approval application transaction sent by an approval application object; the approval application transaction includes approval application information;
[0012] A generation module, configured to call an approval application processing contract according to an approval application transaction, and generate a target approval application information identifier for the approval application information through the approval application processing contract;
[0013] A storage module, configured to store the target approval application information identifier, the approval application information, and the under-approval status in a target approval application information storage space;
[0014] A notification module, configured to send an approval notification for the approval application information to M approval nodes through the approval application processing contract; M is a positive integer;
[0015] An update module, configured to, when receiving the node approval results respectively generated by the M approval nodes according to the approval notification, perform an approval status update process on the under-approval status in the target approval information storage space according to the M node approval results.
[0016] Among them, the generation module includes:
[0017] A time acquisition unit, configured to call an approval application processing contract according to an approval application transaction, and acquire a system timestamp corresponding to the system time through the approval application processing contract;
[0018] A splicing unit, configured to splice the approval application object identifier and the system timestamp to obtain a target approval application information identifier.
[0019] Among them, the approval application information includes a target approval application information type;
[0020] The notification module includes:
[0021] A list acquisition unit, configured to acquire an approval node identifier list through the approval application processing contract; the approval node identifier list includes one or more approval node identifiers and the approval application information types respectively associated with each approval node identifier; an approval node identifier refers to the node identifier corresponding to an approval node with approval authority;
[0022] An identifier acquisition unit, configured to acquire M approval node identifiers from the approval node identifier list; the approval application information types respectively associated with the M approval node identifiers all include the target approval application information type;
[0023] A sending unit, configured to determine the M approval nodes respectively associated with the M approval node identifiers as M approval nodes, and send an approval notification for the approval application information to the M approval nodes.
[0024] Among them, the update module includes:
[0025] A quantity determination unit for determining the quantity of approval pass results and the quantity of approval objection results for the approval application information according to the approval results of M nodes;
[0026] A passing processing unit for updating the in - approval status in the target approval information storage space to the approval - passed status if the quantity of approval pass results is greater than or equal to the first voting threshold;
[0027] An objection processing unit for updating the in - approval status in the target approval information storage space to the approval - not - passed status if the quantity of approval objection results is greater than the second voting threshold.
[0028] Among them, the approval application information includes the target approval application information type;
[0029] A notification module, including:
[0030] A priority acquisition unit for obtaining a node approval priority list associated with the target approval application information type through an approval application processing contract; the node approval priority list includes M approval node identifiers and the approval priorities respectively corresponding to the M approval node identifiers;
[0031] A traversal unit for traversing the node approval order list according to the approval priorities respectively corresponding to the M approval node identifiers to obtain the i - th approval node identifier; the approval priority corresponding to the i - th approval node identifier is less than the approval priority corresponding to the (i - 1)-th approval node identifier; i is a positive integer less than or equal to M;
[0032] The traversal unit is also used to send an approval notice for the approval application information to the approval node corresponding to the i - th approval node identifier, so that the approval node corresponding to the i - th approval node identifier processes the approval application information according to the approval notice to obtain the i - th approval result;
[0033] The traversal unit is also used to continue to obtain the (i + 1)-th approval node identifier when it is determined that the i - th approval result is an approval pass result until approval notices for the approval application information are sent to all M approval nodes.
[0034] Among them, the above - mentioned data processing device further includes:
[0035] A traversal stop module for stopping traversing the node approval order list when it is determined that the i - th approval result is an approval - not - passed result;
[0036] The traversal stop module is also used to update the in - approval status in the target approval information storage space to the approval - not - passed status, generate an approval failure prompt message according to the approval - not - passed status and the i - th approval result, and send the approval failure prompt message to the approval application object.
[0037] Among them, the target approval application information storage space includes a space identification field, an approval application information field, and an approval status field;
[0038] A storage module, including:
[0039] A first writing unit, configured to write the target approval application information identifier into the space identification field;
[0040] A second writing unit, configured to write the approval information field into the approval application information field;
[0041] A third writing unit, configured to store the under-approval status into the approval status field.
[0042] Among them, the target approval application information storage space further includes an approval result record field;
[0043] The above data processing device further includes:
[0044] A field creation module, configured to create M node approval result record sub-fields in the approval result record field;
[0045] A result record module, configured to traverse the M node approval results to obtain the kth node approval result; k is a positive integer less than M;
[0046] The result record module is further configured to write the kth node approval result and the approval object information associated with the kth node approval result into the kth node approval result record sub-field in the approval result record field; the approval object information associated with the kth node approval result refers to the object information of the approval object corresponding to the approval node that generates the kth node approval result.
[0047] Among them, the approval application information includes the approval application object information corresponding to the approval application object;
[0048] The above data processing device further includes:
[0049] A query module, configured to receive an approval query request sent by an approval query object; the approval query request includes a target approval application information identifier and approval query object information;
[0050] The query module is further configured to obtain the target approval information storage space from the approval application processing contract according to the target approval application information identifier included in the approval query request;
[0051] The query module is further configured to, if the approval application object information stored in the target approval information storage space is the same as the approval query object information, send the approval status stored in the target approval information storage space to the approval query object.
[0052] Among them, the above data processing device further includes:
[0053] A signature verification module, configured to obtain signature data associated with an approval application transaction;
[0054] The signature verification module is further configured to obtain the public key of the approval application object, verify the signature data through the public key, and obtain a signature verification result;
[0055] The signature verification module is further configured to, if the signature verification result is successful signature verification, execute the step of calling an approval application processing contract according to the approval application transaction, and generating a target approval application information identifier for the approval application information through the approval application processing contract; The signature data belonging to successful signature verification is obtained by signing the approval application transaction with the private key owned by the approval application object;
[0056] The signature verification module is further configured to, if the signature verification result is failed signature verification, send an approval application error prompt message to the approval application object.
[0057] Among them, the approval application information includes approval application object information and a target approval application information type;
[0058] The above data processing device further includes:
[0059] An authorization verification module, configured to call a set of authorization application objects in an approval application processing contract according to the approval application transaction; The set of authorization application objects includes authorization object information of at least two authorization application objects and an authorization application information type associated with each authorization application object;
[0060] The authorization verification module is further configured to traverse the set of authorization application objects according to the approval application object information;
[0061] The authorization verification module is further configured to, if authorization object information identical to the approval application object information is traversed in the set of authorization application objects, obtain the authorization application information type associated with the authorization object information identical to the approval application object information as the authorization application information type to be compared;
[0062] The authorization verification module is further configured to, if the authorization application information type to be compared includes the target approval application information type, execute the step of calling an approval application processing contract according to the approval application transaction, and generating a target approval application information identifier for the approval application information through the approval application processing contract;
[0063] The authorization verification module is further configured to, if the authorization application information type to be compared does not include the target approval application information type, send an authorization error prompt message to the approval application object.
[0064] An embodiment of the present application provides a computer device on the one hand, including: a processor, a memory, and a network interface;
[0065] The above-mentioned processor is connected to the above-mentioned memory and the above-mentioned network interface. Among them, the above-mentioned network interface is used to provide a data communication network element, the above-mentioned memory is used to store a computer program, and the above-mentioned processor is used to call the above-mentioned computer program to execute the method in the embodiment of the present application.
[0066] On the one hand, an embodiment of the present application provides a computer-readable storage medium. A computer program is stored in the above-mentioned computer-readable storage medium, and the above-mentioned computer program is suitable for being loaded and executed by a processor to execute the method in the embodiment of the present application.
[0067] On the one hand, an embodiment of the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions. The computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method in the embodiment of the present application.
[0068] In the embodiment of the present application, an approval application transaction sent by an approval application object is received. The approval application transaction includes approval application information; then, an approval application processing contract is called according to the approval application transaction, and a target approval application information identifier is generated for the approval application information through the approval application processing contract. The target approval application information identifier, the approval application information, and the pending approval status are stored in a target approval application information storage space; then, an approval notice for the approval application information is sent to M approval nodes through the approval application processing contract, where M is a positive integer; when the node approval results respectively generated by the M approval nodes according to the approval notice are received, the approval status update process is performed on the pending approval status in the target approval information storage space according to the M node approval results. Through the method provided by the embodiment of the present application, all approval data will be recorded in an immutable blockchain, ensuring the transparency and credibility of the approval process, and not being affected by the failure of a single node for the entire approval process, thereby improving the security and fault tolerance of online approval. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0070] Figure 1 It is a schematic structural diagram of a blockchain network provided by an embodiment of the present application;
[0071] Figure 2aIt is a schematic diagram of an application scenario of an online approval application based on a blockchain provided by an embodiment of the present application;
[0072] Figure 2b It is a schematic diagram of an application scenario of an online approval based on a blockchain provided by an embodiment of the present application;
[0073] Figure 3 It is a schematic flowchart of a data processing method based on a blockchain provided by an embodiment of the present application;
[0074] Figure 4 It is a schematic flowchart of a data processing method based on a blockchain provided by an embodiment of the present application;
[0075] Figure 5 It is a schematic interaction flowchart of a simultaneous approval method based on a blockchain network provided by an embodiment of the present application;
[0076] Figure 6 It is a schematic interaction flowchart of a step-by-step approval method based on a blockchain network provided by an embodiment of the present application;
[0077] Figure 7 It is a schematic structural diagram of a data processing device based on a blockchain provided by an embodiment of the present application;
[0078] Figure 8 It is a schematic structure of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0079] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present application belong to the scope protected by the present application.
[0080] For the convenience of understanding, the following is a simple explanation of some terms first:
[0081] 1. Blockchain: Narrowly, a blockchain is a chain-like data structure with blocks as the basic unit. In a block, a digital digest is used to verify the previous transaction history, which is suitable for the requirements of anti-tampering and scalability in a distributed ledger scenario; Broadly, a blockchain also refers to the distributed ledger technology implemented by the blockchain structure, including distributed consensus, privacy and security protection, peer-to-peer communication technology, network protocol, smart contract, etc.
[0082] The goal of blockchain is to implement a distributed data record ledger that only allows addition and not deletion. The basic structure at the bottom of the ledger is a linear linked list. The linked list is composed of "blocks" connected in series. The hash value of the previous block is recorded in the subsequent block. Whether each block (and the transactions in the block) is legal can be quickly verified by calculating the hash value. If a node in the network proposes to add a new block, the consensus mechanism must reach a consensus and confirmation on the block.
[0083] 2. Block: A data packet that carries transaction data on the blockchain network. It is a data structure marked with a timestamp and the hash value corresponding to the previous block. The block is verified by the consensus mechanism of the network and the transactions in the block are confirmed. A block includes a block header and a block body. The block header can record the meta-information of the current block, including the current version number, the hash value corresponding to the previous block, the timestamp, the nonce, the hash value of the Merkle root, etc. The block body can record the detailed data generated within a period of time, including all the transaction records or other information verified in the current block and generated during the block creation process. It can be understood as a form of the ledger. In addition, the detailed data of the block body can include generating a unique Merkle Root through the hashing process of the Merkle Tree and recording it in the block header.
[0084] The previous block, also known as the parent block, the blockchain realizes temporal sorting by recording the hash value corresponding to the block and the hash value corresponding to the parent block in the block header.
[0085] 3. Hash value: Also known as the information fingerprint or fingerprint, the hash value is generated by converting input data of any length into a cipher through a hash algorithm and performing a fixed output. The original input data cannot be retrieved by decrypting the hash value. It is a one-way encryption function. In blockchain, each block (except the initial block) contains the hash value of the previous block. The hash value is the potential core foundation and the most important aspect in blockchain technology. It preserves the authenticity of recording and viewing data, as well as the integrity of the blockchain as a whole.
[0086] 4. Smart Contract: The concept of a smart contract has three elements: commitment, agreement, and digital form. Therefore, it can extend the application scope of blockchain to all aspects of financial industry transactions, payments, settlements, and clearings. A smart contract means that when a pre-programmed condition is triggered, the corresponding contract terms are immediately executed. Its working principle is similar to the if-then statement of a computer program.
[0087] Please refer to Figure 1 , Figure 1 which is a schematic structural diagram of a blockchain network provided by an embodiment of the present application. As shown in Figure 1 the blockchain network corresponding to the blockchain node system, it may include, but is not limited to, the blockchain network corresponding to the consortium chain. The blockchain network may include multiple blockchain nodes. The multiple blockchain nodes may specifically include blockchain node 10a, blockchain node 10b, blockchain node 10c, blockchain node 10d,..., blockchain node 10n. Among them, each blockchain node can receive data sent from the outside world during normal operation and perform block on-chain processing based on the received data, and can also send data to the outside world. To ensure data intercommunication between each blockchain node, there may be a data connection between each blockchain node. For example, there is a data connection between blockchain node 10a and blockchain node 10b, a data connection between blockchain node 10a and blockchain node 10c, and a data connection between blockchain node 10b and blockchain node 10c.
[0088] It can be understood that the above data connection is not limited to the connection method, and can be directly or indirectly connected through wired communication, or can be directly or indirectly connected through wireless communication, or can also be connected through other connection methods, which are not limited in this application.
[0089] It can be understood that data or blocks can be transmitted between blockchain nodes through the above data connection. The blockchain network can realize the data connection between blockchain nodes based on the node identifier. For each blockchain node in the blockchain network, it has a corresponding node identifier, and each of the above blockchain nodes can store the node identifiers of other blockchain nodes that are connected to itself, so as to broadcast the obtained data or generated blocks to other blockchain nodes according to the node identifiers of other blockchain nodes in the future. For example, blockchain node 10a can maintain a node identifier list as shown in Table 1, and this node identifier list stores the node names and node identifiers of other nodes:
[0090] Table 1
[0091] Node Name Node Identifier Node 10a AAA.AAA.AAA.AAA Node 10b BBB.BBB.BBB.BBB Node 10c CCC.CCC.CCC.CCC Node 10d DDD.DDD.DDD.DDD … … Node 10n EEE.EEE.EEE.EEE
[0092] Among them, the node identifier can be the Internet Protocol (IP) address for interconnection between networks and any other information that can be used to identify nodes in the blockchain network. In Table 1, only the IP address is taken as an example for illustration. For example, blockchain node 10a can send information (such as a block) to blockchain node 10b through the node identifier BBB.BBB.BBB.BBB, and blockchain node 10b can determine that the information is sent by blockchain node 10a through the node identifier AAA.AAA.AAA.AAA.
[0093] Among them, it can be understood that in the above blockchain node system, before a block is chained, the block must go through consensus by the consensus nodes in the blockchain network and can be added to the blockchain only after the consensus is passed. It can be understood that when the blockchain is used in some scenarios of governments or commercial institutions, not all participating nodes in the blockchain (i.e., the blockchain nodes in the above blockchain network) have sufficient resources and necessity to become the consensus nodes of the blockchain. For example, in Figure 1 In the shown blockchain network, blockchain node 10a, blockchain node 10b, blockchain node 10c, and blockchain node 10d can be used as the consensus nodes in the blockchain network. The consensus nodes in the blockchain network participate in the consensus, that is, conduct consensus on the block (including a batch of transactions), that is, vote on the block; while the non-consensus nodes do not participate in the consensus, but will help spread the block and voting messages, and synchronize the states with each other, etc.
[0094] Among them, it can be understood that in the above blockchain node system, one or more smart contracts can be deployed on the blockchain, and these smart contracts can be distinguished by the contract call address, contract identification number (Identity document, ID), or contract name. The smart contract can be understood as a piece of code executed by each blockchain node (usually the consensus node) in the blockchain node system. Through this smart contract, any logic can be executed and a result can be obtained. For example, after the consensus of a certain business transaction is passed by the consensus nodes in the blockchain network, the smart contract deployed on the blockchain can be called to execute the business transaction. Specifically, the contract call address, contract identification number, or contract name of the smart contract can be carried in the business transaction to specify the smart contract that needs to run.
[0095] Among them, it can be understood that in the above blockchain node system, a blockchain node can be configured for any role accessing the blockchain network (such as any individual user, any enterprise, any institution, etc., entity objects). Therefore, in Figure 1In the blockchain network shown, there can be a one-to-one correspondence between blockchain node 10a, blockchain node 10b, blockchain node 10c, blockchain node 10d, …, blockchain node 10n and the corresponding roles that need to access the blockchain network. At this time, in addition to performing its own tasks such as transaction transfer and status synchronization, the blockchain node also needs to perform tasks related to the permissions of the roles. When the above blockchain node system is applied to an approval scenario, the above blockchain node system can be called a blockchain online approval system. At this time, the roles accessing the blockchain online approval system can be divided into two categories. One is the approval application object with the application permission, and the blockchain node corresponding to the approval application object can be called the approval application node. The approval application node can be used to initiate an approval application transaction containing approval application information. The other is the approval object with the approval permission, and the blockchain node corresponding to the approval object can be called the approval node. The approval node is used to approve the approval application information when receiving the approval notice corresponding to the approval application information and return the node approval result.
[0096] It should be understood that the approval application information sent by the approval application node and the node approval result sent by the approval node ultimately need to be recorded on the blockchain. As Figure 1 shown, when a consensus node in the blockchain network (which can be any blockchain node in the above blockchain node system as Figure 1 shown) receives an approval application transaction sent by an approval application object (i.e., the approval application transaction sent by the approval application object through its associated approval application node), it can perform consensus processing of the approval application transaction together with other consensus nodes in the blockchain network. When it is determined that the consensus of the approval application transaction passes, the consensus node can call the approval application processing contract according to the approval application transaction, and then generate a target approval application information identifier for the approval application information through the approval application processing contract, store the target approval application information identifier, approval application information, and the being-approved status in the target approval application information storage space, and then send an approval notice for the approval application information to M approval nodes through the approval application processing contract. Finally, when the consensus node receives the node approval results respectively generated by the M approval nodes according to the approval notice, it performs approval status update processing on the being-approved status in the target approval information storage space, that is, determines the final approval status as the approval-passed status or the approval-not-passed status according to the M node approval results. Among them, M is a positive integer, and specifically which approval nodes perform the approval can be determined by a pre-set approval rule.
[0097] It can be understood that the data processing method provided by the embodiments of the present application can be executed by a computer device, which includes but is not limited to the above blockchain nodes (which can be terminals or servers). The above server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The above terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto.
[0098] It can be understood that the embodiments of the present application can be applied to various scenarios, including but not limited to scenarios such as cloud technology, artificial intelligence, blockchain, and intelligent driving.
[0099] It can be understood that in the specific implementation manner of the present application, for related data such as transaction data and status data, when the above embodiments of the present application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use, and processing of related data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.
[0100] To facilitate understanding of the process of completing approval through the above blockchain online approval system, the application of the above blockchain online approval system to enterprise management is taken as an example for illustration. Please also refer to Figure 2a - Figure 2b . Among them, as Figure 2a - Figure 2b shown, the blockchain node 21 can be any blockchain node in the above Figure 1 shown blockchain network. For example, the blockchain node 21 can be the blockchain node 10a. Among them, as Figure 2a - Figure 2b shown, the approval nodes 22, 23, and 24 can all be any blockchain node in the above Figure 1 shown blockchain network. For example, the approval node 22 can be the blockchain node 10b, the approval node 23 can be the blockchain node 10c, and the approval node 24 can be the blockchain node 10n. Among them, as Figure 2a - Figure 2b shown, the blockchain network 200 can be the blockchain network shown above Figure 1 . It can be understood that the blockchain node 21, the approval node 22, the approval node 23, and the approval node 24 can actually all be blockchain nodes in the blockchain network 200.
[0101] Please refer to Figure 2a , Figure 2aIt is a schematic diagram of an application scenario of an online approval application based on blockchain provided by an embodiment of this application. Assume that Xiao Wang, an employee of Company A, wants to take a one-day leave. Xiao Wang, an employee of Company A, can generate an approval application transaction 201 through his corresponding blockchain node (not shown in the figure), and then broadcast the approval application transaction 201 to the blockchain network 200 so that the blockchain network performs the operation of uploading the transaction to the chain. As Figure 2a shown, assume that the blockchain node 21 in the blockchain network receives the approval application transaction 201. After verifying the legality of the approval application transaction 201, the blockchain node 21 can broadcast a consensus request 202 for the approval application transaction 201 to the blockchain network 200, and then wait for the consensus nodes in the blockchain network 200 to perform consensus on the approval application transaction 201 after receiving the consensus request 202. When the blockchain node 21 determines that the consensus of the approval application transaction 201 passes, the blockchain node 21 can call the approval application processing contract 211, and then generate a unique target approval application information identifier for the approval application information y in the approval application transaction 201 through the approval application processing contract 211. For example, the approval application information identifier x is used to facilitate subsequent differentiation from other approval application information. Then, the blockchain node 21 will store the approval application information identifier x, the approval application information y, and its current approval status (i.e., the under-approval status) together in the approval application processing contract 211. Among them, the approval application information identifier x can be an identifier composed of numbers, characters, etc.; the approval application information y can include the applicant, the application item, the application reason, etc. For example, the approval application information y can be: Applicant: Xiao Wang; Application item: Take a one-day leave; Application reason: Sick.
[0102] As Figure 2a shown, in the approval application processing contract 211, there can be multiple approval application information storage spaces, such as the approval application information storage space 211a, the approval application information storage space 211b,..., the approval application information storage space 211n. Among them, one approval application information storage space is used to store an approval application information and its corresponding approval progress, approval result and other related information. Assume that the blockchain node 21 stores the approval application information y corresponding to the approval application identifier x into the approval application information storage space 211b. As Figure 2aAs shown in the figure, the approval application information storage space 211b may include multiple fields for storing information of different information types. For example, the approval application information storage space 211b may include a space identification field, an approval status field, an approval application information field, and an approval result record field. Of course, fields for storing other information types can also be constructed according to actual situations. Among them, the space identification field is used to store the approval application information identifier that uniquely identifies a certain approval application information; the approval status field is used to store the current approval status of the approval application information. For example, the "under approval" status indicates that the approval application information is under approval; the approval application information field is used to record the approval application information, such as the applicant, application matters, application reasons, etc.; the approval result record field is used to store the approval results given by different approval objects. Therefore, as Figure 2a shown in the figure, when the blockchain node 21 generates an approval application identifier x for the approval application information in the approval application transaction 201, it will write the "approval application identifier x" into the space identification field in the approval application information storage space 211b, and write the "under approval status" into the approval status field in the approval application information storage space 211b; write the "approval application information y" into the approval application information field in the approval application information storage space 211b. At this time, no approval node has approved the approval application information y yet. Therefore, the approval result record field in the approval application information storage space 211b can be empty.
[0103] As Figure 2a shown in the figure, after the blockchain node 21 records the relevant information of the approval application information y in the approval application information storage space 211b, it can generate an approval notice z for the approval application information y, and then send the approval notice z to the approval node corresponding to the leader in enterprise A who is responsible for approving leave in the blockchain network 200. Assuming that in the preset approval process of enterprise A, the personnel responsible for approving leave include the supervisor, the administrator, and the boss, then the blockchain node 21 will send the approval notice z to the approval node 22 corresponding to the supervisor, the approval node 23 corresponding to the administrator, and the approval node 24 corresponding to the boss according to the preset approval process.
[0104] Furthermore, please refer to Figure 2b together, Figure 2b which is a schematic diagram of an application scenario of online approval based on blockchain provided by an embodiment of the present application. As Figure 2b shown in the figure, after receiving the approval notice z, the approval node 22 can display the approval application information y. The supervisor corresponding to the approval node 22 can perform an approval operation on the approval application information y through the approval node 22. The approval node 22 can respond to the supervisor's approval operation, generate a node approval result D1, and then return the node approval result D1 to the blockchain node 21. Similarly, the approval node 23 can generate a node approval result D2, and the approval node 24 can generate a node approval result D3. AsFigure 2b As shown in the figure, after the blockchain node 21 receives the node approval results returned by each approval node, it can perform result statistics and then determine the final approval result. It can be understood that there are various ways to determine the approval result, which can be specifically determined according to the actual situation. For example, a one-vote veto means that as long as there is one rejection result in the node approval results, the final approval result is determined as a non-approval result. Another example is that the minority obeys the majority, that is, as long as more than half of the node approval results are approval results for leave, the final approval result is determined as an approval result. Assume that all the node approval results are approval results for leave. Then the blockchain node 21 can update the approval application information storage space 211b in the approval application processing contract 211, replace the "being approved status" stored in the approval status field in the approval application information storage space 211b with the "approved status", and write the object information of the approval object corresponding to each approval node and the corresponding node approval result into the approval result record field. For example, the approval result record field can store "Supervisor: Approved for leave; Administration: Approved for leave; Boss: Approved for leave".
[0105] Thus, in this application, the approval application information of the approval application object and the node approval results corresponding to each approval object's corresponding approval node are all carried out in real time in the blockchain network, and the relevant information is written into the smart contract on the blockchain, avoiding the risk of the approval application information being tampered with and single-point failures, and improving the security and fault tolerance of online approvals.
[0106] Further, please refer to Figure 3 , Figure 3 which is a schematic flowchart of a data processing method based on blockchain provided by an embodiment of this application. Among them, this method can be executed by a computer device (for example, any blockchain node in the corresponding embodiment of the above Figure 1 ). The following will take this method being executed by a computer device as an example for description. Among them, this data processing method based on blockchain can at least include the following steps S101-step S104:
[0107] Step S101, receiving an approval application transaction sent by an approval application object; the approval application transaction includes approval application information.
[0108] Specifically, the approval application information refers to the information that needs to be reviewed by one or more approval objects. For example, leave applications, funding applications, etc. It can include the object information of the approval application object, the application matters, the application reasons, etc. For example, the approval application information can be: "Approval application object information: Xiao Wang; Application matter: Leave; Application time: Two days; Application reason: Go home". Another example, the approval application information can be "Approval application object information: Xiao Li; Application matter: Expense approval; Application amount: 2000; Application reason: Team building expenses".
[0109] Optionally, when receiving the approval application transaction, the computer device can also obtain the signature data associated with the approval application transaction at the same time, and then obtain the public key of the approval application object, verify the signature data through the public key, and obtain the signature verification result. If the signature verification result is successful signature verification, then execute step S102; if the signature verification result is failed signature verification, then send an approval application error prompt message to the approval application object. Among them, the signature data that belongs to successful signature verification is obtained by signing the approval application transaction with the private key owned by the approval application object. Among them, the public key and the private key are the so-called asymmetric encryption method. The public key is for everyone. That is to say, other blockchain nodes in the blockchain network can obtain the public key of the approval application object; the private key is private, and other blockchain nodes cannot obtain the private key of the approval application object. The approval application object can use its own private key to encrypt the approval application transaction through the associated blockchain node. Since this private key is only owned by the approval application object, a file that cannot be generated by other objects or nodes is generated, which forms a digital signature. The computer device can decrypt the signature data through the public key of the approval application object, that is, verify the signature. Successful signature verification indicates that the signature data is sent by the approval application object and does not accidentally receive an illegal approval application transaction transmitted by other objects or nodes, so step S102 can be continued to be executed.
[0110] Optionally, the approval application information includes approval application object information and a target approval application information type; the authorization application object set in the approval application processing contract is called according to the approval application transaction; the authorization application object set includes authorization object information of at least two authorization application objects and the authorization application information type associated with each authorization application object; the authorization application object set is traversed according to the approval application object information; if authorization object information identical to the approval application object information is found in the authorization application object set, the authorization application information type associated with the authorization object information identical to the approval application object information is obtained as the authorization application information type to be compared; if the authorization application information type to be compared includes the target approval application information type, the step of calling the approval application processing contract according to the approval application transaction and generating a target approval application information identifier for the approval application information through the approval application processing contract is executed; if the authorization application information type to be compared does not include the target approval application information type, a permission error prompt message is sent to the approval application object. Among them, the target approval application information type refers to the approval application information type to which the approval application object information belongs, and the approval application information type can be set according to the actual situation, such as, leave type, funding application type, activity application type, etc.
[0111] For ease of understanding, assume that the authorization object information is an object identification code, and the legal identification codes corresponding to the authorization application objects are stored in the authorization application object set. The authorization application object set 1 includes {xbz165, wqp132, qpz901}, where xbz165, wqb132, and qpz901 respectively correspond to the legal identification codes of an authorization application object. The object identification code of the approval application object 2 extracted by the computer device from the approval application information A is xyz468. Subsequently, the computer device will traverse the authorization application object set 1 to find an identification code identical to xyz468. After traversing, there is no identification code identical to xyz468 in the authorization application object set 1, and the computer device will determine that the approval application object 2 does not have the approval application permission and send a permission error prompt message to the approval application object 2. It can be understood that if the object identification code of the approval application object 3 extracted by the computer device from another approval application information B is qpz901, then the computer device will find an identification code identical to qpz901 in the authorization application object set 1. The computer device will further determine the authorization application information type associated with qpz901. Assume that the associated authorization application information types are leave type and funding application type, and the approval application information type extracted by the computer device from the approval application information B is leave type, which belongs to the authorization application information type associated with qpz901. Therefore, the computer device can determine that the approval application object 3 has the leave permission and thus can execute step S102.
[0112] It can be understood that the computer device can execute one or more of the above verification of the signature data and the verification of the approval application object information and the type of the target approval application information simultaneously. As long as one of the executions fails, the execution of step S102 can be stopped.
[0113] Step S102: Invoke the approval application processing contract according to the approval application transaction, generate a target approval application information identifier for the approval application information through the approval application processing contract, and store the target approval application information identifier, the approval application information, and the under-approval status in the target approval application information storage space.
[0114] Specifically, the target approval application information identifier is an approval application information identifier that is uniquely used to identify the approval application information being processed at this time, that is, the approval application information identifiers corresponding to different approval application information are different. Subsequently, when querying the approval application information, it can be quickly located through its corresponding approval application information identifier.
[0115] Specifically, the generation of the target approval application information identifier can adopt various methods, as long as it can ensure that the generated identifier is unique and will not be repeated with the approval application information identifiers of other approval applications. Assuming that the approval application information includes the approval application object identifier corresponding to the approval application object, a feasible implementation process for generating the target approval application information identifier for the approval application information by invoking the approval application processing contract according to the approval application transaction through the approval application processing contract can be: Invoke the approval application processing contract according to the approval application transaction, and obtain the system timestamp corresponding to the system time through the approval application processing contract; splice the approval application object identifier and the system timestamp to obtain the target approval application information identifier. Among them, different approval application objects will correspond to different approval application object identifiers. Among them, the system timestamp is a way of recording time, usually used to record the occurrence time of an event or the creation and modification time of a file, etc. Simply put, the timestamp is a string of numbers indicating the time length from a certain fixed time point to the present, usually calculated in seconds. It can be understood that only one approval application transaction can be initiated by the same approval application object at a time point. Therefore, by splicing the approval application object identifier and the system timestamp, it can be determined that the obtained target approval application information identifier is unique. For example, if the approval application object identifier corresponding to the approval application object is 210 and the system timestamp at this time is 1699583754, the target approval application information identifier can be 2101699583754.
[0116] Specifically, the target approval application information storage space includes a space identification field, an approval application information field, and an approval status field. A feasible implementation process for storing the target approval application information identifier, the approval application information, and the under-approval status in the target approval application information storage space can be as follows: write the target approval application information identifier into the space identification field, write the approval information field into the approval application information field, and store the under-approval status in the approval status field. For easy understanding, reference can be made to the approval application information storage space 211b shown in the above Figure 2a and details are not elaborated here.
[0117] Step S103: Send an approval notice for the approval application information to M approval nodes through the approval application processing contract; M is a positive integer.
[0118] Specifically, the M approval nodes refer to the blockchain nodes corresponding to M approval objects among the blockchain nodes, and the M approval objects refer to the objects that need to approve the approval application information. The M approval objects are usually determined in advance. Taking an enterprise leave as an example, for an employee's leave application, it usually needs to be approved by the supervisor, the administration, and the boss. In this case, the M approval objects can be the supervisor, the administration, and the boss, and the M approval nodes are the blockchain nodes corresponding to the supervisor, the administration, and the boss on the blockchain respectively.
[0119] Specifically, the approval application information may include the target approval application information type. In this case, a feasible implementation process for sending an approval notice for the approval application information to M approval nodes through the approval application processing contract can be as follows: obtain a list of approval node identifiers through the approval application processing contract; obtain M approval node identifiers from the list of approval node identifiers; the approval application information types associated with the M approval node identifiers all include the target approval application information type; determine the approval nodes associated with the M approval node identifiers as the M approval nodes, and send an approval notice for the approval application information to the M approval nodes. Among them, the list of approval node identifiers includes one or more approval node identifiers and the approval application information types associated with each approval node identifier respectively; an approval node identifier refers to the node identifier corresponding to an approval node with approval authority. For example, the list of approval node identifiers can be as shown in Table 2 below:
[0120] Table 2
[0121] Node Identifier Approval Application Information Type AAA.AAA.AAA.AAA Leave Type BBB.BBB.BBB.BBB Leave Type CCC.CCC.CCC.CCC Funding Application Type DDD.DDD.DDD.DDD Funding Application Type, Leave Type … … EEE.EEE.EEE.EEE Activity Application Type, Funding Application Type
[0122] Among them, different node identifiers correspond to different approval nodes. For example, the node identifier AAA.AAA.AAA.AAA corresponds to the approval node AA. Different approval nodes have different approval authorities. For example, the approval node AA only has the authority to approve the approval application information of the leave type. Assuming that the target approval application information type is the leave type, through Table 2, the computer device can determine that the M approval node identifiers are AAA.AAA.AAA.AAA, BBB.BBB.BBB.BBB, and DDD.DDD.DDD.DDD.
[0123] It should be noted that the approval priorities corresponding to the M approval nodes can be the same or different, and specifically need to be determined according to the actual situation. When the approval priorities among the M approval nodes are the same, the computer device can send the approval notifications to the M approval nodes together; when the approval priorities among the M approval nodes are different, the computer device can send the approval notifications one by one. For example, first send the approval notification to the approval node with the highest approval priority, and after receiving the node approval result returned by the approval node with the highest approval priority, then send the approval notification to the approval node with the second highest approval priority until the approval notifications are sent to all M approval nodes. It can be understood that for different approval notification sending methods, the specific implementation process of the computer device for determining the final approval result will be different. For the sake of understanding, only the case where the approval priorities corresponding to the M approval nodes are the same is described here. The case where the approval priorities corresponding to the M approval nodes are different can be referred to the description in the following Figure 4 corresponding embodiments.
[0124] Step S104, when receiving the node approval results respectively generated by the M approval nodes according to the approval notifications, update the approval status of the approval status in the target approval information storage space according to the M node approval results.
[0125] Specifically, the approval status can include the in - approval status, the approval - passed status, and the approval - not - passed status. Among them, the in - approval status indicates that the approval of the associated approval application information is still in progress. Among them, the approval - passed status indicates that the approval result of the associated approval application information is an approval - passed result. Among them, the approval - not - passed status indicates that the approval result of the associated approval application information is an approval - not - passed result.
[0126] Specifically, when the approval priorities corresponding to the M nodes are the same, the principle of the minority obeying the majority can be adopted to determine the final approval result. For example, if the approval results of more than half of the nodes are approval passing results, or if the approval results of more than 2 / 3 of the nodes are approval passing results, the final approval result can be considered as an approval passing result. That is, a feasible implementation process for updating the approval status of the information storage space under approval in the target approval information storage space according to the approval results of the M nodes can be as follows: determine the number of approval passing results and the number of approval opposing results for the approval application information according to the approval results of the M nodes; if the number of approval passing results is greater than or equal to the first voting threshold, update the status under approval in the target approval information storage space to the approval passing status; if the number of approval opposing results is greater than the second voting threshold, update the status under approval in the target approval information storage space to the approval not passing status. Among them, the first voting threshold can be set arbitrarily based on M. For example, the first voting threshold is one-half or two-thirds of M, or the first voting threshold is just M, directly setting that all members need to agree to the application for it to be approved. Among them, the second voting threshold can be the difference between M and the first voting threshold. For example, when M is 5 and the first voting threshold is 3, then the second voting threshold is 2.
[0127] Optionally, the target approval application information storage space further includes an approval result record field; in the approval result record field, create M node approval result record sub-fields; traverse the approval results of the M nodes to obtain the approval result of the kth node; k is a positive integer less than M; write the approval result of the kth node and the approval object information associated with the approval result of the kth node into the kth node approval result record sub-field in the approval result record field; the approval object information associated with the approval result of the kth node refers to the object information of the approval object corresponding to the approval node that generates the approval result of the kth node. For ease of understanding, please refer to the above Figure 2b shown approval application information storage space 211b, from Figure 2b it can be seen that there are also three node approval result record sub-fields in the approval result record field in the approval application information storage space 211b. The first node approval result record sub-field stores "Supervisor: Agree to the leave", the second node approval result record sub-field stores "Administration: Agree to the leave", and the third node approval result record sub-field stores "Boss: Agree to the leave". It can be understood that storing the object information of different approval objects and the node approval results corresponding to the approval objects separately can clearly and quickly understand the approval opinions of each approval object and is also convenient for subsequent queries.
[0128] Optionally, the approval application information includes the approval application object information corresponding to the approval application object. The blockchain node can receive the approval query request sent by the approval query object. The approval query request includes the target approval application information identifier and the approval query object information. According to the target approval application information identifier included in the approval query request, obtain the target approval information storage space from the approval application processing contract. If the approval application object information stored in the target approval information storage space is the same as the approval query object information, send the approval status stored in the target approval information storage space to the approval query object. It can be understood that in order to protect the privacy of the approval application object information, object verification can be added when making an approval query request for the approval application information, that is, verify whether the approval query object sending the approval query request is the approval application object that initiated the approval application information. Therefore, only when the approval application object information stored in the target approval information storage space is the same as the approval query object information in the approval query request, can the approval query object be allowed to query the relevant information of the approval application information. For example, send the approval status stored in the target approval information storage space to the approval query object.
[0129] Among them, a feasible implementation process of obtaining the target approval information storage space from the approval application processing contract according to the target approval application information identifier included in the approval query request can be: sequentially traverse one or more approval information storage spaces included in the approval application processing contract, obtain the m-th approval information storage space, where m is a positive integer; if the approval application information identifier stored in the space identifier field of the m-th approval information storage space is the same as the target approval application information identifier, determine the m-th approval information storage space as the target approval information storage space and stop traversing; if the approval application information identifier stored in the space identifier field of the m-th approval information storage space is different from the target approval application information identifier, continue to obtain the (m + 1)-th approval information storage space.
[0130] Through the method provided by the embodiments of the present application, all approval data will be recorded in the immutable blockchain, ensuring the transparency and credibility of the approval process, and the entire approval process will not be affected by the failure of a single node, thereby improving the security and fault tolerance of online approval. In addition, smart contract and identity verification technologies are also introduced to ensure the transparency and credibility of the approval process.
[0131] Further, please refer to Figure 4 , Figure 4 which is a schematic flowchart of a blockchain-based data processing method provided by the embodiments of the present application. Among them, this method can be implemented by a computer device (for example, the above Figure 1Execute by any blockchain node in the corresponding embodiment). Hereinafter, an example will be given in which this method is executed by a computer device. Among them, the blockchain-based data processing method may at least include the following steps S201-S207:
[0132] Step S201: Receive an approval application transaction sent by an approval application object; the approval application transaction includes approval application information; the approval application information includes a target approval application information type.
[0133] Specifically, for the implementation process of step S201, refer to the implementation process of step S101 above, which will not be elaborated here.
[0134] Step S202: Invoke an approval application processing contract according to the approval application transaction, generate a target approval application information identifier for the approval application information through the approval application processing contract, and store the target approval application information identifier, the approval application information, and the under-approval status in a target approval application information storage space.
[0135] Specifically, for the implementation process of step S202, refer to the implementation process of step S102 above, which will not be elaborated here.
[0136] Step S203: Obtain a node approval priority list associated with the target approval application information type through the approval application processing contract; the node approval priority list includes M approval node identifiers and the approval priorities respectively corresponding to the M approval node identifiers.
[0137] Specifically, in the approval application processing contract, one or more approval application information types and the node approval priority list associated with each approval application information type may be stored. When receiving approval application information corresponding to the target approval application information type, it is necessary to first obtain the node approval priority list associated with the target approval application information type from the stored node approval priority list. This node approval priority list is actually used to indicate which approval nodes the approval application information corresponding to the target approval application information type needs to go through for approval processing in sequence. For example, a feasible node approval priority list associated with the target approval application information type may be as shown in Table 3 below:
[0138] Table 3
[0139] Node Identifier Approval Priority Node Identifier 1 Level 1 Node Identifier 2 Level 2 Node Identifier 3 Level 3 … … Node Identifier m Level m
[0140] It can be understood that, as shown in Table 3 above, the approval node 1 corresponding to the node identifier 1 with an approval priority of level 1 is the approval node that needs to process the approval application information first. When the node approval result corresponding to approval node 1 is an approval passed result, the approval node 2 corresponding to the node identifier 2 with an approval priority of level 2 needs to process the approval application information, and so on.
[0141] Step S204: Traverse the node approval order list according to the approval priorities respectively corresponding to the M approval node identifiers, and obtain the i-th approval node identifier; the approval priority corresponding to the i-th approval node identifier is less than the approval priority corresponding to the (i - 1)-th approval node identifier; i is a positive integer less than or equal to M.
[0142] Specifically, after the computer device obtains the node approval order list, it will traverse the node approval order list according to the approval priorities respectively corresponding to the M approval node identifiers, that is, first obtain the approval node identifier with the smallest approval priority, and then obtain the approval node identifier with the second smallest priority, and so on. That is to say, during the traversal process of the computer device, the approval priority corresponding to the i-th approval node identifier obtained is less than the approval priority corresponding to the (i - 1)-th approval node identifier.
[0143] Step S205: Send an approval notice for the approval application information to the approval node corresponding to the i-th approval node identifier, so that the approval node corresponding to the i-th approval node identifier processes the approval application information according to the approval notice to obtain the i-th approval result.
[0144] Specifically, the computer device will send approval notices to the approval nodes one by one according to the approval priorities. After the computer device sends an approval notice for the approval application information to the approval node corresponding to the i-th approval node identifier, it will wait for the approval node corresponding to the i-th approval node identifier to process the approval application information according to the approval notice to obtain the i-th approval result. It can be understood that the i-th approval result can be an approval passed result or an approval not passed result. Among them, the approval passed result is used to indicate that the approval object corresponding to the approval node corresponding to the i-th approval node identifier agrees to the approval application information; the approval not passed result is used to indicate that the approval object corresponding to the approval node corresponding to the i-th approval node identifier opposes the approval application information.
[0145] Step S206: When it is determined that the i-th approval result is an approval passed result, continue to obtain the (i + 1)-th approval node identifier until approval notices for the approval application information are sent to all M approval nodes.
[0146] Specifically, only when the computer device receives the i-th approval result and determines that the i-th approval result is an approval-passed result, will the computer device continue to traverse the node approval sequence list, that is, continue to obtain the (i + 1)-th approval node identifier and continue to send an approval notice for the approval application information to the approval node corresponding to the (i + 1)-th approval node identifier. Until the computer device sends approval notices for the approval application information to all M approval nodes, the computer device will determine that the traversal of the node approval sequence list is completed.
[0147] Optionally, when it is determined that the i-th approval result is an approval-failed result, the computer device will stop traversing the node approval sequence list. Since the i-th approval result is an approval-failed result, it indicates that the approval application information cannot pass. The computer device will update the in-approval status in the target approval information storage space to the approval-failed status through the approval application processing contract, generate an approval failure prompt message based on the approval-failed status and the i-th approval result, and send the approval failure prompt message to the approval application object.
[0148] Step S207: When receiving the node approval results respectively generated by the M approval nodes according to the approval notice, perform an approval status update process on the in-approval status in the target approval information storage space according to the M node approval results.
[0149] Specifically, when the computer device sends approval notices to the M approval nodes according to the approval priority, when the computer device receives the M node approval results, it means that the previous M - 1 node approval results are all approval-passed results. At this time, the computer device only needs to determine the M-th received node approval result to perform an approval status update process on the in-approval status in the target approval information storage space, that is, if the M-th received node approval result is an approval-passed result, update the in-approval status in the target approval information storage space to the approval-passed status; if the M-th received node approval result is an approval-failed result, update the in-approval status in the target approval information storage space to the approval-failed status.
[0150] Through the method provided by the embodiments of the present application, different approval processes can be configured for different types of approval application information. When the computer device receives an approval application transaction corresponding to the target approval application information type, it will automatically execute the corresponding approval process. The trigger of the approval process for the next-level approval node will definitely be based on the premise that the node approval result of the previous-level approval node is an approval-passed result, and there will be no problem of process disorder. Moreover, each step of the approval will be recorded on the blockchain, and the protection of approval data is better guaranteed.
[0151] Further, to better understand the implementation process of the above-mentioned approval of approval application information by M approval nodes simultaneously, an example of enterprise approval is used for illustration. Please refer to Figure 5 , Figure 5 FIG. Figure 5 is a schematic diagram of the interaction process of a simultaneous approval method based on a blockchain network provided by an embodiment of the present application. As Figure 5 shown, the entire approval interaction process involves object nodes, approval processing contracts, supervisor approval nodes, administrative approval nodes, and boss approval nodes. Among them, the object node can be a blockchain node corresponding to an employee in the enterprise in the blockchain network. The approval application processing contract is a smart contract deployed in the blockchain network, that is, any blockchain node in the blockchain network (which can be any blockchain node in the blockchain network shown in Figure 1 above, for example, blockchain node 10a) can deploy an approval application processing contract. The data interaction between the approval application processing contract and the object node can be realized by the object node communicating with the blockchain node where the approval application processing contract is deployed. The realization of data interaction with other approval nodes is the same. Among them, the supervisor approval node can be a blockchain node corresponding to a supervisor in the enterprise in the blockchain network. Among them, the administrative approval node can be a blockchain node corresponding to the administration in the enterprise in the blockchain network. Among them, the boss approval node can be a blockchain node corresponding to the boss in the enterprise in the blockchain network.
[0152] As Figure 5 shown, when approvals at all levels are carried out simultaneously, the approval interaction process when an enterprise employee takes leave based on the blockchain network may include the following steps S51 - step S58:
[0153] Step S51, the object node sends an application transaction and signature information for calling the approval application processing contract to the blockchain network.
[0154] Specifically, the application transaction (i.e., the above-mentioned approval application transaction) may include details of the employee's leave application, including the start date of leave, end date of leave, leave type, leave reason, etc. The signature information can be obtained by the object node signing the application transaction with the private key corresponding to the employee.
[0155] Step S52, after receiving the application transaction, the blockchain node in the blockchain network will first verify the signature information and identity permissions through the approval application processing contract.
[0156] Specifically, the approval application processing contract may also include a list of employees with leave permissions. After decrypting the signature information, the identity permissions of the applying employee can also be verified. For the realization of decrypting the signature information and verifying the employee's identity permissions, reference can be made to the optional description of step S101 in the corresponding embodiment shown in Figure 3 above, which will not be elaborated here.
[0157] Step S53, after the application transaction is verified, the blockchain node in the blockchain network can execute the application transaction through the approval application processing contract, obtain the application information, and assign an application ID to the application information.
[0158] Specifically, the application information is as above Figure 3 The approval application information mentioned in , the application ID is the target approval application information identifier, and both the application information and the application ID can be stored in the approval application processing contract for easy query at any time. For specific storage methods, please refer to the above Figure 3 The relevant description of step S102 in the corresponding embodiment will not be repeated here.
[0159] Step S54, when it is determined that the storage is completed, trigger the approval process pre-defined in the approval application processing contract.
[0160] Specifically, the blockchain node can determine which approval nodes the application information needs to pass through the consensus approval of through the approval application processing contract, such as the supervisor approval node, administrative approval node, and boss approval node.
[0161] Step S55, the blockchain nodes in the blockchain network broadcast the approval notification for the application information to each node that needs to be approved.
[0162] Specifically, the blockchain node will broadcast the approval notification to the supervisor approval node, administrative approval node, and boss approval node.
[0163] Step S56, each approval node conducts approval consensus on the application information according to the consensus rules to obtain the approval consensus result.
[0164] Specifically, after the employee's application information is submitted to the approval application processing contract, the approval application processing contract will trigger the approval process and broadcast the approval notification to the approval nodes that need approval. Each approval node will need to vote on the application information to indicate whether it agrees or disagrees. Then, according to the consensus rules, if the unanimous agreement of the vast majority or all nodes is reached, the approval consensus result can be obtained as the approval consensus approval result.
[0165] Step S57, if the approval consensus is passed, the blockchain node in the blockchain network will update the application information in the approval application processing contract and record the approval result.
[0166] Step S58, the blockchain node in the blockchain network returns the approval result to the target node.
[0167] By adopting the method provided in the embodiment of the present application, through multi-party consensus, enterprises can ensure the fairness, credibility and transparency of the approval process, and the voting behavior of each node is recorded on the blockchain and is not easily tampered with, thereby preventing inappropriate behavior and improper interference.
[0168] Furthermore, in order to better understand the implementation process of the above M approval nodes to approve the application information step by step, we take enterprise approval as an example. Please refer to Figure 6 , Figure 6 is a schematic diagram of the interactive process of a step-by-step approval method based on a blockchain network provided in an embodiment of the present application. Figure 6 As shown in the figure, the entire approval interaction process involves object nodes, approval processing contracts, supervisor approval nodes, administrative approval nodes, and blockchain networks. Among them, the object node can be a blockchain node in the blockchain network that corresponds to an employee in the enterprise. The approval application processing contract is a smart contract deployed in the blockchain network, that is, any blockchain node in the blockchain network (which can be the above Figure 1 Any blockchain node in the blockchain network shown, for example, blockchain node 10a) can be deployed with an approval application processing contract. The data interaction between the approval application processing contract and the object node can be realized by communicating with the blockchain node deployed with the approval application processing contract through the object node, and the data interaction with other approval nodes is realized in the same way. Among them, the supervisor approval node can be a blockchain node in the blockchain network corresponding to the supervisor in the enterprise. Among them, the administrative approval node can be a blockchain node in the blockchain network corresponding to the administration in the enterprise.
[0169] If Figure 6 As shown in the figure, when approval is required step by step, the approval interaction process for enterprise employees to apply for leave based on the blockchain network may include the following steps S61-S612:
[0170] Step S61, the object node sends the application transaction and signature information for calling the approval application processing contract to the blockchain network.
[0171] Step S62, after receiving the application transaction, the blockchain node in the blockchain network will first verify the signature information and identity authority through the approval application processing contract.
[0172] Step S63, after the application transaction is verified, the blockchain node in the blockchain network can execute the application transaction through the approval application processing contract, obtain the application information, and assign an application ID to the application information.
[0173] Specifically, the implementation process of step S61 to step S63 can refer to the above Figure 5 The implementation processes of steps S51 - S53 in the corresponding embodiments will not be elaborated here.
[0174] Step S64, when it is determined that the storage is completed, trigger the approval process predefined in the approval application processing contract.
[0175] Specifically, in the hierarchical approval process, it is necessary to first determine which approval node the application information needs to pass through first, for example, the supervisor approval node.
[0176] Step S65, the blockchain node sends an approval notice for the application information to the supervisor approval node through the approval application processing contract.
[0177] Step S66, after the supervisor approval node generates an approval result for the application information, broadcast its approval result to the blockchain network.
[0178] Specifically, the approval result at this time refers to the node approval result, which can only represent the approval opinion of the supervisor.
[0179] Step S67, after the approval result generated by the supervisor approval node is consensus in the blockchain network, it will be written into the approval application processing contract, and then trigger the next - level approval.
[0180] Specifically, the blockchain node can determine through the approval application processing contract that the next node for approval is the administrative approval node.
[0181] Step S68, the approval result of the supervisor approval node will be sent to the target node.
[0182] Step S69, the approval application processing contract sends an approval notice for the application information to the administrative approval node.
[0183] Step S610, after the administrative approval node generates an approval result for the application information, broadcast its approval result to the blockchain network.
[0184] Step S611, after the approval result generated by the administrative approval node is consensus in the blockchain network, it will be written into the approval application processing contract. If there is no next - level approval for administrative approval, the approval ends.
[0185] Step S612, the approval result of the administrative approval node will also be sent to the target node.
[0186] It can be understood that when it is necessary to query the application result and the approval result subsequently, only need to send an application information query request (carrying the application ID) to the approval contract. The approval contract can read the application information according to the application ID and then obtain the corresponding approval result.
[0187] By adopting the method provided in the embodiments of the present application, the immutability of the blockchain ensures that the historical records of the approval process can be permanently retained and cannot be deleted or tampered with, which helps with traceability and auditing. In addition, during the process of approving application information, employees can query the approval results at any time.
[0188] Please refer to Figure 7 , Figure 7 which is a schematic structural diagram of a data processing device based on a blockchain provided in the embodiments of the present application. The data processing device can be a computer program (including program code) running on a computer device. For example, the data processing device is an application software. The data processing device 1 can be used to execute the corresponding steps in the data processing method provided in the embodiments of the present application. As Figure 7 shown, the data processing device 1 may include: a receiving module 101, a generating module 102, a storage module 103, a notification module 104, and an updating module 105.
[0189] The receiving module 101 is configured to receive an approval application transaction sent by an approval application object; the approval application transaction includes approval application information.
[0190] The generating module 102 is configured to call an approval application processing contract according to the approval application transaction, and generate a target approval application information identifier for the approval application information through the approval application processing contract.
[0191] The storage module 103 is configured to store the target approval application information identifier, the approval application information, and the being-approved status in a target approval application information storage space.
[0192] The notification module 104 is configured to send an approval notice for the approval application information to M approval nodes through the approval application processing contract; M is a positive integer.
[0193] The updating module 105 is configured to, when receiving the node approval results respectively generated by the M approval nodes according to the approval notice, perform an approval status update process on the being-approved status in the target approval information storage space according to the M node approval results.
[0194] Among them, for the specific implementation manners of the receiving module 101, the generating module 102, the storage module 103, the notification module 104, and the updating module 105, reference can be made to the descriptions of steps S101 - S104 in the corresponding embodiments above, and details will not be elaborated here. Figure 3 where the generating module 102 includes: a time acquisition unit 1021 and a splicing unit 1022.
[0195]
[0196] A time acquisition unit 1021, configured to call an approval application processing contract according to an approval application transaction, and obtain a system timestamp corresponding to the system time through the approval application processing contract;
[0197] A splicing unit 1022, configured to splice the approval application object identifier and the system timestamp to obtain a target approval application information identifier.
[0198] Among them, for the specific implementation manners of the time acquisition unit 1021 and the splicing unit 1022, reference can be made to the description of step S102 in the corresponding embodiment above, which will not be elaborated here. Figure 3 The description of step S102 in the corresponding embodiment above will not be elaborated here.
[0199] Among them, the approval application information includes a target approval application information type;
[0200] A notification module 104, including: a list acquisition unit 1041, an identifier acquisition unit 1042, and a sending unit 1043.
[0201] The list acquisition unit 1041 is configured to obtain an approval node identifier list through the approval application processing contract; the approval node identifier list includes one or more approval node identifiers and the approval application information types respectively associated with each approval node identifier; an approval node identifier refers to the node identifier corresponding to an approval node with approval authority;
[0202] The identifier acquisition unit 1042 is configured to obtain M approval node identifiers from the approval node identifier list; the approval application information types respectively associated with the M approval node identifiers all include the target approval application information type;
[0203] The sending unit 1043 is configured to determine the M approval nodes respectively associated with the M approval node identifiers, and send an approval notice for the approval application information to the M approval nodes.
[0204] Among them, for the specific implementation manners of the list acquisition unit 1041, the identifier acquisition unit 1042, and the sending unit 1043, reference can be made to the description of step S103 in the corresponding embodiment above, which will not be elaborated here. Figure 3 The description of step S103 in the corresponding embodiment above will not be elaborated here.
[0205] Among them, the update module 105 includes: a quantity determination unit 1051, a passing processing unit 1052, and an objection processing unit 1053.
[0206] The quantity determination unit 1051 is configured to determine the number of approval passing results and the number of approval objection results for the approval application information according to the approval results of the M nodes;
[0207] The processing unit 1052 is configured to update the status of being under approval in the target approval information storage space to the approved status if the number of approved results is greater than or equal to the first voting threshold.
[0208] The objection processing unit 1053 is configured to update the status of being under approval in the target approval information storage space to the disapproved status if the number of objection results is greater than the second voting threshold.
[0209] Among them, for the specific implementation manners of the quantity determination unit 1051, the approval processing unit 1052, and the objection processing unit 1053, reference can be made to the description of step S104 in the corresponding embodiment above, which will not be elaborated here. Figure 3 The approval application information includes the type of the target approval application information.
[0210] The notification module 104 includes: a priority acquisition unit 1044 and a traversal unit 1045.
[0211] The priority acquisition unit 1044 is configured to obtain a list of node approval priorities associated with the type of the target approval application information through an approval application processing contract; the list of node approval priorities includes M approval node identifiers and the approval priorities respectively corresponding to the M approval node identifiers.
[0212] The traversal unit 1045 is configured to traverse the list of node approval orders according to the approval priorities respectively corresponding to the M approval node identifiers to obtain the i-th approval node identifier; the approval priority corresponding to the i-th approval node identifier is less than the approval priority corresponding to the (i - 1)-th approval node identifier; i is a positive integer less than or equal to M.
[0213] The traversal unit 1045 is further configured to send an approval notification for the approval application information to the approval node corresponding to the i-th approval node identifier, so that the approval node corresponding to the i-th approval node identifier processes the approval application information according to the approval notification to obtain the i-th approval result.
[0214] The traversal unit 1045 is further configured to, when determining that the i-th approval result is an approved result, continue to obtain the (i + 1)-th approval node identifier until approval notifications for the approval application information are sent to all M approval nodes.
[0215] Among them, for the specific implementation manners of the priority acquisition unit 1044 and the traversal unit 1045, reference can be made to the description of step S204 - step S206 in the corresponding embodiment above, which will not be elaborated here.
[0216] Figure 4 The approval application information includes the type of the target approval application information.
[0217] The data processing device 1 further comprises a traversal stopping module 106.
[0218] Traversal stop module 106, used to stop traversing the node approval sequence list when it is determined that the i-th approval result is a failure result;
[0219] The traversal stop module 106 is also used to update the approval status in the approval information storage space to the approval failure status, generate approval failure prompt information according to the approval failure status and the i-th approval result, and send the approval failure prompt information to the approval application object.
[0220] For the specific implementation of the traversal stop module 106, please refer to the above Figure 4 The optional description of step S206 in the corresponding embodiment will not be repeated here.
[0221] Among them, the target approval application information storage space includes a space identification field, an approval application information field and an approval status field;
[0222] The storage module 103 includes: a first writing unit 1031, a second writing unit 1032 and a third writing unit 1033.
[0223] The first writing unit 1031 is used to write the target approval application information identifier into the space identifier field;
[0224] The second writing unit 1032 is used to write the approval information field into the approval application information field;
[0225] The third writing unit 1033 is used to store the approval status in the approval status field.
[0226] The specific implementation of the first writing unit 1031, the second writing unit 1032 and the third writing unit 1033 can refer to the above Figure 3 The description of step S102 in the corresponding embodiment will not be repeated here.
[0227] Among them, the target approval application information storage space also includes an approval result record field;
[0228] The above data processing device 1 further includes: a field creation module 107 and a result recording module 108.
[0229] Field creation module 107, used to create M node approval result record subfields in the approval result record field;
[0230] Result recording module 108, used to traverse M node approval results and obtain the k-th node approval result; k is a positive integer less than M;
[0231] The result recording module 108 is further configured to write the approval result of the k-th node and the approval object information associated with the approval result of the k-th node into the k-th node approval result recording sub-field in the approval result recording field; the approval object information associated with the approval result of the k-th node refers to the object information of the approval object corresponding to the approval node that generates the approval result of the k-th node.
[0232] Among them, for the specific implementation manners of the field creation module 107 and the result recording module 108, reference can be made to the optional descriptions in step S102 of the corresponding embodiment above, which will not be elaborated here. Figure 3
[0233] Among them, the approval application information includes the approval application object information corresponding to the approval application object;
[0234] The above data processing device 1 further includes: a query module 109.
[0235] The query module 109 is configured to receive an approval query request sent by an approval query object; the approval query request includes a target approval application information identifier and approval query object information;
[0236] The query module 109 is further configured to obtain a target approval information storage space from the approval application processing contract according to the target approval application information identifier included in the approval query request;
[0237] The query module 109 is further configured to, if the approval application object information stored in the target approval information storage space is the same as the approval query object information, send the approval status stored in the target approval information storage space to the approval query object.
[0238] Figure 3 Among them, for the specific implementation manner of the query module 109, reference can be made to the optional descriptions in step S104 of the corresponding embodiment above, which will not be elaborated here.
[0239]
[0240] Among them, the above data processing device 1 further includes: a signature verification module 110.
[0241] The signature verification module 110 is configured to obtain signature data associated with the approval application transaction;
[0242] The signature verification module 110 is also used to execute the step of calling the approval application processing contract according to the approval application transaction and generating a target approval application information identifier for the approval application information through the approval application processing contract if the signature verification result is successful. The signature data belonging to the successful signature verification is obtained by signing the approval application transaction with the private key owned by the approval application object;
[0243] The signature verification module 110 is also used to send an approval application error prompt message to the approval application object if the signature verification result is a signature verification failure.
[0244] For the specific implementation of the signature verification module 110, please refer to the above Figure 3 The optional description of step S101 in the corresponding embodiment will not be repeated here.
[0245] Among them, the approval application information includes the approval application object information and the target approval application information type;
[0246] The above-mentioned data processing device 1 further includes: an authority verification module 111.
[0247] The authority verification module 111 is used to call the authorization application object set in the approval application processing contract according to the approval application transaction; the authorization application object set includes the authorization object information of at least two authorization application objects and the authorization application information type associated with each authorization application object;
[0248] The authority verification module 111 is also used to traverse the authorization application object set according to the approval application object information;
[0249] The authority verification module 111 is also used to obtain the authorization application information type associated with the authorization object information that is the same as the approval application object information, as the authorization application information type to be compared, if the authorization object information that is the same as the approval application object information is traversed in the authorization application object set;
[0250] The authority verification module 111 is also used to execute the step of calling the approval application processing contract according to the approval application transaction and generating the target approval application information identifier for the approval application information through the approval application processing contract if the authorization application information type to be compared includes the target approval application information type;
[0251] The authority verification module 111 is also used to send an authority error prompt message to the approval application object if the authorization application information type to be compared does not contain the target approval application information type.
[0252] The specific implementation of the authority verification module 111 can be found in the above Figure 3 The optional description of step S101 in the corresponding embodiment will not be repeated here.
[0253] Please see Figure 8 , Figure 8 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 8 As shown above Figure 7 The data processing device 1 in the corresponding embodiment can be applied to a computer device 1000, which may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display) and a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may also be optionally at least one storage device located away from the aforementioned processor 1001. As Figure 8 As shown in FIG. 1 , the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
[0254] In such as Figure 8 In the computer device 1000 shown in the figure, the network interface 1004 can provide a network communication element; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:
[0255] Receive the approval application transaction sent by the approval application object; the approval application transaction contains the approval application information;
[0256] According to the approval application transaction, the approval application processing contract is called, and the target approval application information identifier is generated for the approval application information through the approval application processing contract, and the target approval application information identifier, approval application information and approval status are stored in the target approval application information storage space;
[0257] Send approval notifications for approval application information to M approval nodes through the approval application processing contract; M is a positive integer;
[0258] When receiving the node approval results respectively generated by M approval nodes according to the approval notice, perform approval status update processing on the approval status in the target approval information storage space according to the M node approval results.
[0259] It should be understood that the computer device 1000 described in the embodiments of the present application can execute the description of the data processing method in any of the foregoing Figure 3 、 Figure 4 corresponding embodiments, which will not be elaborated here. In addition, the description of the beneficial effects of adopting the same method will not be elaborated either.
[0260] In addition, it should be pointed out here that: the embodiments of the present application also provide a computer-readable storage medium, and the computer program executed by the aforementioned data processing device 1 is stored in the computer-readable storage medium, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the description of the aforementioned data processing method in any of the foregoing Figure 3 、 Figure 4 corresponding embodiments, so it will not be elaborated here. In addition, the description of the beneficial effects of adopting the same method will not be elaborated either. For the technical details not disclosed in the embodiments of the computer-readable storage medium involved in the present application, please refer to the description of the method embodiments of the present application.
[0261] The aforementioned computer-readable storage medium may be the data processing device provided in any of the foregoing embodiments or the internal storage unit of the aforementioned computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the computer-readable storage medium may also include both the internal storage unit and the external storage device of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store the data that has been output or will be output.
[0262] In addition, it should be pointed out here that: the embodiments of the present application also provide a computer program product or a computer program, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in any of the foregoing Figure 3 、 Figure 4 corresponding embodiments.
[0263] In the description, claims and drawings of the embodiments of the present application, terms such as "first", "second", etc. are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product or equipment that includes a series of steps or units is not limited to the listed steps or modules, but may optionally further include steps or modules not listed, or may optionally further include other step units inherent to these processes, methods, devices, products or equipment.
[0264] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the function of that module or unit.
[0265] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of the examples have been generally described in terms of network elements in the above description. Whether these network elements are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described network elements for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0266] The above-disclosed are only the preferred embodiments of the present application, and of course cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A data processing method based on blockchain, characterized in that: include: Receiving an approval application transaction sent by an approval application object; the approval application transaction includes approval application information; Calling the approval application processing contract according to the approval application transaction, generating a target approval application information identifier for the approval application information through the approval application processing contract, and storing the target approval application information identifier, the approval application information and the approval status in the target approval application information storage space; Sending an approval notification for the approval application information to M approval nodes through the approval application processing contract; M is a positive integer; When the node approval results generated by the M approval nodes respectively according to the approval notification are received, the approval status in the target approval information storage space is updated according to the M node approval results.
2. The method according to claim 1, characterized in that: The approval application information includes an approval application object identifier corresponding to the approval application object; The calling of the approval application processing contract according to the approval application transaction and generating a target approval application information identifier for the approval application information through the approval application processing contract include: Calling the approval application processing contract according to the approval application transaction, and obtaining the system timestamp corresponding to the system time through the approval application processing contract; The approval application object identifier is concatenated with the system timestamp to obtain a target approval application information identifier.
3. The method according to claim 1, characterized in that The approval application information includes the target approval application information type; The sending of an approval notification for the approval application information to M approval nodes through the approval application processing contract includes: Obtaining an approval node identification list through the approval application processing contract; the approval node identification list includes one or more approval node identifications and the approval application information type associated with each approval node identification; an approval node identification refers to a node identification corresponding to an approval node with approval authority; Acquire M approval node identifiers from the approval node identifier list; the approval application information types respectively associated with the M approval node identifiers all include the target approval application information type; The approval nodes respectively associated with the M approval node identifiers are determined as M approval nodes, and an approval notification for the approval application information is sent to the M approval nodes.
4. The method according to claim 1, characterized in that: The updating process of the approval status of the approval-in-progress status in the target approval information storage space according to the approval results of the M nodes includes: Determine the number of approval results and the number of disapproval results for the approval application information according to the M node approval results; If the number of the approved results is greater than or equal to the first voting threshold, updating the approval status in the target approval information storage space to the approved status; If the number of the approval objection results is greater than the second voting threshold, the approval status in the target approval information storage space is updated to the approval failure status.
5. The method according to claim 1, characterized in that The approval application information includes the target approval application information type; The sending of an approval notification for the approval application information to M approval nodes through the approval application processing contract includes: Obtaining a node approval priority list associated with the target approval application information type through the approval application processing contract; the node approval priority list includes M approval node identifiers and approval priorities corresponding to the M approval node identifiers; According to the approval priorities corresponding to the M approval node identifiers, the node approval order list is traversed to obtain the i-th approval node identifier; the approval priority corresponding to the i-th approval node identifier is less than the approval priority corresponding to the i-1-th approval node identifier; i is a positive integer less than or equal to M; Sending an approval notification for the approval application information to the approval node corresponding to the i-th approval node identifier, so that the approval node corresponding to the i-th approval node identifier performs approval processing on the approval application information according to the approval notification to obtain an i-th approval result; When it is determined that the i-th approval result is an approval result, the i+1-th approval node identifier continues to be obtained until approval notifications for the approval application information are sent to all M approval nodes.
6. The method according to claim 5, characterized in that Also includes: When it is determined that the i-th approval result is a failure result, stop traversing the node approval order list; The approval status in the approval information storage space is updated to a failed approval status, approval failure prompt information is generated according to the failed approval status and the i-th approval result, and the approval failure prompt information is sent to the approval application object.
7. The method according to claim 1, characterized in that The target approval application information storage space includes a space identification field, an approval application information field and an approval status field; The step of storing the target approval application information identifier, the approval application information and the approval-in-progress status in the target approval application information storage space includes: The target approval application information identifier is written into the space identifier field, the approval information field is written into the approval application information field, and the approval-in-progress status is stored into the approval status field.
8. The method according to claim 7, characterized in that The target approval application information storage space also includes an approval result record field; The method further comprises: In the approval result record field, create M node approval result record subfields; Traverse the M node approval results and obtain the k-th node approval result; k is a positive integer less than M; The k-th node approval result and the approval object information associated with the k-th node approval result are written into the k-th node approval result record subfield in the approval result record field; the approval object information associated with the k-th node approval result refers to the object information of the approval object corresponding to the approval node that generates the k-th node approval result.
9. The method according to claim 1, characterized in that: The approval application information includes the approval application object information corresponding to the approval application object; The method further comprises: Receiving an approval query request sent by an approval query object; the approval query request includes the target approval application information identifier and approval query object information; According to the target approval application information identifier contained in the approval query request, obtaining the target approval information storage space from the approval application processing contract; If the approval application object information stored in the target approval information storage space is the same as the approval query object information, the approval status stored in the target approval information storage space is sent to the approval query object.
10. The method according to claim 1, characterized in that Also includes: Obtaining signature data associated with the approval application transaction; Obtaining the public key of the approval application object, verifying the signature data using the public key, and obtaining a signature verification result; If the signature verification result is successful, the step of calling the approval application processing contract according to the approval application transaction and generating a target approval application information identifier for the approval application information through the approval application processing contract is executed; the signature data belonging to successful signature verification is obtained by signing the approval application transaction with the private key owned by the approval application object; If the signature verification result is a signature verification failure, an approval application error prompt message is sent to the approval application object.
11. The method according to claim 1, characterized in that: The approval application information includes approval application object information and target approval application information type; The method further comprises: Invoke the authorization application object set in the approval application processing contract according to the approval application transaction; the authorization application object set includes authorization object information of at least two authorization application objects and the authorization application information type associated with each authorization application object; Traversing the authorization application object set according to the approval application object information; If the authorization object information identical to the approval application object information is traversed in the authorization application object set, the authorization application information type associated with the authorization object information identical to the approval application object information is obtained as the authorization application information type to be compared; If the authorization application information type to be compared includes the target approval application information type, executing the step of calling the approval application processing contract according to the approval application transaction, and generating a target approval application information identifier for the approval application information through the approval application processing contract; If the authorization application information type to be compared does not include the target approval application information type, a permission error prompt message is sent to the approval application object.
12. A data processing device based on blockchain, characterized in that: include: A receiving module, used to receive an approval application transaction sent by an approval application object; the approval application transaction includes approval application information; A generation module, used for calling an approval application processing contract according to the approval application transaction, and generating a target approval application information identifier for the approval application information through the approval application processing contract; A storage module stores the target approval application information identifier, the approval application information and the approval status in a target approval application information storage space; A notification module, used to send an approval notification for the approval application information to M approval nodes through the approval application processing contract; M is a positive integer; The updating module is used for, when receiving the node approval results generated by the M approval nodes respectively according to the approval notification, updating the approval status in the target approval information storage space according to the M node approval results.
13. A computer device, characterized in that: include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store program code, and the processor is used to call the program code to execute the method described in any one of claims 1-11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 11 can be performed.
Citation Information
Cited By
Check-in filing approval method and system based on trusted data space
CN121365951A