CN115879934A - Resource allocation method and device, computer readable medium and electronic equipment - Google Patents

Resource allocation method and device, computer readable medium and electronic equipment Download PDF

Info

Publication number
CN115879934A
CN115879934A CN202111107945.XA CN202111107945A CN115879934A CN 115879934 A CN115879934 A CN 115879934A CN 202111107945 A CN202111107945 A CN 202111107945A CN 115879934 A CN115879934 A CN 115879934A
Authority
CN
China
Prior art keywords
contract
node
signature
resource allocation
trading platform
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111107945.XA
Other languages
Chinese (zh)
Inventor
郭懿心
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202111107945.XA priority Critical patent/CN115879934A/en
Publication of CN115879934A publication Critical patent/CN115879934A/en
Pending legal-status Critical Current

Links

Images

Abstract

The present application relates to the field of block chaining technology, and in particular, to a resource allocation method, a resource allocation apparatus, a computer readable medium, and an electronic device. The resource allocation method comprises the following steps: sending a contract template for agreeing a resource allocation rule to a trading platform node in a block chain network so that the trading platform node fills and signs the contract template to obtain a single-party signature intelligent contract carrying a digital signature of the trading platform node; the single-party signature intelligent contract is sent to a trading subject node in a block chain network, so that the trading subject node performs content verification and signature processing on the single-party signature intelligent contract to obtain a multi-signature intelligent contract carrying a digital signature of a trading platform and a digital signature of a trading subject; and performing signature verification on the multiple signature intelligent contracts, and distributing resources to the trading platform nodes and the trading subject nodes according to the multiple signature intelligent contracts passing the verification. The method can improve the reliability and credibility of network transaction.

Description

