Data processing method and device based on block chain, equipment and medium
By deploying resource issuance contracts on the blockchain, the problem of cumbersome resource application process in the resource management system is solved, and the automated management and efficient transfer of resources are realized, resource management efficiency is improved and data security is enhanced.
Patent Information
- Application Number
- CN202410018224.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-07-04
AI Technical Summary
The process of obtaining resources by resource demand objects in the existing resource management system is complicated and complicated, resulting in inefficient management.
By deploying resource issuance contracts on the blockchain, receiving resource application requests, executing the issuance business logic after reviewing and meeting the conditions, generating a resource return plan, and transferring resources after reaching a consensus in the blockchain network consensus committee, the automated management of resources is achieved.
It improves the efficiency of resource management, simplifies the resource application and return process, ensures the immutability and transparency of data, and improves the credibility and security of resources.
Smart Images

Figure CN120256516A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular, to a data processing method, apparatus, device, and medium based on blockchain. Background Art
[0002] In the current resource management scenario, when a resource demand object itself does not have enough resources to meet the task requirements it is responsible for, it needs to find a suitable resource holding object and apply for resources from it in order to obtain enough resources to promote the execution of the task. For example, the resource demand object fills out a resource application form to apply for resources from the resource holding object, or submits a resource application to the resource holding object through an online platform. The resource holding object will review and evaluate the resource application of the resource demand object to determine whether to approve the resource application initiated by the resource demand object. Once the resource application is approved, a resource application agreement needs to be signed between the resource demand object and the resource holding object. After the resource application agreement comes into effect, the resource holding object will transfer the resources applied for to the resource demand object; in addition, the resource demand object needs to actively return a part of the resources to the resource holding object according to the above resource application agreement within the specified time. It can be seen that the resource demand object needs to go through a series of cumbersome and complex operations to obtain the approval of the resource holding object to obtain the corresponding resources; whether it is the resource application of the resource demand object or the application review, evaluation, and distribution of the resource holding object, it takes a lot of time, resulting in too low resource management efficiency. Summary of the Invention
[0003] Embodiments of this application provide a data processing method, apparatus, device, and medium based on blockchain, which can improve resource management efficiency.
[0004] On the one hand, embodiments of this application provide a data processing method based on blockchain, including:
[0005] Receiving a resource application request corresponding to a resource demand object, obtaining the resource holding object indicated by the resource application request, and calling a resource distribution contract deployed on the blockchain by the resource holding object according to the resource application request;
[0006] If the resource application request meets the resource application conditions in the resource distribution contract, then according to the resource application quantity in the resource application request, execute the distribution service logic in the resource distribution contract to obtain a resource return plan corresponding to the resource application request;
[0007] If the resource return plan reaches a consensus in the consensus committee of the blockchain network, then transfer the digital resources corresponding to the resource application quantity from the first blockchain address corresponding to the resource holding object to the second blockchain address corresponding to the resource demand object;
[0008] Return the resource return plan to the resource demand object; the resource return plan is used to instruct the resource demand object to return digital resources to the resource holding object.
[0009] An embodiment of the present application provides a data processing device based on a blockchain, including:
[0010] A request receiving module, configured to receive a resource application request corresponding to a resource demand object, obtain the resource holding object indicated by the resource application request, and call a resource distribution contract deployed on the blockchain by the resource holding object according to the resource application request;
[0011] A contract execution module, configured to, if the resource application request meets the resource application conditions in the resource distribution contract, execute the distribution service logic in the resource distribution contract according to the resource application quantity in the resource application request, and obtain a resource return plan corresponding to the resource application request;
[0012] A resource transfer module, configured to, if the resource return plan reaches a consensus in the consensus committee of the blockchain network, transfer the digital resources corresponding to the resource application quantity from the first blockchain address corresponding to the resource holding object to the second blockchain address corresponding to the resource demand object;
[0013] A return plan return module, configured to return the resource return plan to the resource demand object; the resource return plan is used to instruct the resource demand object to return digital resources to the resource holding object.
[0014] Among them, the request receiving module is specifically configured to:
[0015] Receive a resource application request corresponding to a resource demand object, obtain a demand object identifier corresponding to the resource demand object and a holding object identifier corresponding to the resource holding object applied by the resource demand object in the resource application request;
[0016] If the demand object identifier is queried in the blockchain, it is determined that the resource demand object has the resource application permission, and the resource application request is encapsulated into a data block;
[0017] In the consensus process of the data block, call the resource distribution contract deployed in the blockchain according to the holding object identifier.
[0018] Among them, the device further includes:
[0019] An identity registration module, configured to receive a registration request of a resource demand object, verify the demand object digital certificate carried in the registration request, and obtain a certificate verification result corresponding to the demand object digital certificate; the demand object digital certificate includes an object public key and object description information corresponding to the resource demand object, the validity period of the demand object digital certificate, and a digital signature generated by the certificate issuing authority for the demand object digital certificate;
[0020] A registration success module, which is used to store the digital certificate of the demand object in the blockchain if the certificate verification result indicates successful verification, and return a registration success prompt message to the resource demand object; the registration success prompt message is used to indicate that the resource demand object has the resource application permission.
[0021] Wherein, the device further includes:
[0022] A whitelist acquisition module, which is used to obtain the application whitelist corresponding to the resource holder object in the resource distribution contract corresponding to the resource holder object;
[0023] An evaluation information query module, which is used to call the data query interface in the resource distribution contract to obtain the object evaluation information corresponding to the resource demand object from the information database if the demand object identifier corresponding to the resource demand object belongs to the application whitelist;
[0024] An application review module, which is used to review the object evaluation information and the application information carried in the resource application request according to the review business logic in the resource distribution contract to obtain the review result corresponding to the resource demand object;
[0025] An application approval module, which is used to determine that the resource application request meets the resource application conditions in the resource distribution contract if the review result indicates approval.
[0026] Wherein, the contract execution module is specifically used for:
[0027] If the resource application request meets the resource application conditions in the resource distribution contract, obtain the resource application quantity carried in the resource application request, and pass the resource application quantity into the resource distribution function in the resource distribution contract;
[0028] Execute the distribution business logic in the resource distribution function to obtain the resource return deadline, the unit resource return quantity, and the resource return prompt associated with the resource application quantity;
[0029] Determine the resource return deadline, the unit resource return quantity, and the resource return prompt as the resource return plan corresponding to the resource application request.
[0030] Wherein, the device further includes:
[0031] A contract deployment transaction receiving module, which is used to receive the return contract deployment transaction corresponding to the resource demand object; the return contract deployment transaction includes the resource return contract corresponding to the resource demand object, the first signature of the resource demand object on the resource return contract, and the second signature of the resource holder object on the resource return contract;
[0032] A signature verification module, configured to verify the validity of the first signature in the return contract deployment transaction according to the object public key corresponding to the resource demand object, and obtain a first signature verification result;
[0033] The signature verification module is further configured to verify the validity of the second signature in the return contract deployment transaction according to the object public key corresponding to the resource holding object, and obtain a second signature verification result;
[0034] A resource return contract deployment module, configured to, if both the first signature verification result and the second signature verification result indicate verification passed, deploy the resource return contract in the return contract deployment transaction on the blockchain, generate a return contract address corresponding to the resource return contract, and notify the return contract address to the resource demand object.
[0035] Wherein, the device further includes:
[0036] A resource return transaction receiving module, configured to obtain a resource return transaction corresponding to the resource demand object when the system time information meets the resource return deadline in the resource return contract;
[0037] A resource return contract invocation module, configured to invoke the resource return contract deployed in the blockchain according to the return contract address in the resource return transaction, and obtain the resource balance in the second blockchain address corresponding to the resource demand object through the resource return contract;
[0038] A resource return module, configured to, if the resource balance in the second blockchain address is greater than or equal to the unit return resource amount in the resource return contract, transfer the digital resources corresponding to the unit return resource amount from the second blockchain address to the first blockchain address corresponding to the resource holding object.
[0039] On the one hand, an embodiment of the present application provides a computer device, including a memory and a processor, the memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method provided in the above aspect of the embodiment of the present application.
[0040] On the one hand, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program is suitable for being loaded and executed by a processor so that a computer device with a processor executes the method provided in the above aspect of the embodiment of the present application.
[0041] According to one aspect of the present application, there is provided a computer program product or a computer program, which includes computer instructions 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 provided in the above aspect.
[0042] In the embodiments of the present application, after receiving a resource application request corresponding to a resource demand object, the resource holding object indicated by the resource application request is determined, and a resource distribution contract deployed by the resource holding object on the blockchain is called; if the resource application request meets the resource application conditions in the resource distribution contract, then according to the resource application quantity in the resource application request, the distribution business logic in the resource distribution contract is executed to obtain a resource return plan corresponding to the resource application request; if the resource return plan reaches a consensus in the consensus committee of the blockchain network, then the digital resources corresponding to the resource application quantity are transferred from the first blockchain address corresponding to the resource holding object to the second blockchain address corresponding to the resource demand object, and then the resource return plan can be notified to the resource demand object, facilitating the resource demand object to return the digital resources to the resource holding object according to the resource return plan. That is to say, for a resource application request initiated by a resource demand object, the review of the resource application request, the distribution of digital resources, and the resource return plan of the resource demand object can be realized through a resource distribution contract pre-deployed in the blockchain, which can improve the management efficiency of resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] 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, other drawings can be obtained based on these drawings without creative efforts.
[0044] Figure 1 is a schematic structural diagram of a resource management system provided by an embodiment of the present application;
[0045] Figure 2 is a schematic architecture diagram of a blockchain network provided by an embodiment of the present application;
[0046] Figure 3 is a schematic flowchart of a data processing method based on a blockchain provided by an embodiment of the present application Figure 1 ;
[0047] Figure 4 is a schematic diagram of the processing of a resource application request provided by an embodiment of the present application;
[0048] Figure 5 It is a flowchart showing a data processing method based on blockchain provided by an embodiment of the present application Figure 2 ;
[0049] Figure 6 It is a schematic structural diagram of a data processing device based on blockchain provided by an embodiment of the present application;
[0050] Figure 7 It is a schematic structural diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0051] 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 based on the embodiments in the present application without creative efforts belong to the scope of protection of the present application.
[0052] For ease of understanding, several basic technologies related to the embodiments of the present application are described below.
[0053] Blockchain: Blockchain is a decentralized infrastructure with the characteristics of distributed storage. Specifically, it is a data structure that organizes data blocks in a linked list-like manner according to time sequence, and can securely store data with a sequential relationship and can be verified within the system, and uses cryptography to ensure that the data cannot be tampered with or forged.
[0054] Smart contract: A computer protocol designed to disseminate, verify, or execute contracts in an information-based manner. A smart contract can be understood as a computer program that runs on a distributed ledger (i.e., blockchain), has pre-set rules, a state, and conditional responses, can encapsulate, verify, and execute complex behaviors of distributed nodes, and complete information exchange, value transfer, and resource management. Based on the distributed architecture, consensus algorithm, etc. of the blockchain, smart contracts allow users who do not trust each other to complete transactions without the need for any third-party trusted intermediary or authority; at the same time, digital smart contracts can be flexibly embedded in various tangible or intangible resources, transactions, and data to achieve active or passive resource, information management and control, and gradually build programmable smart resources, systems, etc. Among them, the embodiments of this application specifically relate to smart contracts such as resource distribution contracts and resource return contracts; the resource distribution contract is a smart contract deployed by the resource holder on the blockchain, which can be used to review resource application requests initiated by resource demand objects, and generate a resource return plan for the resource demand objects that pass the review and distribute the corresponding digital resources; the resource return contract can be used to automatically return digital resources to the resource holder on schedule for the resource demand object.
[0055] Transaction: A form executed by the blockchain. A transaction contains the private key signature of the initiator, which can ensure the authenticity, non-forgery, and non-deniability of the transaction content.
[0056] Blockchain address: The blockchain resource account identifier formed by converting the key information generated by the asymmetric encryption algorithm according to certain rules, which can be used to receive blockchain resources; among them, the blockchain resources here can be digital resources, including but not limited to digital assets such as digital collectibles and game coins.
[0057] Please refer to Figure 1 , Figure 1 which is a schematic structural diagram of a resource management system provided by the embodiments of this application; Figure 1 The resource management system shown can be a blockchain-based loan system, or can be a blockchain-based house rental system, or can be a blockchain-based e-commerce system, etc. This application does not limit the type of the resource management system. As Figure 1 shown, the resource management system can include but is not limited to: a user interface layer, an application layer, a blockchain network layer, a data storage layer, and an external data source, etc. Among them:
[0058] ① The user interface layer is the interface for interaction between users and the resource management system. The interface here may include, but is not limited to, web pages, mobile application interfaces, or other user interfaces. The users involved in the embodiments of this application may include resource holding objects (such as resource holding object A, resource holding object B, resource holding object C, etc.) and resource demand objects (such as resource demand object 1, resource demand object 2, resource demand object 3, etc.); a resource demand object refers to an object that needs to apply for digital resources from a resource holding object, and a resource holding object refers to an object that holds digital resources and can additionally issue digital resources to a resource demand object.
[0059] For example, when Figure 1 the resource management system shown is a blockchain-based loan system, the resource holding objects can be institutions such as online banks, mobile banks, telephone banks, and other channels, and the resource demand objects can be loan applicants. When Figure 1 the resource management system shown is a blockchain-based house rental system, the resource holding object can be the house owner, and the resource demand object can be the tenant. When Figure 1 the resource management system shown is a blockchain-based e-commerce system, the resource holding object can be the merchant, and the resource demand object can be the buyer, etc.
[0060] ② The application layer may contain core resource management logics, such as the creation and execution logics of resource issuance contracts, the resource issuance logic when a resource holding object issues digital resources to a resource demand object, the resource application request approval logic, the credit assessment logic when a resource demand object initiates a resource application to a resource holding object, the resource return plan management corresponding to the resource demand object, etc. This application does not make any limitations in this regard. The application can be implemented by smart contracts, using the programmable function of the blockchain to execute resource management services.
[0061] ③ The blockchain network layer is the core of the resource management system built based on blockchain technology. The blockchain network can be composed of a group of blockchain nodes, responsible for verifying and recording all transactions submitted to the blockchain network. The blockchain network can achieve distributed data sharing and consistency through a consensus algorithm, ensuring the security and reliability of the resource management system. Among them, the consensus algorithm may include, but is not limited to: BFT (Byzantine Fault Tolerance) algorithm, PBFT (Practical Byzantine Fault Tolerance) algorithm, etc.
[0062] ④ The data storage layer is responsible for storing the data required by the resource management system, including but not limited to: object information, resource distribution contracts, resource return contracts, resource return records, etc. These data can be stored in a distributed manner in the blockchain network, or other technologies can be used for storage and management.
[0063] ⑤ The resource management system can obtain information from external data sources, such as object evaluation data, industry data, etc. The relevant information obtained from external data sources can be used to support credit assessment and risk control. These external data sources can be integrated with the resource management system through API (Application Programming Interface) interfaces or other means.
[0064] Among them, Figure 1 The network architecture of the blockchain network layer in the resource management system shown can be referred to Figure 2 , Figure 2 is a schematic diagram of the architecture of a blockchain network provided by an embodiment of the present application. The blockchain network can be composed of multiple blockchain nodes, and the present application does not limit the number of blockchain nodes included in the blockchain network. As Figure 2 shown, this blockchain network is illustrated by taking 6 blockchain nodes (for example, blockchain node 1, blockchain node 2, blockchain node 3, blockchain node 4, blockchain node 5, and blockchain node 6) as an example. The various blockchain nodes in the blockchain network are networked in a peer-to-peer manner, and the blockchain nodes can communicate with each other according to the peer-to-peer network protocol. The various blockchain nodes in the blockchain network jointly follow the broadcast mechanism and the consensus mechanism to jointly ensure the immutability and non-forgery of the data in the blockchain, and at the same time realize the decentralization and trustlessness of the blockchain. Among them, the consensus mechanism can include but is not limited to core mechanisms such as the PoW (Proof Of Work) mechanism and the POS (Proof Of Stake) mechanism.
[0065] It should be understood that each blockchain node in the blockchain network can be a terminal device or a server. The terminal device can include, but is not limited to: tablet computers, laptop computers, handheld computers, mobile internet devices (MIDs), wearable devices (such as smart watches, smart bracelets, etc.), intelligent voice interaction devices, smart home appliances (such as smart TVs, etc.), in-vehicle devices, aircraft, and other electronic devices that support the operation of the blockchain system. The 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, content delivery networks (CDNs), and big data and artificial intelligence platforms. The type of the server is not limited in this application.
[0066] In the embodiments of this application, Figure 2 The blockchain nodes in the shown blockchain network can maintain a blockchain, which can be used to store relevant data involved in the resource management system. The relevant data here can include, but is not limited to: resource application requests initiated by resource demand objects, resource distribution contracts corresponding to each resource holding object, resource return contracts corresponding to each resource demand object, resource return records of each resource demand object, object information corresponding to the resource demand object (including object evaluation data, resource holding status, etc.), object information corresponding to the resource holding object (resource holding status, resource distribution qualification, etc.), resource distribution records corresponding to each resource holding object, etc.
[0067] Among them, the data generated in the resource management system can be published to the blockchain network. The data here can refer to the original data that has not formed a block (for example, transaction data); these data need to be further processed (for example, verified by each blockchain node in the blockchain network, hashed, etc.) before being written into the block. After a block (which can be called a data block) is created, it needs to undergo a consensus process. When the block consensus is successful, the block is allowed to be added to the blockchain. The blockchain can contain multiple blocks, and these blocks are connected in a chain structure in ascending order of the creation timestamp. The blockchain is a distributed ledger, and the data contained in the blocks on the blockchain is the ledger data of this distributed ledger.
[0068] The embodiments of the present application also relate to a consensus mechanism. The consensus mechanism is the basis for ensuring the normal operation of the blockchain network. Consensus means reaching an agreement. Each blockchain node in the blockchain network stores a distributed ledger (i.e., the blockchain) separately; the consensus process in the blockchain network is a process of keeping the distributed ledgers among the various blockchain nodes in the blockchain network consistent. All or part of the blockchain nodes in the blockchain network can participate in the consensus process. These blockchain nodes participating in the consensus can jointly form the consensus committee of the blockchain network, and each blockchain node participating in the consensus can be called a member of the consensus committee. Among them, the various blockchain nodes in the consensus committee can execute the corresponding processes of the consensus process by running a consensus algorithm, that is, the consensus process.
[0069] Please refer to Figure 3 , Figure 3 which is a flowchart illustration of a data processing method based on blockchain provided by the embodiments of the present application. Figure 1 . It can be understood that this method can be executed by any blockchain node in the blockchain network. This blockchain node can be a terminal device or a server, etc. The present application does not make any limitations in this regard. As Figure 3 shown, the data processing method based on blockchain can at least include the following steps S101 to step S104:
[0070] Step S101: Receive a resource application request corresponding to a resource demand object, obtain the resource holding object indicated by the resource application request, and call the resource distribution contract deployed on the blockchain by the resource holding object according to the resource application request.
[0071] In the embodiments of the present application, if the digital resources held by a certain object cannot meet its own needs, then this object can be called a resource demand object. At this time, the resource demand object can send a resource application request to the blockchain node in the blockchain network. For example, it can be at Figure 1The user interface layer of the resource management system shown initiates a resource application request. Among them, digital resources can include but are not limited to: digital collections, game coins, digital assets, etc. The resource application request can include but is not limited to: the demand object identifier corresponding to the resource demand object, the holding object identifier corresponding to the resource holding object from which the resource demand object wants to apply for digital resources, the basic information corresponding to the resource demand object, the communication method corresponding to the resource demand object, the quantity of resource applications that the resource demand object wants to apply for, the purpose of the resource demand object applying for digital resources, the resource holding status corresponding to the resource demand object, the guarantee information corresponding to the resource demand object, etc. A demand object identifier can be used to uniquely represent a resource demand object, and a holding object identifier can be used to uniquely represent a resource holding object; that is to say, the demand object identifiers corresponding to different resource demand objects are different, and the holding object identifiers corresponding to different resource holding objects are also different; the purposes of the digital resources applied for by the resource demand object can include but are not limited to education, investment, house purchase, etc.; the resource holding status can include the various types of resource situations held by the resource demand object.
[0072] The blockchain node can submit the resource application request to the resource distribution contract pre-deployed on the blockchain by the resource holding object. Through the audit business logic in the resource distribution contract, the resource application request initiated by the resource demand object can be audited for eligibility to determine whether the resource demand object meets the resource application conditions corresponding to the asset holding object; further, after determining through the audit business logic in the resource distribution contract that the resource application request meets the resource application conditions corresponding to the asset holding object, the resource return plan corresponding to the resource demand object can be generated through the distribution business logic in the resource distribution contract, and after confirmation, the digital resources applied for by the resource demand object can be transferred to it.
[0073] Among them, the resource distribution contract is a smart contract deployed on the blockchain by the resource holding object. Each resource holding object that completes identity registration on the blockchain can deploy its corresponding resource distribution contract on the blockchain. The resource distribution contract can be written using a smart contract programming language (for example, the Solidity programming language) and deployed through specific tools and processes; the resource holding object can initiate a call to the resource distribution contract to the blockchain network by sending a transaction (the resource application request in this application embodiment is sent to the blockchain node in the form of a transaction).
[0074] In the resource distribution contract corresponding to each resource holding object, the audit business logic and distribution business logic of the resource holding object can be embedded; the audit business logic can be used to audit whether all resource application requests received by the resource holding object meet the resource application conditions; the distribution business logic is used to determine the resource return plan after the resource demand object obtains the digital resources distributed by the resource holding object. Among them, the resource return plan can include, but is not limited to: the resource return period (such as the resource return date, the total number of resource returns, etc.), the unit resource return amount (which can be understood as the number of digital resources that the resource demand object needs to return each time), the resource return method, the resource return route, the resource return reminder, etc.
[0075] The resource return method can be used to determine the unit resource return amount of the asset demand object; for example, in a loan scenario, the resource return method here can be equal principal and interest repayment, or it can be equal principal repayment; if the equal principal and interest repayment method is adopted, then the amount of resources returned by the resource demand object each time is the same, that is, the unit resource return amount remains unchanged; if the equal principal repayment method is adopted, then the amount of resources returned by the resource demand object each time is different, that is, the unit resource return amount changes with time. The resource return route can be in the form of automatic deduction, platform transfer, etc., and this application does not make any restrictions on this. The resource return reminder can refer to the resource return reminder service provided in the resource return plan, including reminding the resource demand object of the resource return date in the form of emails and application notifications.
[0076] In one or more embodiments, after receiving the resource application request corresponding to the resource demand object, the blockchain node can verify the resource application request, and the resource application request that passes the verification can continue to execute the subsequent steps. The verification of the resource application request can include, but is not limited to: the validity verification of the resource application request, the legality verification of the contract call, etc.; the validity verification of the resource application request can include operations such as signature verification and permission verification of the resource demand object; the legality verification of the contract call can refer to confirming the contract function and its parameters (for example, contract address, input parameters, etc.) that the resource application request needs to execute. If the confirmation is correct, it means that the contract call in the resource application request is legal; if the confirmation is incorrect, it means that the contract call in the resource application request is illegal.
[0077] Among them, the blockchain node can verify the signature of the received resource application request and obtain the verification result corresponding to the resource application request. If the verification result indicates that the verification is passed, the subsequent steps can be performed on the resource application request; if the verification result indicates that the verification fails, the resource application request can be determined as an invalid request, and the request failure prompt information is returned to the resource demand object, and the failure prompt information can be used to notify the resource demand object to re-initiate the resource application request. Among them, the verification process of the resource application request can include: the blockchain node can obtain the object public key corresponding to the resource demand object, decrypt the digital signature carried by the resource application request, and obtain the first summary information; the resource application request can be hashed using a hash algorithm (the hash algorithm here can refer to the hash algorithm actually used by the resource demand object when signing the resource application request) to obtain the second summary information corresponding to the resource application request; if the first summary information is the same as the second summary information, it means that the resource application request has passed the verification; if the first summary information is different from the second summary information, it means that the resource application request has failed the verification. It can be understood that the hash algorithms involved in the embodiments of the present application may include but are not limited to: SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512, and the present application does not limit this.
[0078] After receiving a resource application request or determining that the resource application request has been verified, the blockchain node can verify the authority of the resource demand object that initiated the resource application request. The authority verification process here may include but is not limited to: after obtaining the resource application request corresponding to the resource demand object, the demand object identifier corresponding to the resource demand object and the holding object identifier corresponding to the resource holding object applied for by the resource demand object can be obtained in the resource application request; if the demand object identifier is queried in the blockchain, it is determined that the resource demand object has the resource application authority, and the resource application request is encapsulated into the data block; in the consensus process of the data block, the resource issuance contract deployed in the blockchain is called according to the holding object identifier. Among them, if the demand object identifier is queried in the blockchain, it means that the resource demand object has completed identity registration in the blockchain, that is, the resource demand object has the authority to initiate the origin application request. If the demand object identifier is not queried in the blockchain, it means that the resource demand object has not yet completed identity registration in the blockchain, and the resource application request needs to be re-initiated after completing identity registration.
[0079] If the resource demand object has completed identity registration in the blockchain, the resource application request can be cached in the transaction pool of the blockchain node in the form of a transaction. The transactions in this transaction pool can be written into a new block. For example, the above resource application request can be encapsulated together with other transactions in the transaction pool into a data block (the data block here can be considered as a newly packaged block), and this data block is broadcast in the blockchain network so that all blockchain nodes participating in the consensus in the blockchain network can obtain this data block, that is, each blockchain node in the consensus committee of the blockchain network can obtain this data block. During the consensus process of this data block, each blockchain node participating in the consensus can execute each transaction in this data block, of course, including the resource application request in this data block. When executing this resource application request, the resource distribution contract pre-deployed in the blockchain by the resource holding object can be called according to the holding object identifier.
[0080] Step S102, if the resource application request meets the resource application conditions in the resource distribution contract, then according to the resource application quantity in the resource application request, execute the distribution business logic in the resource distribution contract to obtain the resource return plan corresponding to the resource application request.
[0081] Specifically, the resource application conditions corresponding to the resource holding object can be obtained in the resource distribution contract. The resource application conditions can include, but are not limited to: the resource holding status with resource application permission, the upper limit of the resource application quantity corresponding to this resource holding status, the usage scope of the applied digital resources, the credit assessment information with resource application permission, etc. This application does not make any limitations in this regard. Among them, the resource holding status can be used to represent the various types of resource status held by the resource demand object, and this resource holding status can be used to evaluate the resource return ability of the resource demand object; the upper limit of the resource application quantity can refer to the maximum resource quantity that the resource demand object can apply for; the usage of the applied digital resources can include, but are not limited to, education, investment, shopping, etc.; the credit assessment information can be used to evaluate the reputation of the resource demand object.
[0082] Through the resource application conditions in the resource distribution contract, the resource application requests corresponding to the resource demand objects can be reviewed to determine whether the resource demand objects can obtain the resource application approval of the resource holding objects. Specifically, in the resource distribution contract corresponding to the resource demand object, the application whitelist corresponding to the resource holding object can be obtained. If the demand object identifier corresponding to the resource demand object belongs to the application whitelist, the data query interface in the resource distribution contract can be called to obtain the object evaluation information corresponding to the resource demand object from the information database; according to the review business logic in the resource distribution contract, the above object evaluation information and the application information carried in the resource application request are reviewed to obtain the review result corresponding to the resource demand object. If the review result indicates that the review is passed, it is determined that the resource application request meets the resource application conditions in the resource distribution contract.
[0083] Among them, the application whitelist can include a list of resource demand objects that are eligible to initiate resource applications to the resource holding object; the application whitelist can include the demand object identifiers corresponding to one or more resource demand objects, and the resource demand objects in the application whitelist are allowed to apply for resources from the resource holding object; the resource demand objects outside the application whitelist are not allowed to apply for resources from the resource holding object; different resource holding objects can have different application whitelists. For example, if the demand object identifier corresponding to resource demand object 1 is in the application whitelist of resource holding object A, then resource demand object 1 can apply for resources from resource holding object A; if the demand object identifier corresponding to resource demand object 1 is not in the application whitelist of resource holding object B, then resource demand object 1 cannot apply for resources from resource holding object B. The data query interface can be an external data source interface defined in the resource distribution contract. Through the data query interface, object evaluation information can be queried from the information database. Here, the information database can refer to a personal credit information database used to store the credit evaluation information of each resource application object. The review business logic in the resource distribution contract can refer to the execution logic between the resource application conditions corresponding to the resource holding object. The application information carried in the resource application request can include, but is not limited to: the resource holding status corresponding to the resource demand object, the resource application quantity, the purpose of applying for digital resources, etc. This application does not make any restrictions on this.
[0084] In one or more embodiments, if the resource holding status in the resource application request initiated by the resource demand object meets the resource holding status with resource application permission specified in the resource application conditions, the resource application quantity in the resource application request is less than or equal to the upper limit of the resource application quantity specified in the resource application conditions, the purpose of the digital resource application by the resource demand object belongs to the purpose range specified in the resource application conditions, and the object evaluation information of the resource demand object meets the credit evaluation information specified in the resource application conditions, it can be determined that the resource application request initiated by the resource demand object meets the resource application conditions corresponding to the resource holding object, that is, the audit result corresponding to the resource demand object indicates that the audit is passed.
[0085] Further, the resource application quantity carried in the resource application request can be obtained, and the resource application quantity is passed into the resource distribution function in the resource distribution contract. By executing the distribution service logic in the resource distribution function, the resource return deadline, the unit resource return quantity, and the resource return prompt associated with the resource application quantity can be obtained; the resource slowdown deadline, the unit resource return quantity, and the resource return prompt here can be used as the resource return plan corresponding to the resource application request.
[0086] Step S103, if the resource return plan reaches a consensus in the consensus committee of the blockchain network, transfer the digital resources corresponding to the resource application quantity from the first blockchain address corresponding to the resource holding object to the second blockchain address corresponding to the resource demand object.
[0087] In the embodiments of the present application, the process of invoking the resource distribution contract to review the resource application request corresponding to the resource demand object and generating a resource return plan for the resource demand object can essentially be understood as the execution process of the resource distribution contract; in the consensus process of the above data block, each blockchain node participating in the consensus in the blockchain network, that is, each member of the consensus committee of the blockchain network, can execute the program code in the resource distribution contract one by one to obtain the contract execution result of the resource distribution contract. Among them, the contract execution result can be a resource application failure result, or can be a resource return plan corresponding to the resource demand object. The resource application failure result can refer to that the resource application request submitted by the resource demand object fails to pass the review; if it is determined through the review business logic in the resource distribution contract that the resource application request corresponding to the resource demand object does not meet the resource application conditions corresponding to the resource holding object, then there is no need to continue executing the distribution business logic in the resource distribution contract, and the contract execution result of the resource distribution contract can be directly output as the resource application failure result. The contract execution result corresponding to the resource distribution contract can be recorded in the data block, and the final state of the data block can be determined through the consensus mechanism in the blockchain network. When the data block reaches a consensus in the consensus committee of the blockchain network, the data block can be added to the blockchain, that is to say, the contract execution result in the data block can also be stored in the blockchain.
[0088] Optionally, if the contract execution result corresponding to the resource distribution contract is a resource return plan, then the resource return plan can be added to the data block, and at this time the resource return plan can be broadcast to other blockchain nodes in the consensus committee. Each blockchain node in the consensus committee can execute each transaction in the data block, that is, can call the corresponding resource distribution contract through the resource application request corresponding to the resource demand object to obtain the contract execution result corresponding to the resource distribution contract; the contract execution result here can be added to the data block as the transaction execution result. After each blockchain node in the consensus committee executes each transaction in the data block, the consensus verification result of each blockchain node for the above data block can be obtained; the consensus verification result can be a vote in favor result, or can be a vote against result. The vote in favor result can indicate that the blockchain node agrees to add the data block to the blockchain, and the vote against result can indicate that the blockchain node does not agree to add the data block to the blockchain.
[0089] Among the consensus verification results corresponding to each blockchain node in the consensus committee, the number of approval votes corresponding to the approval voting results can be counted. If the number of approval votes is greater than the quantity threshold, it can be determined that the data block containing the resource application request reaches a consensus in the consensus committee. Furthermore, it can be determined that the resource return plan generated through the resource distribution contract reaches a consensus in the consensus committee. At this time, the resource return plan can be added to the blockchain along with the data block, and the digital resources corresponding to the resource application quantity in the resource application request can be transferred from the first blockchain address corresponding to the resource holding object to the second blockchain address corresponding to the resource demand object. In other words, the resource balance in the first blockchain address corresponding to the resource holding object will decrease, the resource balance in the second blockchain address corresponding to the resource demand object will increase, and the reduced resource quantity in the first blockchain address is equal to the increased resource quantity in the second blockchain address. For example, assuming that the resource application quantity carried in the resource application request is 10,000, then after the data block reaches a consensus, 10,000 digital resources can be transferred from the first blockchain address of the resource holding object to the second blockchain address of the resource demand object.
[0090] If the number of approval votes is less than or equal to the quantity threshold, it can be determined that the data block containing the resource application request does not reach a consensus in the consensus committee. Furthermore, it can be determined that the resource return plan generated through the resource distribution contract does not reach a consensus in the consensus committee. At this time, the data block cannot be added to the blockchain, and the blockchain node cannot transfer the digital resources corresponding to the resource application quantity from the first blockchain address corresponding to the resource holding object to the second blockchain address corresponding to the resource demand object; that is to say, the resource holding object cannot temporarily distribute digital resources to the resource demand object. Among them, the above-mentioned quantity threshold can be determined by the consensus mechanism adopted by the blockchain network and the total number of blockchain nodes included in the consensus committee; for example, the quantity threshold can be 2 / 3 of the total number of nodes in the consensus committee, or can be 51%, and this application does not make any limitations.
[0091] Optionally, if the contract execution result corresponding to the resource distribution contract is a resource application failure result, then regardless of whether the data block containing the resource application request reaches a consensus, the resource holding object cannot distribute digital resources to the resource demand object and returns an application failure prompt message to the resource demand object; this application failure prompt message can be used to notify the resource demand object to initiate a resource application request again.
[0092] Step S104, return the resource return plan to the resource demand object; the resource return plan is used to instruct the resource demand object to return digital resources to the resource holding object.
[0093] Specifically, after the data block containing the resource application request is successfully added to the blockchain, the blockchain node can return the resource return plan to the resource demand object. After receiving the resource return plan, the resource demand object can return the digital resources to the resource holding object in batches according to the resource return plan. For example, a part of the digital resources can be returned to the resource holding object on a fixed date of each month until all the digital resources are returned.
[0094] It can be understood that after the resource demand object applies for resources from the resource holding object, a resource return contract can be written between the resource demand object and the resource holding object according to the above resource return plan, and the resource return contract can be deployed on the blockchain. The operation of the resource demand object to return digital resources to the resource holding object can be automatically executed by calling the resource return contract, which can improve the management efficiency of digital resources.
[0095] Please refer to Figure 4 , Figure 4 which is a schematic diagram of the processing of a resource application request provided by an embodiment of the present application. As Figure 4 shown, if the resource demand object 30a wants to apply for digital resources from the resource holding object, the resource demand object 30a can send a resource application request to the blockchain node 30b in the blockchain network through the resource management system. For example, the resource demand object 30a can initiate a resource application request in the user interface layer of the resource management system. The resource management system can encapsulate the resource application request into a transaction (for example, transaction tx1) and send the transaction tx1 to the resource demand object 30a. The resource demand object 30a can sign the transaction content in the transaction tx1 to obtain the transaction tx1 carrying the signature of the resource demand object 30a. The resource management system can obtain the signed transaction tx1 and submit the transaction tx1 to the blockchain node 30b in the blockchain network. The transaction tx1 submitted to the blockchain network can be packed into a new block (for example, the aforementioned data block), and the data block can be broadcast in the blockchain network so that all blockchain nodes participating in the consensus in the blockchain network obtain the data block. Each blockchain node participating in the consensus can execute each transaction in the data block (including the transaction tx1 encapsulated by the resource application request) and add the execution result of each transaction to the data block. Among them, the execution result of the transaction tx1 (resource application request) can be understood as the execution result of the contract call.
[0096] Taking the blockchain node 30b in the blockchain network as an example below, the execution process of the transaction tx1 in the data block will be described. During the consensus process of the data block, the blockchain node 30b can execute each transaction in the data block. Executing the transaction tx1 in the data block can essentially be understood as the processing of a resource application request, that is, calling the resource holding object for which it wants to apply for resources according to the resource application request, and the resource distribution contract deployed in the blockchain. It can be understood that the resource application request initiated by the resource demand object 30a can include the holding object identifier corresponding to the resource holding object for which the resource demand object applies for resources; furthermore, the distribution contract address, distribution contract name, etc. corresponding to the holding object identifier can be obtained. When executing the transaction tx1, the resource distribution contract deployed in the blockchain can be called according to the distribution contract address and the distribution contract name, and the application information carried by the resource application request can be passed into the resource distribution contract, and the code of the resource distribution contract can be executed to obtain the contract execution result.
[0097] Among them, the audit service logic and the distribution service logic can be embedded in the resource distribution contract. Through the audit service logic in the resource distribution contract, the application information in the resource application request is audited. If the resource application request fails the audit, it can be directly determined that the contract execution result corresponding to the resource distribution contract is a resource application failure result. If the resource application request passes the audit, the distribution service logic in the resource distribution contract can continue to generate a resource return plan for the resource demand object. At this time, the resource return plan can be determined as the contract execution result corresponding to the resource distribution contract. The contract execution result of the resource distribution contract can be added to the data block; of course, the execution results of each transaction in the data block can be added to the data block. Other blockchain nodes in the blockchain network except the blockchain node 30b can verify the validity of the data block after receiving the data block, and confirm whether the contract calls included in the data block are executed successfully; if the transactions (such as contract calls) included in the data block are executed successfully and the data block is determined to be a valid block, then it can be determined that the blockchain node agrees to add the data block to the blockchain 30c. If the number of nodes in the blockchain network that agree to add the data block to the blockchain 30c reaches the quantity threshold, it can be determined that the data block reaches a consensus, and the data block can be added to the blockchain 30c; that is to say, the contract execution result of the resource distribution contract can be added to the blockchain 30c along with the data block. After the contract execution result is successfully added to the blockchain 30c along with the data block, the blockchain node 30b can notify the resource demand object 30a of the contract execution result.
[0098] In an embodiment of the present application, after receiving a resource application request corresponding to a resource demand object, the resource holding object indicated by the resource application request is determined, and the resource distribution contract deployed by the resource holding object on the blockchain is called; if the resource application request meets the resource application conditions in the resource distribution contract, the distribution service logic in the resource distribution contract is executed according to the resource application quantity in the resource application request to obtain a resource return plan corresponding to the resource application request; if the resource return plan reaches a consensus in the consensus committee of the blockchain network, the digital resources corresponding to the resource application quantity are transferred from the first blockchain address corresponding to the resource holding object to the second blockchain address corresponding to the resource demand object, and then the resource return plan can be notified to the resource demand object, facilitating the resource demand object to return the digital resources to the resource holding object according to the resource return plan. That is to say, for the resource application request initiated by the resource demand object, the review of the resource application request, the distribution of digital resources, and the resource return plan of the resource demand object can be realized through the resource distribution contract pre-deployed in the blockchain, which can improve the management efficiency of resources.
[0099] Please refer to Figure 5 , Figure 5 which is a schematic flow of a data processing method based on blockchain provided by an embodiment of the present application. Figure 2 . It can be understood that this method can be executed by any blockchain node in the blockchain network. The blockchain node can be a terminal device or a server, etc. The present application does not make any limitations in this regard. As Figure 5 shown, the data processing method based on blockchain can at least include the following steps S201 to step S212:
[0100] Step S201: Receive a registration request of a resource demand object, verify the demand object digital certificate carried in the registration request, and obtain a certificate verification result corresponding to the demand object digital certificate; the demand object digital certificate includes the object public key and object description information corresponding to the resource demand object, the validity period of the demand object digital certificate, and the digital signature generated by the Certificate Authority (CA) for the demand object digital certificate.
[0101] In the resource management scenario, both the resource demand object and the resource holding object need to register their identities on the blockchain. The resource demand object that has completed the identity registration can submit a resource application request to the blockchain network, and the resource holding object that has completed the identity registration can deploy a resource distribution contract in the blockchain network. In an embodiment of the present application, the identity registration processes of the resource demand object and the resource holding object on the blockchain are the same. For the convenience of understanding, the following describes the identity registration process of the resource demand object on the blockchain.
[0102] Among them, the identity registration process of the resource demand object on the blockchain may include, but is not limited to: the resource demand object can fill in the identity registration information in the resource management system, initiate a registration request after filling it out, and submit the registration request to the blockchain network; among them, the identity registration information here may include, but is not limited to: the demand object digital certificate of the resource demand object, Decentralized ID (DID), etc. Both the demand object digital certificate and the decentralized identity here are identity credentials of the resource demand object, used to verify the identity and permissions of the resource demand object. The blockchain nodes in the blockchain network can verify the identity registration information submitted by the resource demand object. The verified identity registration information can be stored in the blockchain and a registration success prompt message can be returned to the resource demand object; if the verification fails, a registration failure prompt message is returned to the resource demand object.
[0103] Optionally, the following takes the identity registration information of the resource demand object being the demand object digital certificate as an example for illustration. The blockchain node can receive the registration request of the resource demand object and obtain the demand object digital certificate carried by the registration request; the demand object digital certificate may include, but is not limited to: the object public key corresponding to the resource demand object, the expiration date of the demand object digital certificate, the object description information corresponding to the resource demand object, and the digital signature generated by the certificate issuing authority (an authoritative organization responsible for issuing and managing digital certificates, which can be used as a trusted third party in transactions and assumes the responsibility of verifying the legality of the public key in the public key system) for the demand object digital certificate, etc. Among them, the object public key of the resource demand object is public and can be used for encrypting and decrypting data; it should be understood that all public keys involved in the embodiments of the present application (for example, the object public key of the resource demand object, the object public key of the resource holding object) are public. The digital signature contained in the demand object digital certificate is generated by the certificate issuing authority signing the demand object digital certificate and can be used to ensure the integrity and authenticity of the demand object digital certificate. The object description information of the resource demand object may include identity information such as the name, organization, role, identification information, etc. of the resource demand object. The expiration date of the demand object digital certificate can be used to ensure the timely update and security of the demand object digital certificate.
[0104] The blockchain node can verify whether the resource demand object is legal and trustworthy through the demand object digital certificate. Specifically, the blockchain node can obtain the institutional public key corresponding to the certificate issuing authority and use the institutional public key to verify the correctness of the digital signature contained in the demand object digital certificate. The verification process is similar to the signature verification process described above and will not be elaborated here.
[0105] If it is determined through verification that the digital signature contained in the digital certificate of the demand object is a correct signature issued by the certificate authority, it indicates that the digital certificate of the demand object is indeed the digital certificate issued by the certificate authority for the resource demand object, that is, the digital certificate of the demand object is legal and trustworthy. At this time, the certificate verification result indicates that the verification of the digital certificate of the demand object has passed.
[0106] If it is determined through verification that the digital signature contained in the digital certificate of the demand object is not a correct signature, it indicates that the digital certificate of the demand object is not the digital certificate issued by the certificate authority for the resource demand object, that is, the digital certificate of the demand object is untrustworthy. At this time, the certificate verification result indicates that the verification of the digital certificate of the demand object has failed.
[0107] Step S202, if the certificate verification result indicates that the verification has passed, store the digital certificate of the demand object in the blockchain and return a registration success prompt message to the resource demand object; the registration success prompt message is used to indicate that the resource demand object has the resource application permission.
[0108] Specifically, if the certificate verification result corresponding to the digital certificate of the demand object indicates that the verification has passed, the digital certificate of the resource demand object can be processed and stored in the blockchain. If the digital certificate of the demand object is successfully stored on the blockchain (for example, the block encapsulating the digital certificate of the demand object reaches a consensus), a registration success prompt message can be returned to the resource demand object. The registration success prompt message can be used to notify the resource demand object that the identity registration on the blockchain has been completed. The resource demand object that has completed the identity registration has the resource application permission, that is, the resource demand object can submit a resource application request to the blockchain network at this time. If the storage of the digital certificate of the demand object on the blockchain fails (for example, the block encapsulating the digital certificate of the demand object does not reach a consensus), a registration failure prompt message can be returned to the resource demand object. The registration failure prompt message can be used to notify the resource demand object that the identity registration on the blockchain has not been completed.
[0109] Optionally, if the certificate verification result corresponding to the digital certificate of the demand object indicates that the verification has failed, a certificate verification failure message can be returned to the resource demand object. The certificate verification failure message can be used to notify the resource demand object that it needs to resubmit identity registration information (for example, resubmit the digital certificate of the demand object, or submit a decentralized identity, etc.) for identity authentication.
[0110] Step S203, receive the resource application request corresponding to the resource demand object, obtain the resource holding object indicated by the resource application request, and call the resource distribution contract deployed by the resource holding object on the blockchain according to the resource application request.
[0111] Step S204, if the resource application request meets the resource application conditions in the resource distribution contract, then according to the resource application quantity in the resource application request, execute the distribution business logic in the resource distribution contract to obtain the resource return plan corresponding to the resource application request.
[0112] Step S205, if the resource return plan reaches a consensus in the consensus committee of the blockchain network, then transfer the digital resources corresponding to the resource application quantity from the first blockchain address corresponding to the resource holding object to the second blockchain address corresponding to the resource demanding object.
[0113] Step S206, return the resource return plan to the resource demanding object; the resource return plan is used to instruct the resource demanding object to return digital resources to the resource holding object.
[0114] Among them, the specific implementation process of steps S203 to S206 can refer to Figure 3 the relevant descriptions in steps S101 to S104 of the corresponding embodiment, which will not be elaborated here.
[0115] Step S207, receive the return contract deployment transaction corresponding to the resource demanding object; the return contract deployment transaction includes the resource return contract corresponding to the resource demanding object, the first signature of the resource demanding object on the resource return contract, and the second signature of the resource holding object on the resource return contract.
[0116] Specifically, after receiving the resource return plan, the resource demanding object can negotiate with the resource holding object and prepare a resource return contract based on the above resource return plan. Among them, the resource return contract may include, but is not limited to: the quantity of digital resources actually distributed by the resource holding object for the resource demanding object (such as the aforementioned resource application quantity), the interest rate (the interest returned by the resource demanding object to the resource holding object), the resource return method, the unit return resource quantity for installment return, the frequency of installment return of digital resources, the resource return period, the interest or other fees when returning digital resources in advance, the liability for overdue return of digital resources (for example, the liability for delaying the return of digital resources, refusing to return digital resources, etc.) and other information on the business execution logic. It can be understood that the quantity of digital resources returned by the resource demanding object to the resource holding object is greater than or equal to the quantity of digital resources distributed by the resource holding object for the resource demanding object, such as the quantity of digital resources returned by the resource demanding object is equal to the sum of the quantity of digital resources distributed by the resource holding object and the interest that the resource demanding object needs to return. The resource return contract can be used to automatically return digital resources for the resource demanding object, such as transferring the corresponding digital resources from the second blockchain address corresponding to the resource demanding object to the first blockchain address corresponding to the resource holding object at a preset time within the resource return period of the resource demanding object.
[0117] In one or more embodiments, a resource requirement object may upload a resource return contract in a contract deployment page provided by a resource management system. At this time, the resource management system may obtain the resource return contract uploaded by the resource requirement object, encapsulate the resource return contract into an initial transaction, and then send a signature request corresponding to the initial transaction to the resource requirement object and the resource holding object. After receiving the signature request corresponding to the initial transaction, the resource requirement object and the resource holding object may confirm the initial transaction. After confirmation, the resource requirement object may use the object private key it holds to sign the initial transaction to generate the first signature of the resource requirement object. Similarly, the resource holding object may also use the object private key it holds to sign the initial transaction to generate the second signature of the resource holding object. In the embodiments of the present application, the initial transaction carrying the first signature and the second signature may be referred to as a return contract deployment transaction to be chained, and the resource management system may submit the return contract deployment transaction to a blockchain node in the blockchain network.
[0118] The blockchain node in the blockchain network may receive the return contract deployment transaction submitted by the resource management system. Among them, the return contract deployment transaction in the embodiments of the present application is a multi-signature transaction, that is, the above initial transaction needs to be sent to two or more objects included in the signature list for signature. When each object in the signature list has signed the initial transaction, the resource management platform may determine the initial transaction at this time as the return contract deployment transaction. That is to say, the return contract deployment transaction may include signatures of two or more objects. For example, the return contract deployment transaction in the embodiments of the present application may include the first signature of the resource requirement object and the second signature of the resource holding object.
[0119] Step S208: Verify the validity of the first signature in the return contract deployment transaction according to the object public key corresponding to the resource requirement object to obtain a first signature verification result; verify the validity of the second signature in the return contract deployment transaction according to the object public key corresponding to the resource holding object to obtain a second signature verification result.
[0120] Specifically, the blockchain node may obtain the object public key corresponding to the resource requirement object and the object public key corresponding to the resource holding object, and then may verify the validity of the first signature and the second signature in the return contract deployment transaction according to the object public key of the resource requirement object and the object public key of the resource holding object; determine whether the return contract deployment transaction is valid according to the verification results of the first signature and the second signature, that is, determine whether the return contract deployment transaction is a valid transaction. Among them, in the embodiments of the present application, the object public key and the object private key of the resource requirement object represent an asymmetric key pair generated by the resource requirement object; the object public key and the object private key of the resource holding object represent an asymmetric key pair generated by the resource holding object.
[0121] Among them, the validity verification process of the first signature in the resource return contract deployment transaction may include: decrypting the first signature in the resource return contract deployment transaction by using the object public key corresponding to the resource requirement object to obtain the third digest information; performing a hashing operation on the transaction content in the resource return contract deployment transaction according to the hashing algorithm used when generating the first signature by the resource requirement object to obtain the fourth digest information. If the third digest information is the same as the fourth digest information, it may be determined that the first signature verification result corresponding to the first signature is a verification passed result, that is, the first signature in the resource return contract deployment transaction is a valid signature; if the third digest information is different from the fourth digest information, it may be determined that the first signature verification result corresponding to the first signature is a verification failed result, that is, the first signature in the resource return contract deployment transaction is an invalid signature.
[0122] Similarly, the validity verification process of the second signature in the resource return contract deployment transaction is similar to the validity verification process of the foregoing first signature, and its implementation process may include: decrypting the second signature by using the object public key corresponding to the resource holding object to obtain the fifth digest information; performing a hashing operation on the transaction content in the transaction data according to the hashing algorithm used when generating the second signature by the resource holding object to obtain the sixth digest information. If the fifth digest information is the same as the sixth digest information, it is determined that the second signature verification result is a verification passed result, that is, the second signature in the resource return contract deployment transaction is a valid signature; if the fifth digest information is different from the sixth digest information, it is determined that the second signature verification result is a verification failed result, that is, the second signature in the resource return contract deployment transaction is an invalid signature.
[0123] Step S209, if both the first signature verification result and the second signature verification result indicate verification passed, deploy the resource return contract in the resource return contract deployment transaction on the blockchain, generate a return contract address corresponding to the resource return contract, and notify the resource requirement object of the return contract address.
[0124] Specifically, if both the first signature verification result and the second signature verification result in the return contract deployment transaction are verification passed results, it can be determined that the first signature and the second signature in the return contract deployment transaction are verified passed, that is, it can be determined that the return contract deployment transaction is a valid transaction, and then the return contract deployment transaction can be executed for blockchain processing. For example, the return contract deployment transaction can be encapsulated into block b1 and broadcast in the blockchain network so that all blockchain nodes participating in consensus in the blockchain network can obtain the block b1. Each blockchain node participating in consensus in the blockchain network can verify the block b1, execute each transaction in the block b1, obtain the transaction execution result corresponding to each transaction in the block b1, and the transaction execution result can be added to the block b1. Among them, when the blockchain node executes the return contract deployment transaction in the block b1, it can compile the resource return contract included in the return contract deployment transaction in the virtual machine of the blockchain node to obtain the binary code corresponding to the resource return contract; the compilation result of the resource return contract can be used as the transaction execution result corresponding to the return contract deployment transaction.
[0125] The blockchain nodes participating in consensus in the blockchain network can verify each transaction in the block b1 and confirm the transaction execution result corresponding to each transaction to obtain the block consensus result corresponding to the block b1. If the block consensus result indicates consensus passed, the block b1 can be added to the blockchain, that is to say, the return contract deployment transaction can be added to the blockchain along with the block b1. At this time, the blockchain node can notify the resource demand object of the return contract address corresponding to the resource return contract. After receiving the return contract address, the resource demand object can know that the resource return contract is successfully deployed on the blockchain from the return contract address.
[0126] Optionally, if there is a signature with verification failure among the first signature and the second signature included in the return contract deployment transaction, it can be determined that the return contract deployment transaction is an invalid transaction, and the resource management system needs to be notified to generate a return contract deployment transaction for the resource demand object and the resource holding object again.
[0127] Optionally, in addition to the validity verification of the aforementioned first signature and second signature, the verification process of the return contract deployment transaction can also include other verifications, such as judging the legality of the transaction content in the return contract deployment transaction, etc. When the above verifications are all passed, the return contract deployment transaction can be executed for blockchain processing.
[0128] Step S210, when the system time information meets the resource return deadline in the resource return contract, obtain the resource return transaction corresponding to the resource demand object.
[0129] In the embodiments of the present application, a resource demand object may authorize a resource management system to call a resource return contract deployed on a blockchain to automatically return digital resources to a resource holding object. When the system time information meets the resource return deadline in the resource return contract, the resource management system may automatically generate a resource return transaction for the resource demand object, and the resource return transaction may carry the signature of the resource demand object on the resource return transaction. Among them, the above system time information may refer to the system time information in the computer device running the resource management system, that is, the time zone time where the computer device is located. For example, assuming that the resource return deadline in the resource return contract is the 10th of each month, then when the system time information is a specific time on the 10th of the current month (for example, 10:00 am), the resource management system may automatically generate a resource return transaction for the resource demand object. In other words, the operation of the resource demand object to return digital resources to the resource holding object may be automatically triggered by the resource management system.
[0130] Optionally, when the system time information meets the resource return deadline in the resource return contract, a resource return request may be initiated in the resource management system; after the resource management system obtains the resource return request of the resource demand object, it will encapsulate the resource return request as a resource return transaction. In other words, the operation of the resource demand object to return digital resources to the resource holding object may be triggered by the resource demand object itself; the time when the resource demand object initiates a resource return request in the resource management system may be after the previous resource return date and before the next resource return date; for example, if the resource return deadline in the resource return contract is the 10th of each month, then the resource demand object may initiate a resource return request after the 10th of each month and before the 10th of the next month.
[0131] It can be understood that the resource return transaction generated by the resource management system for the resource demand object may be uploaded to the blockchain network. At this time, the blockchain nodes in the blockchain network may obtain the resource return transaction corresponding to the resource demand object when the system time information meets the resource return deadline. Among them, the resource return transaction may include a sender address (the second blockchain address corresponding to the resource demand object), a receiver address (the first blockchain address corresponding to the resource holding object), a transaction content (the resource demand object transfers a unit of returned resource quantity to the resource holding object), etc.
[0132] Step S211, according to the return contract address in the resource return transaction, call the resource return contract deployed in the blockchain, and obtain the resource balance in the second blockchain address corresponding to the resource demand object through the resource return contract.
[0133] Specifically, the blockchain node can verify the signature of the resource return transaction, and the resource return transaction that passes the verification can be cached in the transaction pool. The process of verifying the signature of the resource return transaction can refer to the description of the process of verifying the signature of the resource application request in the foregoing steps, which will not be elaborated here. The blockchain node can package the transactions in the transaction pool to generate block b2, and the block b2 here can include the above-mentioned resource return transaction. This block b2 can be broadcast in the blockchain network so that each blockchain node in the consensus committee of the blockchain network can obtain this block b2. Each blockchain node in the consensus committee can perform consensus processing on the block b2 containing the resource return transaction.
[0134] In the consensus process of block b2, each transaction in this block b2 can be executed, of course including the resource return transaction in this block b2. When executing this resource return transaction, the resource return contract deployed in the blockchain can be called according to the return contract address in this resource return transaction, and the resource balance in the second blockchain address corresponding to the resource demand object can be read through this resource return contract; the resource balance here can refer to the quantity of the resource balance in the second blockchain address.
[0135] Step S212, if the resource balance in the second blockchain address is greater than or equal to the unit return resource quantity in the resource return contract, then transfer the digital resources corresponding to the unit return resource quantity from the second blockchain address to the first blockchain address corresponding to the resource holding object.
[0136] Specifically, if the resource balance in the second blockchain address is greater than or equal to the unit return resource quantity in the resource return contract, it means that there is enough resource balance in the second blockchain address to return to the resource holding object. Then, when the block b2 is added to the blockchain after passing the consensus, the digital resources corresponding to the unit return resource quantity can be transferred from the second blockchain address to the first blockchain address corresponding to the resource holding object. By calling the resource return contract deployed in the blockchain in the embodiment of the present application, the corresponding digital resources can be automatically returned by the resource demand object to the resource holding object, which can improve the resource return efficiency of the digital resources.
[0137] Optionally, if the resource balance in the second blockchain address is less than the unit return resource quantity in the resource return contract, it indicates that the resource balance in the second blockchain address is insufficient and cannot return the unit return resource quantity to the resource holding object, that is, the transaction execution result of the resource return transaction indicates that the transaction fails. In such a case, regardless of whether block b2 reaches a consensus in the blockchain network, the resource holding object cannot receive the digital resources returned by the resource demand object. At this time, a resource shortage prompt message can be returned to the resource demand object, and this resource shortage prompt message can be used to instruct the resource demand object to recharge digital resources into the second blockchain address and notify the resource management system to resubmit a new resource return transaction to the blockchain node.
[0138] In the embodiments of the present application, after the resource demand object initiates a resource application request, the resource application request can be reviewed through the review business logic in the resource distribution contract pre-deployed on the blockchain. When the resource application request is reviewed and approved, the resource return plan is generated for the resource demand object through the distribution business logic in the resource distribution contract. The blockchain nodes in the consensus committee of the blockchain network verify the resource return plan. After verification, the digital resources corresponding to the resource application quantity are transferred from the first blockchain address corresponding to the resource holding object to the second blockchain address corresponding to the resource demand object, and the resource return plan is notified to the resource demand object. Further, the resource demand object can create a resource return contract with the resource holding object based on the resource return plan, and the resource demand object can automatically return the digital resources to the resource holding object on schedule by invoking the resource return contract. That is to say, the resource demand object and the resource holding object can directly interact through the blockchain, and store information such as the resource application request and resource return record of the resource demand object in the blockchain, which can ensure the immutability and transparency of data, and improve the credibility and security of resources; through smart contracts (resource distribution contract and resource return contract), the automatic distribution and automatic return of resources can be realized, that is, the resources can be automatically managed, thereby improving the management efficiency of resources and reducing the management cost of resources.
[0139] It can be understood that in the specific implementation manner of the present application, relevant information (basic information, email, identity authentication information, account balance, account, etc.) of the resource demand object and the resource holding object may be involved. When the above embodiments of the present application are applied to specific products or technologies, the permission or consent of relevant users needs to be obtained, and the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards in relevant regions.
[0140] Please refer to Figure 6 , Figure 6It is a schematic structural diagram of a data processing device based on blockchain provided by an embodiment of the present application. It can be understood that the blockchain-based data processing device 1 can be applied to any blockchain node within the blockchain network; for example Figure 6 As shown, the blockchain-based data processing device 1 may include: a request receiving module 101, a contract execution module 102, a resource transfer module 103, and a return plan return module 104;
[0141] The request receiving module 101 is configured to receive a resource application request corresponding to a resource demand object, obtain the resource holding object indicated by the resource application request, and call the resource distribution contract deployed on the blockchain by the resource holding object according to the resource application request;
[0142] The contract execution module 102 is configured to, if the resource application request meets the resource application conditions in the resource distribution contract, execute the distribution service logic in the resource distribution contract according to the resource application quantity in the resource application request, and obtain a resource return plan corresponding to the resource application request;
[0143] The resource transfer module 103 is configured to, if the resource return plan reaches a consensus in the consensus committee of the blockchain network, transfer the digital resources corresponding to the resource application quantity from the first blockchain address corresponding to the resource holding object to the second blockchain address corresponding to the resource demand object;
[0144] The return plan return module 104 is configured to return the resource return plan to the resource demand object; the resource return plan is used to instruct the resource demand object to return the digital resources to the resource holding object.
[0145] In a feasible implementation manner, the request receiving module 101 is specifically configured to:
[0146] Receive a resource application request corresponding to a resource demand object, obtain the demand object identifier corresponding to the resource demand object and the holding object identifier corresponding to the resource holding object applied by the resource demand object in the resource application request;
[0147] If the demand object identifier is queried in the blockchain, it is determined that the resource demand object has the resource application permission, and the resource application request is encapsulated into a data block;
[0148] During the consensus process of the data block, the resource distribution contract deployed in the blockchain is called according to the holding object identifier.
[0149] In a feasible implementation manner, the blockchain-based data processing device 1 may further include: an identity registration module 105 and a registration success module 106;
[0150] An identity registration module 105, configured to receive a registration request from a resource demand object, verify the demand object digital certificate carried in the registration request, and obtain a certificate verification result corresponding to the demand object digital certificate; the demand object digital certificate includes an object public key and object description information corresponding to the resource demand object, the validity period of the demand object digital certificate, and a digital signature generated by the certificate issuing authority for the demand object digital certificate.
[0151] A registration success module 106, configured to, if the certificate verification result indicates verification passed, store the demand object digital certificate into the blockchain, and return a registration success prompt message to the resource demand object; the registration success prompt message is used to indicate that the resource demand object has the resource application permission.
[0152] In a feasible implementation manner, the blockchain-based data processing device 1 further includes: a whitelist acquisition module 107, an evaluation information query module 108, an application review module 109, and an application approval module 110.
[0153] The whitelist acquisition module 107 is configured to obtain an application whitelist corresponding to the resource holding object in the resource distribution contract corresponding to the resource holding object.
[0154] The evaluation information query module 108 is configured to, if the demand object identifier corresponding to the resource demand object belongs to the application whitelist, call the data query interface in the resource distribution contract, and obtain the object evaluation information corresponding to the resource demand object from the information database.
[0155] The application review module 109 is configured to review the object evaluation information and the application information carried in the resource application request according to the review business logic in the resource distribution contract, and obtain a review result corresponding to the resource demand object.
[0156] The application approval module 110 is configured to, if the review result indicates approval passed, determine that the resource application request meets the resource application conditions in the resource distribution contract.
[0157] In a feasible implementation manner, the contract execution module 102 is specifically configured to:
[0158] If the resource application request meets the resource application conditions in the resource distribution contract, obtain the resource application quantity carried in the resource application request, and pass the resource application quantity into the resource distribution function in the resource distribution contract.
[0159] Execute the distribution business logic in the resource distribution function, and obtain a resource return deadline, a unit return resource quantity, and a resource return prompt associated with the resource application quantity.
[0160] Determine the resource return deadline, the unit return resource quantity, and the resource return prompt as the resource return plan corresponding to the resource application request.
[0161] In a feasible implementation manner, the blockchain-based data processing device 1 may further include: a contract deployment transaction receiving module 111, a signature verification module 112, and a resource return contract deployment module 113;
[0162] The contract deployment transaction receiving module 111 is configured to receive a return contract deployment transaction corresponding to a resource demand object; the return contract deployment transaction includes a resource return contract corresponding to the resource demand object, a first signature of the resource demand object on the resource return contract, and a second signature of the resource holding object on the resource return contract;
[0163] The signature verification module 112 is configured to verify the validity of the first signature in the return contract deployment transaction according to the object public key corresponding to the resource demand object, and obtain a first signature verification result;
[0164] The signature verification module 112 is further configured to verify the validity of the second signature in the return contract deployment transaction according to the object public key corresponding to the resource holding object, and obtain a second signature verification result;
[0165] The resource return contract deployment module 113 is configured to, if both the first signature verification result and the second signature verification result indicate that the verification is passed, deploy the resource return contract in the return contract deployment transaction on the blockchain, generate a return contract address corresponding to the resource return contract, and notify the return contract address to the resource demand object.
[0166] In a feasible implementation manner, the blockchain-based data processing device 1 may further include: a resource return transaction receiving module 114, a resource return contract invocation module 115, and a resource return module 116;
[0167] The resource return transaction receiving module 114 is configured to obtain a resource return transaction corresponding to a resource demand object when the system time information meets the resource return deadline in the resource return contract;
[0168] The resource return contract invocation module 115 is configured to invoke the resource return contract deployed in the blockchain according to the return contract address in the resource return transaction, and obtain the resource balance in the second blockchain address corresponding to the resource demand object through the resource return contract;
[0169] The resource return module 116 is configured to, if the resource balance in the second blockchain address is greater than or equal to the unit return resource amount in the resource return contract, transfer the digital resources corresponding to the unit return resource amount from the second blockchain address to the first blockchain address corresponding to the resource holding object.
[0170] According to an embodiment of the present application, the steps involved in the foregoing blockchain-based data processing method may be performed byFigure 6 executed by each module in the blockchain-based data processing device 1 shown. For example, Figure 3 the step S101 shown can be executed by Figure 6 the request receiving module 101 shown, Figure 3 the step S102 shown can be executed by Figure 6 the contract execution module 102 shown, Figure 3 the step S103 shown can be executed by Figure 6 the resource transfer module 103 shown, Figure 3 the step S104 shown can be executed by Figure 6 the return plan return module 104 shown, etc.
[0171] According to an embodiment of the present application, Figure 6 each module in the blockchain-based data processing device 1 shown can be separately or all combined into one or several modules to form, or a certain one (or some) of the modules can be further split into at least two smaller functional units, and the same operations can be achieved without affecting the realization of the technical effects of the embodiments of the present application. The above modules are divided based on logical functions. In practical applications, the function of one module can also be realized by at least two modules, or the functions of at least two modules are realized by one module. In other embodiments of the present application, Figure 6 the blockchain-based data processing device 1 shown may also include other modules. In practical applications, these functions can also be assisted by other modules to be realized, and can be realized by the cooperation of at least two modules.
[0172] In the embodiments of the present application, after a resource request object initiates a resource application request, the audit business logic in the resource distribution contract pre-deployed on the blockchain can be used to audit the resource application request. When the resource application request is approved, the distribution business logic in the resource distribution contract is used to generate a resource return plan for the resource request object. The blockchain nodes in the consensus committee of the blockchain network verify the resource return plan. After verification, the digital resources corresponding to the resource application quantity are transferred from the first blockchain address corresponding to the resource holding object to the second blockchain address corresponding to the resource request object, and the resource return plan is notified to the resource request object. Further, the resource request object can create a resource return contract with the resource holding object based on the resource return plan. By invoking the resource return contract, the resource request object can automatically return the digital resources to the resource holding object on schedule. That is to say, the resource request object and the resource holding object can directly interact through the blockchain. Storing information such as the resource application request and resource return record of the resource request object in the blockchain can ensure the immutability and transparency of data, and improve the credibility and security of resources. Through smart contracts (resource distribution contract and resource return contract), automatic distribution and automatic return of resources can be realized, that is, automatic management of resources can be carried out, thereby improving the management efficiency of resources and reducing the management cost of resources.
[0173] Please refer to Figure 7 , Figure 7 which is a schematic structural diagram of a computer device provided by an embodiment of the present application. As Figure 7 shown, the computer device 1000 can be a terminal device or a server, and no limitation will be imposed here. For ease of understanding, the present application takes the computer device as a terminal device as an example. The computer device 1000 may include: a processor 1001, a network interface 1004, and a memory 1005. In addition, the computer device 1000 may further 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 further 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, such as at least one disk memory. The memory 1005 may optionally be at least one storage device located far from the aforementioned processor 1001. As Figure 7 shown, 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.
[0174] Among them, the network interface 1004 in the computer device 1000 can also provide network communication functions, and the optional user interface 1003 can also include a display screen and a keyboard. In Figure 7 In the computer device 1000 shown, the network interface 1004 can provide network communication functions; while the user interface 1003 is mainly used to provide an input interface for users; and the processor 1001 can be used to call the device control application program stored in the memory 1005 to implement:
[0175] Receive a resource application request corresponding to a resource demand object, obtain the resource holding object indicated by the resource application request, and call the resource distribution contract deployed on the blockchain by the resource holding object according to the resource application request;
[0176] If the resource application request meets the resource application conditions in the resource distribution contract, then according to the resource application quantity in the resource application request, execute the distribution service logic in the resource distribution contract to obtain a resource return plan corresponding to the resource application request;
[0177] If the resource return plan reaches a consensus in the consensus committee of the blockchain network, then transfer the digital resources corresponding to the resource application quantity from the first blockchain address corresponding to the resource holding object to the second blockchain address corresponding to the resource demand object;
[0178] Return the resource return plan to the resource demand object; the resource return plan is used to instruct the resource demand object to return digital resources to the resource holding object.
[0179] It should be understood that the computer device 1000 described in the embodiments of the present application can execute the description of the blockchain-based data processing method in any of the foregoing Figure 3 , Figure 5 corresponding embodiments, and can also execute the description of the blockchain-based data processing device 1 in the foregoing Figure 6 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.
[0180] 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-readable storage medium stores the computer program executed by the foregoing blockchain-based data processing device 1, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the foregoing Figure 3 , Figure 5The description of the blockchain-based data processing method in any corresponding embodiment will not be repeated here. In addition, the beneficial effects of using the same method will not be described again. For the technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application. As an example, the program instructions can be deployed to be executed on a computer device, or on multiple computer devices located at one place, or on multiple computer devices distributed at multiple places and interconnected through a communication network. The multiple computer devices distributed at multiple places and interconnected through a communication network can form a blockchain network.
[0181] In addition, it should be noted 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 may include computer instructions, and the computer instructions can be 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 can execute the computer instructions, so that the computer device executes the Figure 3 , Figure 5 description of the blockchain-based data processing method in any corresponding embodiment. Therefore, it will not be repeated here. In addition, the beneficial effects of using the same method will not be described again. For the technical details not disclosed in the embodiments of the computer program product or the computer program involved in this application, please refer to the description of the method embodiments of this application.
[0182] The terms "first", "second", etc. in the specification, claims and drawings of the embodiments of the present application are used to distinguish different media contents, rather than to describe a specific order. In addition, the term "including" and any of its variations 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.
[0183] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article 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 each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0184] The method and related devices provided by the embodiments of this application are described with reference to the method flowcharts and / or structural schematic diagrams provided by the embodiments of this application. Specifically, each process and / or block of the method flowchart and / or structural schematic diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in one process Figure 1 one process or multiple processes and / or structural schematic Figure 1 one block or multiple blocks. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the functions specified in one process Figure 1 one process or multiple processes and / or structural schematic Figure 1 one block or multiple blocks. These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one process Figure 1 one process or multiple processes and / or structural schematic one block or multiple blocks.
[0185] In the embodiments of this 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, one 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 functions of the module or unit.
[0186] The foregoing disclosure is only for the better embodiments of this application. Of course, it cannot be used to limit the scope of rights of this application. Therefore, equivalent changes made according to the claims of this application still fall within the scope covered by this application.
Claims
1. A blockchain-based data processing method, characterized in that, Including: Receiving a resource application request corresponding to a resource demand object, obtaining a resource holding object indicated by the resource application request, and invoking a resource distribution contract deployed on a blockchain by the resource holding object according to the resource application request; If the resource application request meets the resource application conditions in the resource distribution contract, then according to the resource application quantity in the resource application request, executing the distribution business logic in the resource distribution contract to obtain a resource return plan corresponding to the resource application request; If the resource return plan reaches a consensus in the consensus committee of the blockchain network, then transferring digital resources corresponding to the resource application quantity from a first blockchain address corresponding to the resource holding object to a second blockchain address corresponding to the resource demand object; Returning the resource return plan to the resource demand object; the resource return plan is used to instruct the resource demand object to return digital resources to the resource holding object.
2. The method according to claim 1, characterized in that The receiving a resource application request corresponding to a resource demand object, obtaining a resource holding object indicated by the resource application request, and invoking a resource distribution contract deployed on a blockchain by the resource holding object according to the resource application request includes: Receiving a resource application request corresponding to a resource demand object, obtaining a demand object identifier corresponding to the resource demand object and a holding object identifier corresponding to the resource holding object applied for by the resource demand object in the resource application request; If the demand object identifier is queried in the blockchain, determining that the resource demand object has the resource application permission, and encapsulating the resource application request into a data block; During the consensus process of the data block, invoking the resource distribution contract deployed in the blockchain according to the holding object identifier.
3. The method according to claim 1, wherein The method further includes: Receiving a registration request of the resource demand object, verifying a demand object digital certificate carried in the registration request to obtain a certificate verification result corresponding to the demand object digital certificate; the demand object digital certificate includes an object public key and object description information corresponding to the resource demand object, a validity period of the demand object digital certificate, and a digital signature generated by a certificate issuing authority for the demand object digital certificate; If the certificate verification result indicates verification passed, storing the demand object digital certificate in the blockchain, and returning a registration success prompt message to the resource demand object; the registration success prompt message is used to indicate that the resource demand object has the resource application permission.
4. The method according to claim 1, characterized in that, The method further includes: Obtaining an application whitelist corresponding to the resource holding object in the resource distribution contract of the resource holding object; If the demand object identifier corresponding to the resource demand object belongs to the application whitelist, invoking a data query interface in the resource distribution contract to obtain object evaluation information corresponding to the resource demand object from an information database; According to the audit business logic in the resource distribution contract, auditing the object evaluation information and application information carried in the resource application request to obtain an audit result corresponding to the resource demand object; If the audit result indicates approval, it is determined that the resource application request meets the resource application conditions in the resource distribution contract.
5. The method according to claim 1, wherein If the resource application request meets the resource application conditions in the resource distribution contract, then according to the resource application quantity in the resource application request, the distribution business logic in the resource distribution contract is executed to obtain the resource return plan corresponding to the resource application request, including: If the resource application request meets the resource application conditions in the resource distribution contract, the resource application quantity carried by the resource application request is obtained, and the resource application quantity is passed into the resource distribution function in the resource distribution contract; Execute the distribution business logic in the resource distribution function to obtain the resource return period, the unit resource return quantity, and the resource return prompt associated with the resource application quantity; The resource return period, the unit resource return quantity, and the resource return prompt are determined as the resource return plan corresponding to the resource application request.
6. The method according to claim 1, wherein The method further includes: Receiving a return contract deployment transaction corresponding to the resource demand object; the return contract deployment transaction includes a resource return contract corresponding to the resource demand object, a first signature of the resource demand object on the resource return contract, and a second signature of the resource holding object on the resource return contract; According to the object public key corresponding to the resource demand object, the validity of the first signature in the return contract deployment transaction is verified to obtain a first signature verification result; According to the object public key corresponding to the resource holding object, the validity of the second signature in the return contract deployment transaction is verified to obtain a second signature verification result; If both the first signature verification result and the second signature verification result indicate verification passed, then the resource return contract in the return contract deployment transaction is deployed on the blockchain, a return contract address corresponding to the resource return contract is generated, and the return contract address is notified to the resource demand object.
7. The method according to claim 6, characterized in that The method further includes: When the system time information meets the resource return period in the resource return contract, obtaining a resource return transaction corresponding to the resource demand object; According to the return contract address in the resource return transaction, calling the resource return contract deployed in the blockchain, and obtaining the resource balance in the second blockchain address corresponding to the resource demand object through the resource return contract; If the resource balance in the second blockchain address is greater than or equal to the unit resource return quantity in the resource return contract, then the digital resources corresponding to the unit resource return quantity are transferred from the second blockchain address to the first blockchain address corresponding to the resource holding object.
8. A data processing device based on blockchain, characterized in that Including: A request receiving module, configured to receive a resource application request corresponding to a resource demand object, obtain the resource holding object indicated by the resource application request, and call the resource distribution contract deployed by the resource holding object on the blockchain according to the resource application request; A contract execution module, configured to, if the resource application request meets the resource application conditions in the resource distribution contract, execute the distribution service logic in the resource distribution contract according to the resource application quantity in the resource application request, and obtain a resource return plan corresponding to the resource application request; A resource transfer module, configured to, if the resource return plan reaches a consensus in the consensus committee of the blockchain network, transfer the digital resources corresponding to the resource application quantity from the first blockchain address corresponding to the resource holding object to the second blockchain address corresponding to the resource demand object; A return plan return module, configured to return the resource return plan to the resource demand object; the resource return plan is used to instruct the resource demand object to return digital resources to the resource holding object.
9. A computer device, characterized in that, Comprising a memory and a processor; The memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, and the computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that, Comprising a computer program, which when executed by a processor implements the method according to any one of claims 1 to 7.