Resource allocation method and device, computer readable medium and electronic equipment
Technical Field
The present application relates to the field of block chaining technology, and in particular, to a resource allocation method, a resource allocation apparatus, a computer readable medium, and an electronic device.
Background
With the development of computers and network technologies, users can conduct online transactions and online payments without leaving home by using a network transaction platform and a network payment platform. In general, one or more objects among the buyers, the sellers, the network malls, the payment institutions, and the like are selected as trusted objects in the whole transaction process, and the transaction is performed by relying on instructions of the trusted objects. For example, the payment mechanism may rely on the settlement method provided by the network mall to settle the fees among the various objects after receiving the transaction amount paid by the buyer. The method can not inhibit abnormal behaviors such as settlement errors or malicious acts and the like, so that the credibility of the network transaction is poor.
Disclosure of Invention
The present application aims to provide a resource allocation method, a resource allocation apparatus, a computer-readable medium, and an electronic device, which at least to some extent overcome the technical problem of poor reliability of network transactions in the related art.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of an embodiment of the present application, there is provided a resource allocation method, including: sending a contract template for agreeing a resource allocation rule to a trading platform node in a block chain network so that the trading platform node performs content filling and signature processing on the contract template to obtain a single-party signature intelligent contract carrying a digital signature of the trading platform node; sending the single-party signature intelligent contract to a trading subject node in the block chain network so that the trading subject node performs content verification and signature processing on the single-party signature intelligent contract to obtain a multi-signature intelligent contract carrying a digital signature of the trading platform and a digital signature of the trading subject; and performing signature verification on the multiple signature intelligent contracts, and allocating resources to the trading platform nodes and the trading subject nodes according to the multiple signature intelligent contracts passing the verification.
According to an aspect of an embodiment of the present application, there is provided a resource allocation apparatus, including: the system comprises a first signature module, a second signature module and a third signature module, wherein the first signature module is configured to send a contract template for agreeing a resource allocation rule to a trading platform node in a block chain network so that the trading platform node performs content filling and signature processing on the contract template to obtain a single-party signature intelligent contract carrying a digital signature of the trading platform node; the second signature module is configured to send the single-party signed intelligent contract to a trading subject node in the block chain network, so that the trading subject node performs content verification and signature processing on the single-party signed intelligent contract to obtain a multiple-signature intelligent contract carrying a digital signature of the trading platform and a digital signature of the trading subject; and the distribution module is configured to perform signature verification on the multi-signature intelligent contract and distribute resources to the trading platform node and the trading subject node according to the multi-signature intelligent contract passing the verification.
In some embodiments of the present application, based on the above technical solutions, the allocation module includes: the first signature separation module is configured to perform signature separation on the multi-signature intelligent contract to obtain contract content, a digital signature of the trading platform node and a digital signature of the trading subject node, wherein the digital signature of the trading platform node and the digital signature of the trading subject node are attached to the contract content; the first abstract extraction module is configured to extract the abstract of the contract content through a hash algorithm to obtain a contract abstract; the first signature decryption module is configured to decrypt the digital signature of the transaction platform node according to the public key of the transaction platform node to obtain a first abstract plaintext to be verified; the second signature decryption module is configured to decrypt the digital signature of the transaction subject node according to the public key of the transaction subject node to obtain a second digest plaintext to be verified; a digest checking module configured to perform consistency checking on the contract digest, the first digest plaintext and the second digest plaintext.
In some embodiments of the present application, based on the above technical solutions, the allocation module further includes: a first listening module configured to listen for resource allocation instructions transmitted over the blockchain network; the first analysis module is configured to analyze the resource allocation instruction to obtain a message transmission source and a message transmission target of the resource allocation instruction; the contract calling module is configured to call a verified multi-signature intelligent contract bound with the trading platform node and the trading subject node if the message transmission source is the trading platform node and the message transmission target is a resource allocation node; and the resource allocation module is configured to allocate resources to the trading platform node and the trading subject node according to the calling result of the multi-signature intelligent contract.
In some embodiments of the present application, based on the above technical solutions, the first signature module includes: a second monitoring module configured to monitor contract establishment requests transmitted over the blockchain network; the second analysis module is configured to analyze the contract establishment request to obtain a message transmission source and a message transmission target of the contract establishment request; and the contract sending module is configured to send a contract template for agreeing the resource allocation rule to the trading platform node if the message transmission source is the trading platform node and the message transmission target is the resource allocation node.
In some embodiments of the present application, based on the above technical solution, the contract sending module includes: a first address acquisition module configured to acquire a node address of the trading platform node; the first message encapsulation module is configured to perform message encapsulation on a contract template used for appointing a resource allocation rule according to the node address of the trading platform node to obtain a contract establishment message taking the trading platform node as a message transmission target, wherein the contract establishment message is used for indicating the trading platform node to establish an intelligent contract corresponding to the contract template; a first message broadcasting module configured to broadcast the contract establishment message on the blockchain network to send a contract template carried by the contract establishment message to the trading platform node.
In some embodiments of the present application, based on the above technical solution, the contract sending module includes: the template broadcasting module is configured to broadcast a contract template for agreeing on resource allocation rules on a block chain network so as to write the contract template into to-be-uplink blocks of each block chain node on the block chain network; the template authentication module is configured to broadcast a to-be-uplink block carrying the contract template on the block chain network when a block generation condition is met, so that each block link point on the block chain network performs common identification authentication on the to-be-uplink block, and performs uplink processing on the to-be-uplink block after the authentication is passed; and the height sending module is configured to send the block height of the target block where the contract template is located to the trading platform node so that the trading platform node can inquire the target block to obtain the contract template.
In some embodiments of the present application, based on the above technical solution, the contract sending module includes: the address and public key acquisition module is configured to acquire a node address and a node public key of the trading platform node; the template encryption module is configured to encrypt a contract template used for agreeing a resource allocation rule according to the node public key to obtain an encrypted contract template; and the encryption sending module is configured to send the encryption contract template to the trading platform node according to the node address, so that the trading platform node decrypts the encryption contract template by using a node private key matched with the node public key to obtain the contract template.
In some embodiments of the present application, based on the above technical solution, the resource allocation apparatus further includes: a result broadcasting module configured to broadcast the verification result of the multi-signature intelligent contract on the blockchain network to save the verification result of the multi-signature intelligent contract into a contract buffer pool of the blockchain nodes; a data lookup module configured to lookup process data related to the process of contracting the multi-signature smart contract in the contract buffer pool; the first writing module is configured to write a checking result of the multi-signature intelligent contract and the process data into a block to be uplink after association processing is performed on the checking result and the process data; the block broadcasting module is configured to broadcast the to-be-uplink block on the block chain network when a block generation condition is met, so that the block chain link point on the block chain network performs common identification authentication on the to-be-uplink block, and performs uplink processing on the to-be-uplink block after the block chain link point passes the authentication.
In some embodiments of the present application, based on the above technical solutions, the resource allocation apparatus further includes: the duration acquisition module is configured to acquire the buffer duration of each piece of process data in the contract buffer pool; a second writing module configured to write the process data into the to-be-uplink block if the buffering duration of the process data is greater than a duration threshold.
In some embodiments of the present application, based on the above technical solutions, the first signature module further includes: the first field identification module is configured to perform field identification on the contract template to obtain a field to be filled in the contract template; the first field matching module is configured to acquire resource allocation parameters agreed by the trading platform node and the trading subject node, and perform matching detection on the resource allocation parameters and the fields to be filled; a parameter writing module configured to write the resource allocation parameter into the field to be filled when the resource allocation parameter is successfully matched with the field to be filled; and the single-party signature module is configured to perform signature processing on the contract template filled with the resource allocation parameters to obtain a single-party signature intelligent contract carrying the digital signature of the trading platform node.
In some embodiments of the present application, based on the above technical solution, the unilateral signature module includes: the second abstract extraction module is configured to extract the abstract of the contract template filled with the resource allocation parameters through a hash algorithm to obtain a contract abstract; the first abstract encryption module is configured to encrypt the contract abstract according to a private key of the trading platform node to obtain a digital signature of the trading platform node; and the single-party signature attaching module is configured to attach the digital signature of the trading platform node to the contract template to obtain a single-party signature intelligent contract carrying the digital signature of the trading platform node.
In some embodiments of the present application, based on the above technical solutions, the second signature module includes: a second address acquisition module configured to acquire a node address of a transaction subject node in the blockchain network; the second message encapsulation module is configured to perform message encapsulation on the single-party signed intelligent contract according to the node address of the transaction main body node to obtain a contract signature message which takes the transaction main body node as a message transmission target, and the contract signature message is used for indicating the transaction main body node to perform signature processing on the single-party signed intelligent contract; a second message broadcasting module configured to broadcast the contract signature message over the blockchain network to send a unilaterally signed intelligent contract carried by the contract signature message to the transaction principal node.
In some embodiments of the present application, based on the above technical solutions, the second signature module further includes: a second field identification module configured to perform field identification on the unilaterally signed intelligent contract to obtain a filled field in the contract template; the second field matching module is configured to acquire resource allocation parameters agreed by the trading platform node and the trading subject node, and perform matching detection on the resource allocation parameters and the filled fields; a parameter checking module configured to perform consistency checking on the resource allocation parameter and the field content of the filled field when the resource allocation parameter and the filled field are successfully matched; and the multiple signature module is configured to perform signature processing on the single-party signature intelligent contract to obtain a multiple signature intelligent contract carrying the digital signature of the transaction platform and the digital signature of the transaction main body when the check result of the consistency check is that the check is passed.
In some embodiments of the present application, based on the above technical solution, the multiple signature module includes: the second signature separation module is configured to perform signature separation on the single-party signature intelligent contract to obtain contract content and a digital signature of the transaction platform attached to the contract content; the third abstract extraction module is configured to extract the abstract of the contract content through a hash algorithm to obtain a contract abstract; the second abstract encryption module is configured to encrypt the contract abstract according to a private key of the transaction subject node to obtain a digital signature of the transaction subject node; and the multiple signature attaching module is configured to attach the digital signature of the trading platform node and the digital signature of the trading subject node to the contract content to obtain a multiple signature intelligent contract carrying the digital signature of the trading platform node and the digital signature of the trading subject node.
According to an aspect of the embodiments of the present application, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor implements the resource allocation method as in the above technical solution.
According to an aspect of an embodiment of the present application, there is provided an electronic device including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the resource allocation method as in the above technical solution via executing the executable instructions.
According to an aspect of an embodiment of the present application, there is provided a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the resource allocation method as in the above technical solution.
According to the technical scheme provided by the embodiment of the application, a contract template is provided through a resource allocation node, a trading platform node performs content filling and signature processing on the contract template to obtain a single-party signature intelligent contract, a trading main node performs content verification and signature processing on the single-party signature intelligent contract to obtain a multiple signature intelligent contract, and finally after the multiple signature intelligent contract is subjected to signature verification by the resource allocation node, resource allocation is performed on the trading platform node and the trading main node by using the verified multiple signature intelligent contract. Based on the resource allocation method, the reliability and the credibility of network transaction can be improved, and the problem of trust crisis caused by depending on a single object is avoided.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 shows a schematic composition diagram of a blockchain system in an embodiment of the present application.
Fig. 2 shows the constituent structure of a blockchain maintained on a blockchain network.
Fig. 3 schematically shows a network architecture of a blockchain network to which the technical solution of the present application is applied.
Fig. 4 schematically shows a flowchart of steps of a resource allocation method in an embodiment of the present application.
Fig. 5 is a flow chart schematically illustrating the steps of ul saving contract order data according to an embodiment of the present application.
FIG. 6 schematically illustrates an interaction flow diagram for generating unilaterally signed intelligent contracts based on contract templates in one embodiment of the present application.
FIG. 7 schematically illustrates an interaction flow diagram for generating a multi-signed smart contract based on a single-signed smart contract, in one embodiment of the present application.
FIG. 8 is a diagram that schematically illustrates an interaction flow for resource allocation based on a multi-signature smart contract, in an embodiment of the present application.
Fig. 9 schematically shows an interaction flowchart of an embodiment of the present application in a network transaction application scenario.
Fig. 10 schematically shows a block diagram of a resource allocation apparatus provided in an embodiment of the present application.
FIG. 11 schematically illustrates a block diagram of a computer system suitable for use in implementing an electronic device of an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The network transaction of the user is generally carried out through a network transaction platform, and if a seller who is resident on the platform needs to collect money, the seller needs to go to a third-party payment mechanism through the platform to register and apply for qualification of collecting the money. When a real transaction occurs, a buyer on the platform pays funds to a seller through a payment service provided by a third-party payment mechanism, the platform is used as a transaction scene provider and needs to obtain certain fees from the transaction, at the moment, the platform needs to call a billing interface of the third-party payment mechanism, partial funds in the transaction are transferred to a profit account opened by the platform at the third-party payment mechanism according to the agreement between the platform and the seller, and the rest funds can be transferred to an available balance account of the seller. In the process, the platform has certain control right on the funds received by the seller, and the seller needs to wait for the completion of platform call accounting when the seller wants to receive the actual available funds. In the process, the third-party payment mechanism completely trusts the billing instruction of the platform, and if the platform is in error or malicious billing instruction is generated, the seller receives funds which are not calculated according to the convention between the seller and the platform, and the third-party payment mechanism is difficult to confirm and intercept the abnormal behaviors. Therefore, the problems of poor fund distribution accuracy, poor credibility and the like in network transaction are caused.
In order to solve the situation of abnormal accounting command information in the accounting flow, an embodiment of the present application provides an accounting contract generation scheme based on a block chain and multiple signatures, where an accounting contract refers to a related contract between a third-party payment mechanism and a capital accounting signed by a resident merchant and a platform, and indicates a series of accounting-related matters such as accounting timing, maximum amount, maximum proportion, and the like, and the third-party payment mechanism completes an accounting task according to the contract in combination with a specific accounting command of the platform.
According to the technical scheme provided by the embodiment of the application, the third-party payment mechanism is brought in when the platform and the seller contract the ledger, so that the third-party payment mechanism can verify that the ledger instruction of the platform meets the ledger contract, and the contract establishment of the ledger contract is confirmed by the signatures of the platform and the seller. Meanwhile, the process data and the result data bound by the account separation contract are stored through the block chain, and the data effectiveness of the account separation contract can be better ensured by utilizing the characteristics of safe storage of the block chain and incapability of tampering the data.
The technical scheme provided by the embodiment of the application relates to transaction service scenes such as network payment and account transfer realized based on a BlockChain (Blockchain) technology. The blockchain is an anti-counterfeiting, anti-tampering and traceable shared digital account book with a blockchain data structure, which is constructed by transparent and credible rules under a peer-to-peer network environment. The block chain type data structure is a data structure which stores transactions occurring in a period of time in units of blocks and connects the blocks into a chain in time sequence by a cryptographic algorithm. Accounts are distributed to all member nodes in the network, and a history of asset transactions occurring between peer nodes in the network is permanently recorded in a sequential chain of blocks linked by a hash cipher algorithm. All validated and certified transactions are linked from the beginning of the chain all the way to the latest tile, hence the named tile chain. Blockchains can act as a single source of facts, and members in a blockchain network can only view the transactions that are related to them.
Fig. 1 shows a schematic block chain system in the embodiment of the present application, where the block chain system 100 may include at least one client 110 and a block chain network 120, and the block chain network 120 includes at least one block chain node 121. The client 110 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, an intelligent wearable device, an intelligent vehicle-mounted device, an intelligent payment terminal, a facial recognition terminal, or other various electronic devices, and may provide a block chain data service to a user by installing a corresponding client application program. The blockchain node 121 may be a terminal device or a server, for example, the blockchain node 121 may be an independent physical server, may also be a server cluster formed by a plurality of physical servers, and may also be a cloud server providing cloud computing services.
In the blockchain network 120, each blockchain node 121 may receive input information while performing normal operations and maintain shared data within the blockchain network based on the received input information. In order to ensure information interworking, there may be information connection between the block link nodes 121, and the block link nodes 121 may perform information transmission through the information connection. For example, when any blockchain node 121 in the blockchain network 120 receives input information and broadcasts the input information in the blockchain network 120, other node devices in the blockchain network 120 may acquire the input information according to a consensus algorithm and store the input information as shared data.
Each blockchain node 121 in the blockchain network 120 has a node identifier corresponding thereto, and each blockchain node 121 in the blockchain network 120 can store the node identifiers of other blockchain nodes in the same blockchain network, so that the generated block is broadcast to other nodes in the blockchain network 120 according to the node identifiers of other blockchain nodes in the subsequent process. A node identifier list as shown in table 1 may be maintained in the blockchain node 121, and the node name and the node identifier are correspondingly stored in the node identifier list. The node identifier may be an IP (Internet Protocol) address and any other information that can be used to identify the node, and table 1 is a node identifier list taking an IP address as an example.
TABLE 1
Node name Node identification
Node 1 117.114.151.174
Node 2 117.116.189.145
Node N 119.123.789.258
Fig. 2 shows the constituent structure of a blockchain maintained on a blockchain network. As shown in fig. 2, the blockchain is composed of a plurality of blocks connected in sequence, and whenever new data needs to be written into the blockchain, the data is collected into a newly generated block, and the newly generated block is linked to the end of the blockchain, and the newly added block on each node device 121 can be guaranteed to be identical through the consensus algorithm. The data of the current block is recorded in the block body of each block, and the Hash value (Hash) of the previous block connected with the current block is stored in the block head of each block, and if the transaction data in the previous block changes, the Hash value of the current block changes accordingly. Therefore, the data uploaded to the blockchain network is difficult to tamper, and the reliability of the shared data can be improved.
The following detailed description will be made on technical solutions of a resource allocation method, a resource allocation apparatus, a computer-readable medium, and an electronic device provided by the present application, with reference to specific embodiments.
Fig. 3 schematically shows a network architecture of a blockchain network to which the technical solution of the present application is applied. As shown in fig. 3, in an application scenario of implementing network transaction and network payment, a transaction subject node 310, a transaction platform node 320, and a resource allocation node 330 located in a blockchain network jointly maintain one or more blockchains 340.
The transaction subject node 310 is a block link node that provides transaction services to the user, and may be, for example, a merchant or an individual seller that conducts a network transaction with the user.
The trading platform node 320 is a block node that provides a trading scenario for network trading, and may be, for example, an e-commerce website, a network mall, or various service platforms that provide network trading services.
Resource allocation node 330 is a block-linked node that provides funds management and allocation services for network transactions, and may be, for example, a third party payment authority.
When a user performs a network transaction with the transaction subject node 310, the transaction funds may be paid to the transaction subject node 310 through an account opened on the resource allocation node 330, and the transaction platform node 320 serves as a provider of a transaction scenario, and a certain amount of funds need to be extracted from the transaction funds to serve as a platform service fee. To achieve reliable fund distribution between the trading subject node 310 and the trading platform node 320, a corresponding intelligent contract (e.g., a split account contract) for fund distribution may be established based on the blockchain network, and when a network trade is generated, the resource distribution node 330 may distribute the fund to each object in the trading scenario according to the intelligent contract.
In order to ensure the effectiveness and the credibility of contract formation, the process data and the result data of the contract formation can be uplink stored through the block chain 340, and the centralized contract formation and data storage can effectively avoid the trust crisis.
Fig. 4 schematically shows a flowchart of steps of a resource allocation method in an embodiment of the present application, where the resource allocation method may be executed by the client 110 or the block chain node 121 shown in fig. 1, and the embodiment of the present application specifically uses the resource allocation method executed by the resource allocation node 330 as an example for explanation. As shown in fig. 4, the resource allocation method may mainly include the following steps S410 to S430.
Step S410: and sending the contract template for agreeing the resource allocation rule to a trading platform node in the block chain network so that the trading platform node performs content filling and signature processing on the contract template to obtain the single-party signature intelligent contract carrying the digital signature of the trading platform node.
In the block chain network, firstly, a resource allocation node sends a contract template to a trading platform node, wherein the contract template is used for agreeing a resource allocation rule for allocating resources to the trading platform node and a trading subject node. The contract template can be a template which is pre-configured on the resource allocation node according to the agreement between the trading platform node and the resource allocation node, and when the contract establishment requirement is generated, the resource allocation node sends the contract establishment requirement to the trading platform node. In the embodiment of the present application, the same or different contract templates may be configured between each resource allocation node and each trading platform node.
In one embodiment of the application, the resource allocation node may transmit the contract template to the trading platform node according to the communication address of the trading platform node based on point-to-point data transmission. In the embodiment of the application, the resource allocation node can obtain the node address and the node public key of the trading platform node, and the contract template for agreeing the resource allocation rule can be encrypted according to the node public key of the trading platform node to obtain the encrypted contract template. And the transaction platform node decrypts the encrypted contract template by using a node private key matched with the node public key to obtain the contract template.
In one embodiment of the present application, the resource allocation node may broadcast the contract template over the blockchain network, so that the trading platform node can obtain the contract template by listening to the broadcast message.
In one embodiment of the present application, the resource allocation node may store the latest contract template on the blockchain, and when a contract establishment requirement is generated, the trading platform node may query the blockchain for the blockdata to obtain the corresponding contract template. In this embodiment of the present application, a resource allocation node may broadcast a contract template for agreeing on a resource allocation rule on a blockchain network, so as to write the contract template into a to-be-uplink blockchain of each blockchain node on the blockchain network; when the block generation condition is met, broadcasting a block to be uplink-linked, which carries a contract template, on the block chain network so that each block link point on the block chain network performs common identification authentication on the block to be uplink-linked, and performing uplink processing on the block to be uplink-linked after the authentication is passed; and sending the block height of the target block where the contract template is located to the trading platform node so that the trading platform node can inquire in the target block to obtain the contract template.
The contract template comprises pre-agreed clause data and data to be filled which needs to be perfected according to actual transaction requirements. After the trading platform node obtains the contract template, the data to be filled in the contract template can be filled with the content, and therefore the intelligent contract with complete content is obtained. The data to be populated may include, for example, transaction accounts, contact details, etc. of the various transaction parties.
After the contract template is filled with the content, the trading platform node can perform signature processing on the contract template to obtain the single-party signature intelligent contract carrying the digital signature of the trading platform node. The digital signature is a digital string which can be generated only by a sender of the information and cannot be forged by others, and the digital string is a valid proof of the authenticity of the information sent by the sender of the information. The trading platform node can ensure the source validity and the content validity of the intelligent contract by carrying out signature processing on the contract template filled with the content.
Step S420: and sending the single-party signature intelligent contract to a trading subject node in the block chain network so that the trading subject node performs content verification and signature processing on the single-party signature intelligent contract to obtain a multi-signature intelligent contract carrying the digital signature of the trading platform and the digital signature of the trading subject.
After the trading platform node carries out signature processing to generate the single-party signature intelligent contract, the single-party signature intelligent contract can be sent to the trading subject node corresponding to the single-party signature intelligent contract, so that the trading subject node can verify the contract content of the single-party signature intelligent contract, and the digital signature of the trading subject node can be further added to the single-party signature intelligent contract to obtain the multi-signature intelligent contract carrying the signatures of both parties.
In an embodiment of the application, the transaction platform node may return the unilateral signature intelligent contract obtained after completing the content filling and signature processing to the resource allocation node, and then the resource allocation node sends the unilateral signature intelligent contract to the transaction host node.
In one embodiment of the application, the trading platform node can transmit the single-party signature intelligent contract to the trading platform node according to the communication address of the trading subject node based on point-to-point data transmission.
In one embodiment of the present application, the transaction platform node may broadcast the one-party signed intelligent contract on the blockchain network, so that the transaction subject node can obtain the one-party signed intelligent contract by monitoring the broadcast message.
In one embodiment of the present application, the transaction platform node may store the unilateral signature intelligent contract on the blockchain, so that the transaction subject node may obtain the corresponding unilateral signature intelligent contract by querying the blockchain for the blockdata.
After the trading subject node obtains the single-party signed intelligent contract, the trading subject node can perform content verification on the intelligent contract to determine the content accuracy of the contract, for example, whether content data filled by the trading platform node in the contract content conforms to the contract of both parties can be verified. In addition, before checking the content of the single-party signed intelligent contract, the transaction subject node may first check the signature of the single-party signed intelligent contract to determine that the source of the single-party signed intelligent contract is valid and has not been tampered during transmission.
Step S430: and performing signature verification on the multiple signature intelligent contracts, and distributing resources to the trading platform nodes and the trading main body nodes according to the multiple signature intelligent contracts passing the verification.
After the resource allocation node obtains the multi-signature intelligent contract which is signed by the transaction platform node and the transaction main body node together, the signature verification can be carried out on the digital signature carried on the contract, and the source of the multi-signature intelligent contract is verified to be effective and is not tampered in the multi-party transmission and signature process.
In one embodiment of the application, the transaction agent node may transmit the multi-signature intelligent contract to the resource allocation node according to the communication address of the resource allocation node based on point-to-point data transmission.
In one embodiment of the application, the transaction principal node may broadcast the multi-signed intelligent contract over the blockchain network so that the resource allocation node can obtain the multi-signed intelligent contract by listening to the broadcast message.
In one embodiment of the present application, the transaction principal node may store the multi-signed smart contract on the blockchain, so that the resource allocation node may obtain the corresponding multi-signed smart contract by querying the blockchain for the blockdata.
When the resource allocation node determines that the multiple signature intelligent contract is accurate through verification, the resource can be allocated to the trading platform node and the trading subject node based on the content specified by the contract. For example, the multiple signature intelligent contract specifies that the transaction platform node and the transaction subject node perform resource allocation according to a certain proportion, so that the resource allocation node can divide the quantity of the resources to be allocated according to the specified proportion, and correspondingly transfer the divided resources to the transaction platform node and the transaction subject node. For another example, the multi-signature intelligent contract provides that the trading platform node charges a service fee according to a specified amount in each transaction, and the resource allocation node can extract a specified amount of resources from the resources to be allocated to transfer to the trading platform node and transfer the rest amount of resources to the trading subject node.
In the resource allocation method provided by the embodiment of the application, a contract template is provided through a resource allocation node, a trading platform node performs content filling and signature processing on the contract template to obtain a single-party signature intelligent contract, a trading main node performs content verification and signature processing on the single-party signature intelligent contract to obtain a multiple signature intelligent contract, and finally, after the multiple signature intelligent contract is subjected to signature verification by the resource allocation node, resource allocation is performed on the trading platform node and the trading main node by using the verified multiple signature intelligent contract. Based on the resource allocation method, the reliability and the credibility of network transaction can be improved, and the problem of trust crisis caused by depending on a single object is avoided.
In one embodiment of the present application, after the resource allocation node completes the verification of the multi-signature intelligent contract, the verification result of the contract and the process data contracted by the contract may be stored on the blockchain. Fig. 5 is a flow chart schematically illustrating the steps of ul saving contract order data according to an embodiment of the present application. As shown in fig. 5, the method for uplink saving of contract order data may include the following steps S510 to S540.
Step S510: and broadcasting the check result of the multi-signature intelligent contract on the block chain network so as to store the check result of the multi-signature intelligent contract into a contract buffer pool of the block chain nodes.
Each blockchain node in the blockchain network may each maintain a contract buffer pool for storing to-be-uplinked data related to a contract establishment procedure broadcast on the blockchain network. After the resource allocation node completes the check of the multi-signature intelligent contract, the check result can be stored in the contract buffer pool maintained by the resource allocation node, meanwhile, the check result can be broadcasted on the block chain network, and after other block chain nodes receive the broadcast message, the check result can be stored in the contract buffer pools maintained by the other block chain nodes, and the uplink is waited.
Step S520: process data associated with the process of contracting the multi-signed smart contract is looked up in a contract buffer pool.
Corresponding process data can be generated in the process of establishing the multi-signature intelligent contract, and the process data can comprise an original contract template, a single-party signature intelligent contract obtained after the filling and signature processing of the trading platform node, and a request message and a response message generated in the process of carrying out contract transmission among the resource allocation node, the trading platform node and the trading subject node. In the binding process, each block chain node stores the process data broadcast on the block chain network in a contract buffer pool, and after the check result of the multi-signature intelligent contract is stored in the contract buffer pool, the process data corresponding to the multi-signature intelligent contract can be searched in the contract buffer pool.
In one embodiment of the present application, a unique contract identifier (e.g., a contract number) may be assigned to a contract-making requirement, and all process data generated during the contract-making process will carry the contract identifier. In the contract buffer pool, the process data related to a multi-signature intelligent contract can be determined by inquiring the same contract identification.
Step S530: and writing the checking result of the multi-signature intelligent contract and the process data into the block to be uplink after the correlation processing.
Based on the query result in the contract buffer pool, the verification result of the multi-signature intelligent contract and the process data related to the verification result can be associated, and the associated data can be further written into the to-be-uplink block. After data is written into the to-be-uplink block, the data can be removed from the contract buffer pool, and the data which is not written into the to-be-uplink block is continuously stored in the contract buffer pool to wait for an appropriate uplink opportunity.
In one embodiment of the present application, a buffering duration of each process data in a contract buffering pool may be obtained; and if the buffering duration of the process data is greater than the duration threshold, writing the process data into the block to be uplink-linked. In order to avoid that the time span of contract establishment is too long due to network delay or data loss and the like, the embodiment of the application can record the buffer duration of buffer storage of each process data in the contract buffer pool, and when the buffer duration is greater than a set duration threshold, even if a verification result of a corresponding multi-signature intelligent contract is not obtained, the process data can be directly written into a block to be linked, so that the process data can be stored in the block to be linked when the block is newly generated.
Step S540: and when the block generation condition is met, broadcasting the block to be uplink on the block chain network so as to enable the block chain link points on the block chain network to perform common identification authentication on the block to be uplink, and performing uplink processing on the block to be uplink after the authentication is passed.
The block generation condition may include, for example, a time condition or a data amount condition, where the time condition is that a block is generated every set time duration, and when the generation time from the previous block reaches a set time duration, the block to be uplink is broadcasted, so as to generate a new block based on the result of the consensus authentication. The data volume condition means that a certain amount of block data is stored in each block, and when the data stored in the block to be uplink reaches a specified data volume, the data is broadcasted, so that a new block is generated based on the result of the consensus authentication.
Each method step of the resource allocation method in the embodiment of the present application is described in detail below with reference to a specific application scenario.
FIG. 6 schematically illustrates an interaction flow diagram for generating unilaterally signed smart contracts based on contract templates in one embodiment of the present application. As shown in fig. 6, the method for generating the unilaterally signed smart contract based on the data interaction between the resource allocation node and the trading platform node includes the following steps S601 to S608.
Step S601: the trading platform node broadcasts a contract reservation request over the blockchain network.
When a trading demand is generated on a trading platform, a contract establishment request can be generated through a trading platform node and is broadcast on a block chain network, so that other block chain nodes in the block chain network can receive and store the contract establishment request.
Step S602: the resource allocation node listens for contract-making requests transmitted over the blockchain network.
The resource allocation node may listen to broadcast messages transmitted over the blockchain network and identify the message type of each broadcast message to determine whether the broadcast message is a contract establishment request or other message.
Step S603: and analyzing the contract establishment request to obtain a message transmission source and a message transmission target of the contract establishment request.
The trading platform node may encapsulate the message transmission source and the message transmission target in the broadcast message when sending the contract establishment request based on the broadcast message. After the resource allocation node monitors the contract establishment request, the contract establishment request can be analyzed to obtain the message transmission source and the message transmission target carried in the contract establishment request.
Step S604: and if the message transmission source is a trading platform node and the message transmission target is a resource allocation node, sending a contract template for agreeing the resource allocation rule to the trading platform node.
After determining that the message transmission source of the contract establishment request is the trading platform node and the message transmission target is the resource allocation node, the resource allocation node can respond to the request of the trading platform node and send the contract template for agreeing the resource allocation rule to the trading platform node. If the message transmission source is not the trading platform node or the message transmission target is not the resource allocation node, which indicates that the contract establishment request is not a valid request, the resource allocation node may give up responding to it, or may broadcast a prompt message on the blockchain network that is incorrect for the contract establishment request source.
In an embodiment of the application, the resource allocation node may obtain a node address of the trading platform node, and perform point-to-point data transmission to the trading platform node according to the node address of the trading platform node, thereby directly sending the contract template to the trading platform node.
In an embodiment of the application, the resource allocation node may also perform message encapsulation on a contract template for agreeing the resource allocation rule according to a node address of the trading platform node to obtain a contract-making message using the trading platform node as a message transmission target, where the contract-making message is used to instruct the trading platform node to make an intelligent contract corresponding to the contract template; and then broadcasting the contract establishment message on the block chain network so as to send the contract template carried by the contract establishment message to the trading platform node.
In one embodiment of the present application, a trading platform node may listen for broadcast messages transmitted over a blockchain network to obtain a contract template issued by a resource allocation node.
Step S605: and the transaction platform node identifies the fields of the contract template to obtain the fields to be filled in the contract template.
The field to be populated includes at least one of a contract trigger condition, a resource allocation quantity threshold, or a resource allocation proportion threshold. The contract triggering condition is used for determining the triggering condition for executing the intelligent contract, the resource allocation quantity threshold is used for determining the resource quantity range for resource allocation to the trading platform node or the trading subject node, and the resource allocation proportion threshold is used for determining the allocation proportion range for resource allocation to the trading platform node or the trading subject node.
Step S606: and acquiring resource allocation parameters appointed by the trading platform node and the trading subject node, and performing matching detection on the resource allocation parameters and the fields to be filled.
When the merchant is resident on the network transaction platform, the merchant may make an agreement on the resource allocation parameters, for example, may agree that the network transaction platform extracts the service fee according to a certain quantity or a certain proportion, or may also agree on the timing and conditions for paying the service fee by directing the network transaction platform.
Matching detection is carried out on the acquired resource allocation parameters and the fields to be filled in the contract template, and the matching relation between each parameter and each field can be determined, so that how to fill the parameters in the contract template is determined.
Step S607: and when the resource allocation parameter is successfully matched with the field to be filled, writing the resource allocation parameter into the field to be filled.
The trading platform node can respectively carry out matching detection on each resource allocation parameter and each field to be filled, and when one resource allocation parameter is successfully matched with any field to be filled, the resource allocation parameter can be written into the corresponding field to be filled.
Step S608: and signing the contract template filled with the resource allocation parameters to obtain the single-party signature intelligent contract carrying the digital signature of the transaction platform node.
In one embodiment of the present application, a method for signature processing of a contract template filled with resource allocation parameters by a trading platform node may include: abstract extraction is carried out on the contract template filled with the resource distribution parameters through a hash algorithm to obtain a contract abstract; encrypting the contract abstract according to a private key of the trading platform node to obtain a digital signature of the trading platform node; and attaching the digital signature of the transaction platform node to a contract template to obtain the single-party signature intelligent contract carrying the digital signature of the transaction platform node.
FIG. 7 schematically illustrates an interaction flow diagram for generating a multi-signed intelligent contract based on a single-signed intelligent contract, in one embodiment of the present application. As shown in fig. 7, the method for generating a multi-signature intelligent contract based on data interaction between a trading platform node and a trading subject node comprises the following steps S701 to S707.
Step S701: the node of the trading platform acquires the node address of the trading subject node in the block chain network.
Step S702: and performing message encapsulation on the single-party signed intelligent contract according to the node address of the transaction main body node to obtain a contract signature message which takes the transaction main body node as a message transmission target, wherein the contract signature message is used for indicating the transaction main body node to perform signature processing on the single-party signed intelligent contract.
Step S703: and broadcasting the contract-making message on the block chain network so as to send the single-side signature intelligent contract carried by the contract-making message to the transaction body node.
Step S704: and the transaction main node performs field identification on the single-party signed intelligent contract to obtain a filled field in the contract template.
Step S705: and acquiring resource allocation parameters appointed by the trading platform node and the trading subject node, and performing matching detection on the resource allocation parameters and the filled fields.
Step S706: and when the resource allocation parameter is successfully matched with the filled field, carrying out consistency check on the resource allocation parameter and the field content of the filled field.
Step S707: and when the check result of the consistency check is that the check is passed, performing signature processing on the single-party signature intelligent contract to obtain a multiple signature intelligent contract carrying the digital signature of the transaction platform node and the digital signature of the transaction main body node.
In one embodiment of the present application, a method for signing a unilaterally signed smart contract by a transaction principal node may include: carrying out signature separation on the single-party signature intelligent contract to obtain contract content and a digital signature of a transaction platform attached to the contract content; abstract extraction is carried out on contract contents through a hash algorithm to obtain a contract abstract; encrypting the contract abstract according to a private key of the transaction subject node to obtain a digital signature of the transaction subject node; and attaching the digital signature of the transaction platform node and the digital signature of the transaction main body node to contract content to obtain the multi-signature intelligent contract carrying the digital signature of the transaction platform node and the digital signature of the transaction main body node.
FIG. 8 is a diagram that schematically illustrates an interaction flow for resource allocation based on a multi-signature smart contract, in an embodiment of the present application. As shown in fig. 8, the method for completing resource allocation based on data interaction among the trading platform node, the trading subject node and the resource allocation node includes the following steps S801 to S808.
Step S801: the transaction subject node obtains a node address of a resource allocation node in the blockchain network.
Step S802: and performing message encapsulation on the multi-signature intelligent contract according to the node address of the resource allocation node to obtain a contract binding message taking the resource allocation node as a message transmission target, wherein the contract binding message is used for indicating the resource allocation node to perform binding processing on the multi-signature intelligent contract.
Step S803: and broadcasting the contract binding message on the block chain network so as to send the multi-signature intelligent contract carried by the contract binding message to the resource allocation node.
Step S804: and the resource allocation node performs signature verification and content accuracy verification on the multi-signature intelligent contract.
The resource allocation node performs signature separation on the multi-signature intelligent contract to obtain contract content, a digital signature of a trading platform node and a digital signature of a trading main body node, wherein the digital signatures are attached to the contract content. And (4) carrying out abstract extraction on the contract content through a hash algorithm to obtain a contract abstract. And decrypting the digital signature of the transaction platform node according to the public key of the transaction platform node to obtain a first abstract plaintext to be verified. And decrypting the digital signature of the transaction subject node according to the public key of the transaction subject node to obtain a second abstract plaintext to be verified. And carrying out consistency check on the contract abstract, the first abstract plaintext and the second abstract plaintext, and carrying out accuracy check on contract contents when the check is passed.
Step S805: and the trading platform node broadcasts a resource allocation instruction on the block chain network according to the trading demand, wherein the resource allocation instruction is used for indicating the resource allocation node to allocate resources.
Step S806: and the resource allocation node calls the multi-signature intelligent contract according to the resource allocation instruction.
The resource allocation node monitors a resource allocation instruction transmitted on the blockchain network; and analyzing the resource allocation instruction to obtain a message transmission source and a message transmission target of the resource allocation instruction. If the message transmission source is a trading platform node and the message transmission target is a resource allocation node, invoking a multi-signature intelligent contract which is bound with the trading platform node and the trading subject node and passes the verification.
Step S807: and allocating resources to the trading platform node according to the calling result of the multi-signature intelligent contract.
Step S808: and allocating resources to the transaction subject node according to the calling result of the multi-signature intelligent contract.
Fig. 9 schematically shows an interaction flowchart of an embodiment of the present application in a network transaction application scenario. As shown in fig. 9, the transaction platform node in the application scenario is an e-commerce platform, the transaction subject node is a merchant residing on the e-commerce platform, and the resource allocation node is a third party payment mechanism providing fund management and network payment services for the e-commerce platform and the merchant. The method for allocating funds to the e-commerce platform and the merchant based on the application scenario may include the following steps S901 to S908.
Step S901: the e-commerce platform acquires an account distribution contract template provided by a third party payment mechanism, fills contract data items and forms an account distribution contract carrying a single-party signature by using a private key signature of the e-commerce platform.
Step S902: and the e-commerce platform broadcasts and sends the accounting contract on the block chain network, and specifies that the receiver is the merchant residing on the e-commerce platform.
Step S903: and the merchant receives the accounting contract of the block chain clearing.
Step S904: the merchant verifies the platform signature in the split account contract, checks whether the contract data item meets the agreement of both parties, and if so, continues to execute step S905.
Step S905: and the merchant signs the account-separating contract data item by using the merchant private key and attaches the account-separating contract data item to the account-separating contract to obtain the account-separating contract carrying multiple signatures.
Step S906: the merchant broadcasts and sends the account separation contract on the blockchain network, and the receiving party is appointed to be a third-party payment mechanism.
Step S907: and the third party payment mechanism receives the branch account contract data of the block chain clearing.
Step S908: and the third-party payment mechanism verifies the platform signature and the seller signature in the ledger contract, further verifies the accuracy of the contract data item after the signature is verified to be correct, and binds the ledger contract with the seller after the data item is verified to be correct. And when an account separating command issued by the e-commerce platform is received subsequently, the legality of the account separating command of the platform is verified based on the account separating contract.
The application scenario requires the E-commerce platform and the commercial tenant to sign the account splitting data items respectively based on the mode of block chain transmission account splitting contract, so that the account splitting instruction issued by the subsequent E-commerce platform to the third-party payment mechanism is ensured to be in accordance with the agreement already reached by the E-commerce platform and the commercial tenant. The stealing or misuse of the money due to the merchant caused by the error or the abnormity of the e-commerce platform is avoided.
It should be noted that although the various steps of the methods in this application are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the shown steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Embodiments of the apparatus of the present application are described below, which may be used to perform the resource allocation method in the above embodiments of the present application. Fig. 10 schematically shows a block diagram of a structure of a resource allocation apparatus according to an embodiment of the present application. As shown in fig. 10, the resource allocation apparatus 1000 includes: the first signature module 1010 is configured to send a contract template for agreeing a resource allocation rule to a trading platform node in a block chain network, so that the trading platform node performs content filling and signature processing on the contract template to obtain a single-party signature intelligent contract carrying a digital signature of the trading platform node; a second signature module 1020 configured to send the single-party signed intelligent contract to a transaction subject node in the blockchain network, so that the transaction subject node performs content verification and signature processing on the single-party signed intelligent contract to obtain a multiple-signature intelligent contract carrying a digital signature of the transaction platform and a digital signature of the transaction subject; and the allocating module 1030 is configured to perform signature verification on the multiple-signature intelligent contract and allocate resources to the trading platform node and the trading subject node according to the verified multiple-signature intelligent contract.
In some embodiments of the present application, based on the above embodiments, the allocating module 1030 includes: a first signature separation module configured to perform signature separation on the multi-signature intelligent contract to obtain contract content, and a digital signature of the trading platform node and a digital signature of the trading subject node which are attached to the contract content; the first abstract extraction module is configured to extract the abstract of the contract content through a hash algorithm to obtain a contract abstract; the first signature decryption module is configured to decrypt the digital signature of the trading platform node according to the public key of the trading platform node to obtain a first abstract plaintext to be verified; the second signature decryption module is configured to decrypt the digital signature of the transaction subject node according to the public key of the transaction subject node to obtain a second digest plaintext to be verified; a digest checking module configured to perform consistency checking on the contract digest, the first digest plaintext and the second digest plaintext.
In some embodiments of the present application, based on the above embodiments, the allocating module 1030 further includes: a first listening module configured to listen for resource allocation instructions transmitted over the blockchain network; the first analysis module is configured to analyze the resource allocation instruction to obtain a message transmission source and a message transmission target of the resource allocation instruction; the contract calling module is configured to call a verified multi-signature intelligent contract bound with the trading platform node and the trading subject node if the message transmission source is the trading platform node and the message transmission target is a resource allocation node; and the resource allocation module is configured to allocate resources to the trading platform node and the trading subject node according to the calling result of the multi-signature intelligent contract.
In some embodiments of the present application, based on the above embodiments, the first signature module 1010 includes: a second monitoring module configured to monitor contract establishment requests transmitted over the blockchain network; the second analysis module is configured to analyze the contract establishment request to obtain a message transmission source and a message transmission target of the contract establishment request; and the contract sending module is configured to send a contract template for agreeing the resource allocation rule to the trading platform node if the message transmission source is the trading platform node and the message transmission target is the resource allocation node.
In some embodiments of the present application, based on the above embodiments, the contract sending module includes: a first address acquisition module configured to acquire a node address of the trading platform node; the first message encapsulation module is configured to perform message encapsulation on a contract template used for agreeing a resource allocation rule according to the node address of the trading platform node to obtain a contract establishment message taking the trading platform node as a message transmission target, wherein the contract establishment message is used for indicating the trading platform node to establish an intelligent contract corresponding to the contract template; a first message broadcasting module configured to broadcast the contract establishment message on the blockchain network to send a contract template carried by the contract establishment message to the trading platform node.
In some embodiments of the present application, based on the above embodiments, the contract sending module includes: the template broadcasting module is configured to broadcast a contract template for agreeing on resource allocation rules on a block chain network so as to write the contract template into to-be-uplink blocks of each block chain node on the block chain network; the template authentication module is configured to broadcast a to-be-uplink block carrying the contract template on the block chain network when a block generation condition is met, so that each block link point on the block chain network performs common identity authentication on the to-be-uplink block, and performs uplink processing on the to-be-uplink block after the authentication is passed; and the height sending module is configured to send the block height of the target block where the contract template is located to the trading platform node so that the trading platform node can inquire the contract template in the target block.
In some embodiments of the present application, based on the above embodiments, the contract sending module includes: the address and public key acquisition module is configured to acquire a node address and a node public key of the trading platform node; the template encryption module is configured to encrypt a contract template used for agreeing a resource allocation rule according to the node public key to obtain an encrypted contract template; and the encryption sending module is configured to send the encryption contract template to the trading platform node according to the node address, so that the trading platform node decrypts the encryption contract template by using a node private key matched with the node public key to obtain the contract template.
In some embodiments of the present application, based on the above embodiments, the resource allocation apparatus 1000 further includes: a result broadcasting module configured to broadcast the verification result of the multi-signature intelligent contract on the blockchain network to save the verification result of the multi-signature intelligent contract into a contract buffer pool of the blockchain nodes; a data lookup module configured to lookup process data related to the process of contracting the multi-signature smart contract in the contract buffer pool; the first writing module is configured to write a checking result of the multi-signature intelligent contract and the process data into a block to be uplink processed after correlation processing; the block broadcasting module is configured to broadcast the to-be-uplink block on the block chain network when a block generation condition is met, so that the block chain link point on the block chain network performs common identification authentication on the to-be-uplink block, and performs uplink processing on the to-be-uplink block after the block chain link point passes the authentication.
In some embodiments of the present application, based on the above embodiments, the resource allocation apparatus further includes: the duration acquisition module is configured to acquire the buffer duration of each piece of process data in the contract buffer pool; and the second writing module is configured to write the process data into the block to be uplink if the buffering duration of the process data is greater than a duration threshold.
In some embodiments of the present application, based on the above embodiments, the first signature module 1010 further includes: the first field identification module is configured to perform field identification on the contract template to obtain a field to be filled in the contract template; the first field matching module is configured to acquire resource allocation parameters agreed by the trading platform node and the trading subject node, and perform matching detection on the resource allocation parameters and the fields to be filled; a parameter writing module configured to write the resource allocation parameter into the field to be filled when the resource allocation parameter is successfully matched with the field to be filled; and the single-party signature module is configured to perform signature processing on the contract template filled with the resource allocation parameters to obtain a single-party signature intelligent contract carrying the digital signature of the transaction platform node.
In some embodiments of the present application, based on the above embodiments, the unilateral signature module includes: the second abstract extraction module is configured to extract the abstract of the contract template filled with the resource allocation parameters through a hash algorithm to obtain a contract abstract; the first abstract encryption module is configured to encrypt the contract abstract according to a private key of the trading platform node to obtain a digital signature of the trading platform node; and the single-party signature attaching module is configured to attach the digital signature of the trading platform node to the contract template to obtain a single-party signature intelligent contract carrying the digital signature of the trading platform node.
In some embodiments of the present application, based on the above embodiments, the second signature module 1020 includes: a second address acquisition module configured to acquire a node address of a transaction subject node in the blockchain network; the second message encapsulation module is configured to perform message encapsulation on the single-party signed intelligent contract according to the node address of the transaction main body node to obtain a contract signature message which takes the transaction main body node as a message transmission target, wherein the contract signature message is used for indicating the transaction main body node to perform signature processing on the single-party signed intelligent contract; a second message broadcasting module configured to broadcast the contract signature message over the blockchain network to send the unilaterally signed smart contract carried by the contract signature message to the transaction principal node.
In some embodiments of the present application, based on the above embodiments, the second signature module 1020 further includes: a second field identification module configured to perform field identification on the unilaterally signed intelligent contract to obtain a filled field in the contract template; the second field matching module is configured to acquire resource allocation parameters agreed by the trading platform node and the trading subject node, and perform matching detection on the resource allocation parameters and the filled fields; a parameter checking module configured to, when the resource allocation parameter is successfully matched with the filled field, perform consistency check on field contents of the resource allocation parameter and the filled field; and the multiple signature module is configured to perform signature processing on the single-party signature intelligent contract to obtain a multiple signature intelligent contract carrying the digital signature of the transaction platform and the digital signature of the transaction main body when the check result of the consistency check is that the check is passed.
In some embodiments of the present application, based on the above embodiments, the multiple signature module includes: the second signature separation module is configured to perform signature separation on the single-party signature intelligent contract to obtain contract content and a digital signature of the transaction platform attached to the contract content; the third abstract extraction module is configured to extract the abstract of the contract content through a hash algorithm to obtain a contract abstract; the second digest encryption module is configured to encrypt the contract digest according to a private key of the transaction subject node to obtain a digital signature of the transaction subject node; and the multiple signature attaching module is configured to attach the digital signature of the trading platform node and the digital signature of the trading subject node to the contract content to obtain a multiple signature intelligent contract carrying the digital signature of the trading platform node and the digital signature of the trading subject node.
The specific details of the resource allocation apparatus provided in each embodiment of the present application have been described in detail in the corresponding method embodiment, and are not described herein again.
Fig. 11 schematically shows a block diagram of a computer system of an electronic device for implementing an embodiment of the present application.
It should be noted that the computer system 1100 of the electronic device shown in fig. 11 is only an example, and should not bring any limitation to the functions and the application scope of the embodiments of the present application.
As shown in fig. 11, the computer system 1100 includes a Central Processing Unit 1101 (CPU) that can perform various appropriate actions and processes in accordance with a program stored in a Read-Only Memory 1102 (ROM) or a program loaded from a storage section 1108 into a Random Access Memory 1103 (RAM). In the random access memory 1103, various programs and data necessary for system operation are also stored. The cpu 1101, the rom 1102 and the ram 1103 are connected to each other via a bus 1104. An Input/Output interface 1105 (Input/Output interface, i.e., I/O interface) is also connected to bus 1104.
The following components are connected to the input/output interface 1105: an input portion 1106 including a keyboard, mouse, and the like; an output section 1107 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 1108 including a hard disk and the like; and a communication section 1109 including a network interface card such as a local area network card, a modem, or the like. The communication section 1109 performs communication processing via a network such as the internet. The driver 1110 is also connected to the input/output interface 1105 as necessary. A removable medium 1111 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1110 as necessary, so that a computer program read out therefrom is mounted into the storage section 1108 as necessary.
In particular, according to embodiments of the present application, the processes described in the various method flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 1109 and/or installed from the removable medium 1111. When executed by the central processor 1101, the computer program performs various functions defined in the system of the present application.
It should be noted that the computer readable media shown in the embodiments of the present application may be computer readable signal media or computer readable storage media or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, and may also be implemented by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (18)

1. A method for resource allocation, comprising:
sending a contract template for agreeing a resource allocation rule to a trading platform node in a block chain network so that the trading platform node performs content filling and signature processing on the contract template to obtain a single-party signature intelligent contract carrying a digital signature of the trading platform node;
sending the single-party signed intelligent contract to a trading subject node in the block chain network so that the trading subject node performs content verification and signature processing on the single-party signed intelligent contract to obtain a multi-signature intelligent contract carrying a digital signature of the trading platform and a digital signature of the trading subject;
and performing signature verification on the multiple signature intelligent contracts, and allocating resources to the trading platform nodes and the trading subject nodes according to the multiple signature intelligent contracts passing the verification.
2. The method according to claim 1, wherein the signature checking the multi-signature smart contract comprises:
carrying out signature separation on the multi-signature intelligent contract to obtain contract content, a digital signature of the trading platform node and a digital signature of the trading subject node which are attached to the contract content;
abstract extraction is carried out on the contract content through a hash algorithm to obtain a contract abstract;
decrypting the digital signature of the trading platform node according to the public key of the trading platform node to obtain a first abstract plaintext to be verified;
decrypting the digital signature of the transaction subject node according to the public key of the transaction subject node to obtain a second abstract plaintext to be verified;
and performing consistency check on the contract abstract, the first abstract plaintext and the second abstract plaintext.
3. The method of claim 1, wherein allocating resources to the trading platform node and the trading subject node according to the verified multi-signature smart contract comprises:
monitoring resource allocation instructions transmitted on the blockchain network;
analyzing the resource allocation instruction to obtain a message transmission source and a message transmission target of the resource allocation instruction;
if the message transmission source is the trading platform node and the message transmission target is a resource allocation node, calling a multi-signature intelligent contract which is bound with the trading platform node and the trading subject node and passes the verification;
and distributing resources to the trading platform node and the trading subject node according to the calling result of the multi-signature intelligent contract.
4. The method according to claim 1, wherein sending a contract template for contracting resource allocation rules to trading platform nodes in a blockchain network comprises:
monitoring contract-making requests transmitted on a block chain network;
analyzing the contract establishment request to obtain a message transmission source and a message transmission target of the contract establishment request;
and if the message transmission source is a trading platform node and the message transmission target is a resource allocation node, sending a contract template for agreeing a resource allocation rule to the trading platform node.
5. The method of claim 4, wherein sending a contract template for agreeing on resource allocation rules to the trading platform node comprises:
acquiring a node address of the trading platform node;
according to the node address of the trading platform node, performing message encapsulation on a contract template used for appointing a resource allocation rule to obtain a contract booking message which takes the trading platform node as a message transmission target, wherein the contract booking message is used for indicating the trading platform node to book an intelligent contract corresponding to the contract template;
and broadcasting the contract establishment message on the block chain network so as to send a contract template carried by the contract establishment message to the trading platform node.
6. The method according to claim 4, wherein sending a contract template for agreeing on resource allocation rules to the trading platform node comprises:
broadcasting a contract template for agreeing on a resource allocation rule on a block chain network so as to write the contract template into a block to be uplink linked of each block chain node on the block chain network;
when a block generation condition is met, broadcasting a to-be-uplink block carrying the contract template on the block chain network so as to enable each block link point on the block chain network to perform common identification authentication on the to-be-uplink block, and performing uplink processing on the to-be-uplink block after the authentication is passed;
and sending the block height of the target block where the contract template is located to the trading platform node so that the trading platform node can inquire the target block to obtain the contract template.
7. The method according to claim 4, wherein sending a contract template for contracting resource allocation rules to the trading platform node comprises:
acquiring a node address and a node public key of the trading platform node;
encrypting a contract template used for agreeing a resource allocation rule according to the node public key to obtain an encrypted contract template;
and sending the encrypted contract template to the trading platform node according to the node address so that the trading platform node decrypts the encrypted contract template by using a node private key matched with the node public key to obtain the contract template.
8. The method of claim 1, wherein after the verifying the multi-signed smart contract, the method further comprises:
broadcasting the checking result of the multi-signature intelligent contract on the block chain network so as to store the checking result of the multi-signature intelligent contract into a contract buffer pool of block chain nodes;
searching the contract buffer pool for process data related to the process of making the multi-signature intelligent contract;
writing the checking result of the multi-signature intelligent contract and the process data into a block to be uplink after correlation processing;
and when the block generation condition is met, broadcasting the block to be uplink on the block chain network so as to enable the block chain link point on the block chain network to perform common identification authentication on the block to be uplink, and performing uplink processing on the block to be uplink after the authentication is passed.
9. The method of claim 8, wherein before broadcasting the pending uplink block on the blockchain network, the method further comprises:
obtaining the buffering duration of each process data in the contract buffering pool;
and if the buffering duration of the process data is greater than the duration threshold, writing the process data into the block to be uplink.
10. The resource allocation method according to any one of claims 1 to 9, wherein the content padding and signature processing on the contract template includes:
performing field identification on the contract template to obtain a field to be filled in the contract template;
acquiring resource allocation parameters appointed by the trading platform node and the trading subject node, and performing matching detection on the resource allocation parameters and the fields to be filled;
when the resource allocation parameter is successfully matched with the field to be filled, writing the resource allocation parameter into the field to be filled;
and performing signature processing on the contract template filled with the resource allocation parameters to obtain the single-party signature intelligent contract carrying the digital signature of the transaction platform node.
11. The method according to claim 10, wherein signing the contract template filled with the resource allocation parameters comprises:
abstract extraction is carried out on the contract template filled with the resource distribution parameters through a hash algorithm to obtain a contract abstract;
encrypting the contract abstract according to the private key of the trading platform node to obtain a digital signature of the trading platform node;
and attaching the digital signature of the trading platform node to the contract template to obtain the single-party signature intelligent contract carrying the digital signature of the trading platform node.
12. The method according to any one of claims 1 to 9, wherein sending the unilaterally signed smart contract to a transaction principal node in the blockchain network comprises:
acquiring a node address of a transaction subject node in the block chain network;
according to the node address of the transaction main body node, performing message encapsulation on the single-party signed intelligent contract to obtain a contract signature message which takes the transaction main body node as a message transmission target, wherein the contract signature message is used for indicating the transaction main body node to perform signature processing on the single-party signed intelligent contract;
broadcasting the contract signature message on the blockchain network to send the unilaterally signed intelligent contract carried by the contract signature message to the transaction subject node.
13. The resource allocation method according to any one of claims 1 to 9, wherein performing content check and signature processing on the unilaterally signed smart contract comprises:
carrying out field identification on the single-side signed intelligent contract to obtain a filled field in the contract template;
acquiring resource allocation parameters appointed by the trading platform node and the trading subject node, and performing matching detection on the resource allocation parameters and the filled fields;
when the resource allocation parameter is successfully matched with the filled field, carrying out consistency check on the resource allocation parameter and the field content of the filled field;
and when the check result of the consistency check is that the check is passed, performing signature processing on the single-party signature intelligent contract to obtain a multiple signature intelligent contract carrying the digital signature of the transaction platform and the digital signature of the transaction main body.
14. The method according to claim 13, wherein signing the unilaterally signed smart contract comprises:
carrying out signature separation on the single-party signature intelligent contract to obtain contract content and a digital signature of the transaction platform attached to the contract content;
abstract extraction is carried out on the contract content through a hash algorithm to obtain a contract abstract;
encrypting the contract abstract according to the private key of the transaction subject node to obtain a digital signature of the transaction subject node;
and attaching the digital signature of the trading platform node and the digital signature of the trading main body node to the contract content to obtain the multi-signature intelligent contract carrying the digital signature of the trading platform node and the digital signature of the trading main body node.
15. A resource allocation apparatus, comprising:
the system comprises a first signature module, a second signature module and a third signature module, wherein the first signature module is configured to send a contract template for agreeing a resource allocation rule to a trading platform node in a block chain network, so that the trading platform node fills and signs the contract template in content to obtain a single-party signature intelligent contract carrying a digital signature of the trading platform node;
the second signature module is configured to send the single-party signed intelligent contract to a trading subject node in the block chain network, so that the trading subject node performs content verification and signature processing on the single-party signed intelligent contract to obtain a multiple-signature intelligent contract carrying a digital signature of the trading platform and a digital signature of the trading subject;
and the distribution module is configured to perform signature verification on the multi-signature intelligent contract and distribute resources to the trading platform node and the trading subject node according to the multi-signature intelligent contract passing the verification.
16. A computer-readable medium having stored thereon a computer program, characterized in that: the computer program, when executed by a processor, implements the resource allocation method of any one of claims 1 to 14.
17. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the resource allocation method of any one of claims 1 to 14 via execution of the executable instructions.
18. A computer program product or computer program, characterized in that the computer program product or computer program comprises computer instructions, the computer instructions being stored in a computer-readable storage medium; the processor of the computer device reads and executes the computer instructions from the computer-readable storage medium, causing the computer device to perform the resource allocation method of any one of claims 1 to 14.
CN202111107945.XA 2021-09-22 2021-09-22 Resource allocation method and device, computer readable medium and electronic equipment Pending CN115879934A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111107945.XA CN115879934A (en) 2021-09-22 2021-09-22 Resource allocation method and device, computer readable medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111107945.XA CN115879934A (en) 2021-09-22 2021-09-22 Resource allocation method and device, computer readable medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN115879934A true CN115879934A (en) 2023-03-31

Family

ID=85762370

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111107945.XA Pending CN115879934A (en) 2021-09-22 2021-09-22 Resource allocation method and device, computer readable medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN115879934A (en)

Similar Documents

Publication Publication Date Title
CN112214780B (en) Data processing method and device, intelligent equipment and storage medium
US11496312B2 (en) Collecting surveys with secure identities via a blockchain
JP2020528222A (en) Handling of transaction activities based on smart contracts in blockchain Caution Methods and devices for protecting data
EP3761203A1 (en) Information processing method, blockchain node, and electronic apparatus
CN110796449B (en) Transaction processing method, system, medium and computing device
CN108769010B (en) Method and device for node invited registration
CN114881757A (en) Letter method, system and electronic equipment
CN111612452A (en) Intellectual property management system and method based on block chain
JP2023525498A (en) Resource processing method, server, terminal, device, system and storage medium
CN114172663B (en) Business right determining method and device based on block chain, storage medium and electronic equipment
CN110705985A (en) Method and apparatus for storing information
CN111915302B (en) Associated data processing method and device, electronic equipment and computer readable medium
KR101120059B1 (en) Billing verifying apparatus, billing apparatus and method for cloud computing environment
CN116132071B (en) Identity authentication method and device for identification analysis node based on blockchain
CN116975810A (en) Identity verification method, device, electronic equipment and computer readable storage medium
CN115879934A (en) Resource allocation method and device, computer readable medium and electronic equipment
CN115001714A (en) Resource access method and device, electronic equipment and storage medium
CN116894727A (en) Data processing method and device based on block chain and related equipment
CN115967508A (en) Data access control method and device, equipment, storage medium and program product
CN111415148A (en) Method and device for non-inductive payment, electronic equipment and storage medium
CN111127006A (en) Transaction processing method and system based on block chain
CN110766407A (en) Transaction verification method, accounting node and medium based on block chain
CN115766830B (en) Computing power network processing method, device, equipment and storage medium
Rajendran et al. Digital tokens: A scheme for enabling trust between customers and electronic marketplaces
CN115147101A (en) Secure payment method, apparatus, electronic device, medium, and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination