Resource scheduling method and system based on blockchain
By deploying smart contracts in the blockchain network, the scheduling of target resources is achieved to the off-chain destination, the problem that resource scheduling participants need to have blockchain accounts is solved, the applicable scenarios of resource scheduling are broadened, and resource scheduling is allowed to be on the chain It is carried out in the external resource network.
Patent Information
- Application Number
- CN202210224539.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-07
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2042-03-07
AI Technical Summary
In the prior art, the participants in resource scheduling must have a blockchain account, which makes some participants unable to participate in resource scheduling, limiting the applicable scenarios of resource scheduling.
By deploying smart contracts in the blockchain network, receiving resource scheduling requests and calling contracts, the target resources are dispatched to the off-chain destination, and even deploying the target node equipment in the blockchain network and off-chain resource network, realizing the chain Resource scheduling between the lower destination.
The destination of resource scheduling is not required to be restricted in the blockchain network, which broadens the scope of applicable scenarios of resource scheduling methods, allows the destination of resource scheduling to be deployed in the off-chain resource network, and improves the availability of resource scheduling.
Smart Images

Figure CN114615335B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of blockchain technology, and in particular to a resource scheduling method based on blockchain. Background Art
[0002] Blockchain is tamper-proof and is therefore widely used in resource scheduling.
[0003] In related technologies, participants in resource scheduling can schedule target resources corresponding to on-chain resources through scheduling on-chain resources in the blockchain.
[0004] However, the above resource scheduling requires that the participants in the scheduling must have a blockchain account, and in specific applications, it is very likely that some participants do not have a blockchain account. Therefore, a solution with higher availability is needed. Summary of the invention
[0005] In view of this, the embodiments of this specification provide a resource scheduling method based on blockchain. One or more embodiments of this specification also relate to a resource scheduling device based on blockchain, a resource scheduling system based on blockchain, a node device in a blockchain network, a computer-readable storage medium and a computer program to solve the technical defects existing in the prior art.
[0006] According to a first aspect of an embodiment of this specification, a resource scheduling method based on blockchain is provided, which is applied to a node device in a blockchain network, wherein a smart contract for resource scheduling management is deployed in the blockchain network; the method comprises:
[0007] Receiving a resource scheduling request, wherein the resource scheduling request carries off-chain destination information and target resource information;
[0008] In response to the resource scheduling request, calling the smart contract, and scheduling the target resource corresponding to the target resource information to the target node device according to the off-chain destination information, so that the target node device schedules the target resource to the off-chain destination corresponding to the off-chain destination information;
[0009] Among them, the target node device is deployed in the blockchain network and the off-chain resource network, and the off-chain resource network is a network where the off-chain destination is deployed and used for resource scheduling.
[0010] According to a second aspect of an embodiment of this specification, a resource scheduling device based on blockchain is provided, which is applied to a node device in a blockchain network, wherein a smart contract for resource scheduling management is deployed in the blockchain network; the device comprises:
[0011] A scheduling request receiving module receives a resource scheduling request, wherein the resource scheduling request carries off-chain destination information and target resource information;
[0012] The on-chain resource scheduling module, in response to the resource scheduling request, calls the smart contract, and schedules the target resource corresponding to the target resource information to the target node device according to the off-chain destination information, so that the target node device schedules the target resource to the off-chain destination corresponding to the off-chain destination information;
[0013] Among them, the target node device is deployed in the blockchain network and the off-chain resource network, and the off-chain resource network is a network where the off-chain destination is deployed and used for resource scheduling.
[0014] According to a third aspect of the embodiments of this specification, a resource scheduling system based on blockchain is provided, comprising: a node device in a blockchain network, and a target node device deployed in the blockchain network and an off-chain resource network, wherein a smart contract for resource scheduling management is deployed in the blockchain, and the off-chain resource network is a network for deploying an off-chain destination and for resource scheduling;
[0015] The node device in the blockchain network receives a resource scheduling request, wherein the resource scheduling request carries off-chain destination information and target resource information, and in response to the resource scheduling request, calls the smart contract to schedule the target resource corresponding to the target resource information to the target node device according to the off-chain destination information;
[0016] The target node device schedules the target resource to the off-chain destination corresponding to the off-chain destination information.
[0017] According to a fourth aspect of the embodiments of this specification, a node device in a blockchain network is provided, including:
[0018] Memory and processor;
[0019] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the above-mentioned blockchain-based resource scheduling method are implemented.
[0020] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned blockchain-based resource scheduling method are implemented.
[0021] According to the sixth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned blockchain-based resource scheduling method.
[0022] In one embodiment of the present specification, a resource scheduling method based on blockchain is applied to a node device in a blockchain network, wherein a smart contract for resource scheduling management is deployed in the blockchain network; the method includes: receiving a resource scheduling request, wherein the resource scheduling request carries off-chain destination information and target resource information; in response to the resource scheduling request, calling a smart contract, and scheduling the target resource corresponding to the target resource information to the target node device according to the off-chain destination information, so that the target node device schedules the target resource to the off-chain destination corresponding to the off-chain destination information; wherein the target node device is deployed in a blockchain network and an off-chain resource network, and the off-chain resource network is a network for deploying off-chain destinations and for resource scheduling. wherein the target node device is deployed in a blockchain network and an off-chain resource network, and the off-chain resource network is a network for deploying off-chain destinations and for resource scheduling. therefore, for the case where the destination of resource scheduling does not have a blockchain account, that is, it is deployed in an off-chain resource network, this embodiment can schedule the target resource in the resource scheduling for the off-chain destination to the off-chain destination through the above-mentioned target node device. In this way, resource scheduling can be achieved with the destination end off the chain, so there is no need to restrict the destination end of resource scheduling to be in the blockchain network. It can be seen that this solution does not need to restrict the destination end of resource scheduling to be in the blockchain network, thereby broadening the scope of application scenarios of the resource scheduling method based on blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a flowchart of a resource scheduling method based on blockchain provided by an embodiment of this specification;
[0024] Figure 2 is a flowchart of another resource scheduling method based on blockchain provided by an embodiment of this specification;
[0025] Figure 3 This is a schematic diagram of the structure of a resource scheduling system based on blockchain provided by an embodiment of this specification;
[0026] Figure 4 It is a structural diagram of another resource scheduling system based on blockchain provided by an embodiment of this specification;
[0027] Figure 5 It is a flowchart of a resource scheduling process on a blockchain in a resource scheduling method based on blockchain provided in one embodiment of this specification;
[0028] Figure 6 It is a flowchart of the uploading process of off-chain resource scheduling results in a blockchain-based resource scheduling method provided in an embodiment of this specification;
[0029] Figure 7 This is a schematic diagram of an application scenario of a resource scheduling method based on blockchain provided in another embodiment of this specification;
[0030] Figure 8 This is an example diagram of information used by a smart contract in a resource scheduling method based on blockchain provided in one embodiment of this specification;
[0031] Fig. 9 This is a schematic diagram of the structure of a resource scheduling device based on blockchain provided by an embodiment of this specification;
[0032] Fig.10 This is a structural block diagram of a node device in a blockchain network provided by an embodiment of this specification. DETAILED DESCRIPTION
[0033] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0034] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0035] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0036] First, the terms involved in one or more embodiments of this specification are explained.
[0037] Blockchain: From a technological perspective, blockchain involves many scientific and technological issues such as mathematics, cryptography, the Internet, and computer programming. From an application perspective, in simple terms, blockchain is a distributed shared ledger and database that has the characteristics of decentralization, immutability, full traceability, traceability, collective maintenance, and openness and transparency.
[0038] Smart Contract: A computer protocol designed to communicate, verify or execute contracts in an information-based manner. Smart contracts allow for trusted resource scheduling without a third party, which is traceable and irreversible.
[0039] Swift network (Society for Worldwide Interbank Financial Telecommunications): a network that communicates between financial institutions in accordance with the communication standards specified by Swift.
[0040] Bridging refers to the process of forwarding network data packets based on the link layer address of the OSI network model, working at the second layer of OSI. General switches and bridges have bridging functions.
[0041] Block information: After a node on the blockchain generates a transaction, it will broadcast the transaction. Each node on the chain will collect transaction information on the network and put it into the local memory pool for some basic verification. If the verification is successful, it will be placed in the "unconfirmed transaction information pool" to wait for packaging. After the blockchain node obtains the accounting right according to the consensus algorithm, it will extract a certain amount of "unconfirmed transaction information" from the "unconfirmed transaction information pool" for packaging, schedule and package these transaction information into a block, write the unconfirmed transaction information packaged by the node itself into the new block, obtain the block information, and propagate the block information in the blockchain.
[0042] Hypertext Transfer Protocol Secure (HTTPS): is a transmission protocol for secure communication over a computer network. HTTPS communicates via HTTP, but uses SSL / TLS to encrypt data packets. The main purpose of HTTPS development is to provide identity authentication for website servers and protect the privacy and integrity of exchanged data. Among them, SSL (Secure Sockets Layer) and Transport Layer Security (TLS) are security protocols that provide security and data integrity for network communications.
[0043] In this specification, a resource scheduling method based on blockchain is provided. This specification also relates to a resource scheduling device based on blockchain, a resource scheduling system based on blockchain, a node device in a blockchain network, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0044] See also Figure 1 , Figure 1 A flowchart of a resource scheduling method based on blockchain provided by an embodiment of the present specification is shown. The method is applied to a node device in a blockchain network, wherein a smart contract for resource scheduling management is deployed in the blockchain network. The method specifically includes the following steps:
[0045] S102, receiving a resource scheduling request, wherein the resource scheduling request carries off-chain destination information and target resource information.
[0046] In a specific application, a resource scheduling request may be sent by a client of a blockchain account that logs into the above-mentioned blockchain network. Furthermore, the off-chain destination information is used to indicate the attribute information of the destination of resource scheduling, such as the account number, identification, location information, and other attribute information of the destination of resource transfer. The target resource information is used to indicate the attribute information of the scheduled resources, such as the type, quantity, identification, name, source location, and other attribute information of the scheduled resources. The scheduled resources may be of various types, such as funds, computing resources, storage space, and the like. Exemplarily, a resource scheduling request may include: transferring funds from the account of the node device C1 in the blockchain network to the account of the off-chain client C3; migrating the virtual machine on the service node S1 to the service node S2, and the like.
[0047] S104, in response to the resource scheduling request, calls the smart contract, and schedules the target resource corresponding to the target resource information to the target node device according to the off-chain destination information, so that the target node device schedules the target resource to the off-chain destination corresponding to the off-chain destination information; wherein, the target node device is deployed in the blockchain network and the off-chain resource network, and the off-chain resource network is a network where the off-chain destination is deployed and used for resource scheduling.
[0048] In a specific application, the target node device is deployed in the blockchain network and the off-chain resource network, that is, the target node device may include the node device in the blockchain network, and can realize the same function as the node device in the blockchain network. The difference between the target node device and the node device in the blockchain network includes: the node device in the blockchain network can transmit, verify and store the data in the blockchain, and the target node device can transmit, verify, store the data in the blockchain, and send the target resources scheduled to the off-chain resource network to the off-chain destination. In addition, the off-chain destination is deployed in the off-chain resource network, and the off-chain destination can specifically be a client that logs in to the account of the off-chain resource network, or a node device in the off-chain resource network. Correspondingly, the off-chain destination is not deployed in the blockchain network, nor is the account of the blockchain network logged in. In this way, the target node device deployed in the off-chain resource network can communicate with the off-chain destination through the off-chain resource network, thereby realizing resource scheduling between the node device in the blockchain network and the off-chain destination deployed in the off-chain resource network. In addition, illustratively, the off-chain resource network can be a Swift network, a designated local area network, etc., which can perform message forwarding and resource scheduling. In addition, the number of target node devices may be one or more. The specific method of scheduling the target resources corresponding to the target resource information to the target node device according to the off-chain destination information is described below in the form of an exemplary description.
[0049] Exemplarily, when the number of target node devices is one, according to the off-chain destination information, the target resource corresponding to the target resource information is scheduled to the target node device, which may include: if the smart contract determines that the destination information is off-chain destination information, indicating that the target resource is to be scheduled to the off-chain resource network, then the target resource corresponding to the target resource information can be scheduled to the target node device. Or, exemplarily, when the number of target node devices is multiple, according to the off-chain destination information, the target resource corresponding to the target resource information is scheduled to the target node device, which may include: if the smart contract determines that the destination information is off-chain destination information, indicating that the target resource is to be scheduled to the off-chain resource network, then the smart contract can find the target node device corresponding to the off-chain destination information in the resource scheduling request from the correspondence between the node device in the pre-stored blockchain network and the off-chain destination information, and schedule the target resource corresponding to the target resource information to the target node device. In this way, the target node device realizes the role of bridging the blockchain network and the off-chain resource network. In addition, the smart contract schedules the target resources to the target node device, which may specifically include: filling in the resource scheduling path, and scheduling the target resources according to the resource scheduling path; wherein the resource scheduling path represents the scheduling link of the resource, which may reflect the participants in the resource scheduling and the resource flow path between the participants. For example, the scheduling path of funds is: from the fund transferor, that is, the payer: the account of the node device C1 in the blockchain network, to the account of the target node device C2, and from the account of the target node device C2 to the fund transferor, that is, the receiver: the account of the destination end C3 in the off-chain resource network. In one case, if there are multiple target node devices as bridge ends, then if there is a bridge end that is unavailable, the available bridge end can be used to continue resource scheduling.
[0050] In addition, the target node device dispatches the target resource to the off-chain destination corresponding to the off-chain destination information, and specifically follows the resource scheduling rules of the off-chain resource network. For example, the target node device dispatches the target resource to the off-chain destination corresponding to the off-chain destination information in accordance with the fund scheduling method specified by the Swift network. In one case, if the target node device and the off-chain destination are connected through a centralized network, the target node device can send a request to call in the target resource to the central node of the centralized network, and the central node forwards the request to the off-chain destination.
[0051] In addition, in order to facilitate understanding and reasonable layout, the specific method in which the node device in the blockchain network schedules the target resources to the target node device, and the target node device obtains feedback from the destination end off the chain to make the resource scheduling on the blockchain more reliable, will be described in detail in the form of an optional embodiment later.
[0052] In one embodiment of this specification, the target node device is deployed in the blockchain network and the off-chain resource network, and the off-chain resource network is a network where the off-chain destination is deployed and used for resource scheduling. Therefore, for the case where the destination of resource scheduling does not have a blockchain account, that is, it is deployed in the off-chain resource network, this embodiment can schedule the target resources in the resource scheduling for the off-chain destination to the off-chain destination through the above-mentioned target node device. In this way, resource scheduling with the off-chain destination can be achieved, so there is no need to restrict the destination of resource scheduling to be in the blockchain network. It can be seen that this solution does not need to restrict the destination of resource scheduling to be in the blockchain network, thereby broadening the scope of applicable scenarios of the blockchain-based resource scheduling method.
[0053] For ease of understanding, the following Figure 2 Taking as an example, the resource scheduling method based on blockchain provided by the embodiment of this specification is further described from the perspective of interaction between devices. Figure 2 , Figure 2 A flowchart of another resource scheduling method based on blockchain provided by an embodiment of this specification is shown, and the method includes the following steps:
[0054] S202, a node device in the blockchain network receives a resource scheduling request carrying off-chain destination information and target resource information.
[0055] S204, the node device in the blockchain network responds to the resource scheduling request, calls the smart contract, and schedules the target resource corresponding to the target resource information to the target node device according to the off-chain destination information.
[0056] Among them, smart contracts are deployed in the blockchain network for resource scheduling and management.
[0057] S206, the target node device schedules the target resources to the off-chain destination corresponding to the off-chain destination information.
[0058] Among them, the target node device is deployed in the blockchain network and the off-chain resource network. The off-chain resource network is a network that deploys the off-chain destination and is used for resource scheduling.
[0059] The steps of this embodiment are similar to those described above. Figure 1 The steps with the same functions in the embodiments are the same, except that this embodiment is described from an interactive perspective for ease of understanding. The same parts will not be described here in detail. Figure 1 Description of embodiments.
[0060] In one embodiment of this specification, the target node device is deployed in the blockchain network and the off-chain resource network, and the off-chain resource network is a network where the off-chain destination is deployed and used for resource scheduling. Therefore, for the case where the destination of resource scheduling does not have a blockchain account, that is, it is deployed in the off-chain resource network, this embodiment can schedule the target resources in the resource scheduling for the off-chain destination to the off-chain destination through the above-mentioned target node device. In this way, resource scheduling with the off-chain destination can be achieved, so there is no need to restrict the destination of resource scheduling to be in the blockchain network. It can be seen that this solution does not need to restrict the destination of resource scheduling to be in the blockchain network, thereby broadening the scope of applicable scenarios of the blockchain-based resource scheduling method.
[0061] In an optional implementation, a distributed ledger is also deployed in the blockchain network;
[0062] After the target resource corresponding to the target resource information is dispatched to the target node device, the resource scheduling method based on blockchain provided in the embodiment of this specification may further include the following steps:
[0063] Obtain on-chain scheduling results and store them in a distributed ledger;
[0064] Receive the off-chain scheduling result sent by the target node device, update the on-chain scheduling result based on the off-chain scheduling result, and obtain the target scheduling result corresponding to the resource scheduling request, wherein the off-chain scheduling result is fed back to the target node device by the off-chain destination when the target resource is received.
[0065] In specific applications, the node device in the blockchain network can call the smart contract to dispatch the target resource corresponding to the target resource information to the target node device, thereby obtaining the on-chain scheduling result, and storing the on-chain scheduling result in the distributed ledger. In this way, the specific details of obtaining the on-chain scheduling result and storing the on-chain scheduling result are the process of realizing the transmission and storage of data in the blockchain in accordance with the smart contract. Therefore, each node in the blockchain, such as the node device and the target node device in the blockchain network, can participate in the process of data transmission and storage. For ease of understanding, this will be specifically described in the form of an optional embodiment. Among them, the on-chain scheduling result is used to indicate the state change of the target resource targeted by the resource scheduling on the blockchain, that is, it can include the state information recorded for the target resource scheduling to the target node device, wherein the state information is used to record the scheduling information of the resource, and specifically can record the information of each participant in the resource scheduling, the change of resources, the progress of resource scheduling and other information. For example, the target node device information to which the target resource belongs before scheduling, the target node device information transferred by the target resource, the target resource itself information such as resource identification, whether the scheduling of the target resource is completed, etc. Resource type, resource name, etc. Among them, any node device information may include the blockchain account number of the target node device logged in when performing resource scheduling, the target node device identifier, and other information. Figure 8 The state information is specifically described in the embodiments.
[0066] Moreover, when the off-chain destination receives the target resource, it can obtain the off-chain scheduling result and send the off-chain scheduling result to the target node device, that is, feedback. In this way, the target node device uploads the received off-chain scheduling result to the node device in the blockchain network. Among them, the off-chain scheduling result is similar to the on-chain scheduling result, and can include the state information recorded by the target node device for scheduling the target resource to the off-chain destination for resource scheduling. The difference lies in the specific node device, the change of resources and other information. The specific information can be adaptively adjusted according to the specific application scenario. In addition, as a node in the blockchain, the target node device can store the on-chain scheduling results and resource scheduling paths, that is, realize the same function as the node device in the blockchain network. Therefore, the target node device can be used as a node device in the blockchain network. Then, when the on-chain resource scheduling is completed, the target node device reads the on-chain scheduling results and resource scheduling paths stored in the node device in the blockchain network, which can refer to the target node device reading the on-chain scheduling results and resource scheduling paths stored by the target node device itself when the on-chain resource scheduling is completed.
[0067] In one case, if the target node device and the off-chain destination are connected through a centralized network, the off-chain destination can send the off-chain scheduling result to the central node of the centralized network, and the central node forwards the off-chain scheduling result to the off-chain destination.
[0068] See also Figure 3 , Figure 3 The schematic diagram of the structure of a resource scheduling system based on blockchain provided by an embodiment of the specification is shown. The resource scheduling system based on blockchain 300 specifically includes: a node device 302 in a blockchain network, and a target node device 304 deployed in the blockchain network and an off-chain resource network, wherein a smart contract for resource scheduling management is deployed in the blockchain, and the off-chain resource network is a network for deploying an off-chain destination 306 and for resource scheduling;
[0069] A node device 302 in the blockchain network receives a resource scheduling request, wherein the resource scheduling request carries off-chain destination information and target resource information, and in response to the resource scheduling request, calls a smart contract to schedule the target resource corresponding to the target resource information to the target node device 304 according to the off-chain destination information;
[0070] The target node device 304 schedules the target resources to the off-chain destination 306 corresponding to the off-chain destination information.
[0071] In one embodiment of this specification, the target node device is deployed in the blockchain network and the off-chain resource network, and the off-chain resource network is a network where the off-chain destination is deployed and used for resource scheduling. Therefore, for the case where the destination of resource scheduling does not have a blockchain account, that is, it is deployed in the off-chain resource network, this embodiment can schedule the target resources in the resource scheduling for the off-chain destination to the off-chain destination through the above-mentioned target node device. In this way, resource scheduling with the off-chain destination can be achieved, so there is no need to restrict the destination of resource scheduling to be in the blockchain network. It can be seen that this solution does not need to restrict the destination of resource scheduling to be in the blockchain network, thereby broadening the scope of applicable scenarios of the blockchain-based resource scheduling method.
[0072] For example, Figure 4As shown in the structural diagram of another resource scheduling system based on blockchain provided by an embodiment of this specification, the system may include: a node device CUK in the blockchain network, representing bank A, performing resource scheduling through the blockchain network, and a target node device CHK deployed in the blockchain network and an off-chain resource network such as the Swift network and representing bank B. On this basis, the off-chain destination CBK representing bank C is deployed in an off-chain resource network such as the Swift network, that is, connected to the target node device CHK through the Swift network. Assuming that resource scheduling is the resource allocation of funds from account A of the node device CUK in the blockchain network to account B of the off-chain destination CBK, resource scheduling is divided into two sections due to bank capacity issues, that is, because the off-chain destination CBK is not deployed in the blockchain network: the node device CUK in the blockchain network first remits money to the target node device CHK, and after the target node device CHK receives it, it transfers the money to the off-chain destination CBK. Among them, the node device CUK and the target node device CHK in the blockchain network are both on-chain participants, and the off-chain destination CBK is not on the chain.
[0073] The technical solution of the resource scheduling system provided in this embodiment is similar to the above Figure 1 The technical solution of the resource scheduling method belongs to the same concept. For details not described in detail in the technical solution of the resource scheduling system, please refer to the description of the technical solution of the resource scheduling method based on blockchain.
[0074] In an optional implementation manner, the above-mentioned scheduling of the target resource corresponding to the target resource information to the target node device according to the off-chain destination information may specifically include the following steps:
[0075] The target resources corresponding to the target resource information are scheduled to the target node device, the state change information of the target resources is obtained, and based on the state change information, the on-chain scheduling result is obtained.
[0076] Among them, the status change information is the same as the above Figure 1 The state information in the optional embodiment is similar, except that in this embodiment, the target resource corresponding to the target resource information is scheduled to the target node device, and the state change information is recorded. That is, before the target resource corresponding to the target resource information is scheduled to the target node device, the state information in this embodiment is empty or an initial value, and the state information is updated for the scheduling, thereby obtaining the state change information of the target resource.
[0077] In this embodiment, the on-chain scheduling result is obtained based on the state change information of the target resource, which can ensure that the on-chain resource scheduling has a traceable record, which is conducive to the guarantee of credibility and accuracy. The following is an optional embodiment to illustrate the specific method of obtaining the on-chain scheduling result based on the state change information.
[0078] In an optional implementation, obtaining the on-chain scheduling result based on the state change information may specifically include the following steps:
[0079] The state change information is stored as the block information of the blockchain network, so that each node device in the blockchain network can verify whether the block information meets the preset consistency conditions when monitoring the block information. If it meets the conditions, feedback information of verification is sent to the node device in the blockchain network;
[0080] When the feedback information is received, the block information is determined as the on-chain scheduling result.
[0081] Through the consistency verification in this embodiment: verifying whether the block information meets the preset consistency conditions, the use of the tamper-proof characteristics of the blockchain in resource scheduling can be realized, which can ensure the accuracy and reliability of resource scheduling on the chain. In addition, the steps of this embodiment can be specifically Figure 5 For example, Figure 5 In a resource scheduling method based on blockchain provided by one embodiment of this specification, as shown in a flowchart of the resource scheduling process on the chain, the method may include the following steps:
[0082] S502, the node device in the blockchain network initiates on-chain resource scheduling and fills in the target node device information;
[0083] S504, the node devices in the blockchain network perform a sink selection;
[0084] S506, the node devices in the blockchain network call the smart contract to promote resource scheduling, obtain block information, and wait for confirmation from each node device in the blockchain network;
[0085] S508, each node device in the blockchain network calls the smart contract to confirm the current resource scheduling;
[0086] S510, determine whether all parties involved have confirmed the transaction; if so, execute S512; if not, return to execute S508;
[0087] S512, the status information of resource scheduling promoted by the node device in the blockchain network is changed successfully.
[0088] Among them, the selection of the remittance route is to dispatch the target resource to the target node device. The preset consistency condition is the condition stipulated by the smart contract to ensure the consistency of resources in the node device in the blockchain network. The following takes the scenario of resource scheduling as remittance as an example to specifically explain this embodiment. Exemplarily, when a user needs to initiate a remittance on a node device in the blockchain network, a remittance request is first sent to the node device through the client, so that the node device calls the remittance contract and specifies the account information of the payment, that is, the target node device information. The mechanism on the chain, that is, the target node device, will monitor the state changes of the node device contract in the blockchain network. If it is found that the payment resource scheduling initiated by the client's account is found, it will start processing: calling the contract interface and filling in the remittance route information. Among them, the payment bank: the bank where the payment account is located, such as the node device CUK in the blockchain network. The remittance route information refers to the mobile link of the funds. For example, in this embodiment, the node device CUK in the blockchain network pays to the target node device CHK, and the rest is handed over to the destination end CBK under the chain for operation. After the payment bank fills in the remittance route information, the status information recorded by the smart contract is to promote resource scheduling. Then all the participants on the chain can scan the change. The target node device CHK and the node device CUK in the blockchain network know that there is a resource scheduling that needs to be confirmed, that is, verified, by monitoring the block information of the node devices in the blockchain network. If the participants on the chain of resource scheduling confirm that there is no problem, that is, pass the consistency verification, the smart contract is called to advance the status information of the resource scheduling on the chain, that is, update it to the completed state. In addition, this embodiment completes the on-chain resource scheduling, and the on-chain resource scheduling status is completed, that is, the node device CUK in the blockchain network and the target node device CHK have completed the resource scheduling. Because the off-chain destination CBK is not in the blockchain network, it is impossible to confirm whether the off-chain destination CBK has received the funds. Therefore, in order to ensure the accuracy of resource scheduling, the steps of uploading the off-chain resource scheduling results to the node devices in the blockchain network provided in the optional embodiment of this specification can be adopted.
[0089] Furthermore, in order to ensure the security of uploading the off-chain resource scheduling results to the node devices in the blockchain network, and to further improve the credibility and security of resource scheduling, the off-chain resource scheduling results can be verified. To this end, the following is a further description of using the target node device to send the off-chain scheduling results to the node devices in the blockchain network, and based on the off-chain scheduling results, updating the on-chain scheduling results, and obtaining the target scheduling results corresponding to the resource scheduling request in the form of an optional embodiment.
[0090] In an optional implementation, the off-chain scheduling result carries the signature information of the off-chain destination;
[0091] Accordingly, the above-mentioned updating of the on-chain scheduling result based on the off-chain scheduling result to obtain the target scheduling result corresponding to the resource scheduling request may specifically include the following steps:
[0092] Call the smart contract to verify the signature information in the off-chain scheduling result;
[0093] If the verification result is passed, the off-chain scheduling result is used to update the on-chain scheduling result to obtain the target scheduling result corresponding to the resource scheduling request.
[0094] In specific applications, if the off-chain dispatch result is verified in the form of an interface query to a certain off-chain destination, such as a bank, the credibility of the verification result depends entirely on the technical capabilities and credibility of the off-chain destination, such as the bank, and is not reliable enough. Therefore, by performing verification in the form of signature information in this embodiment, it can be unaffected by the technical capabilities and credibility of the off-chain destination, further improving reliability.
[0095] In one case, after calling the smart contract and verifying the signature information in the off-chain scheduling result, the blockchain-based resource scheduling method provided in the embodiment of this specification may further include the following steps:
[0096] If the verification result is not passed, a prompt message of verification failure is sent. The prompt message can be sent to the target node device and / or the off-chain destination, or to a designated security center, etc., to provide a prompt of security issues in resource scheduling. In addition, if the verification result is not passed, resource scheduling can be terminated, thereby stopping the storage of the received off-chain scheduling results.
[0097] In addition, there may be multiple specific methods for verifying the signature information in the off-chain scheduling result, which are described in detail below in the form of optional embodiments.
[0098] In an optional implementation, before receiving the off-chain scheduling result sent by the target node device, the blockchain-based resource scheduling method provided in the embodiment of this specification may further include the following steps:
[0099] Store the public key corresponding to the signature information;
[0100] Call the smart contract to verify the signature information in the off-chain scheduling result, including:
[0101] Call the smart contract and use the public key to verify the signature information in the off-chain scheduling result.
[0102] This embodiment adopts the method of combining the signature of off-chain participants with on-chain signature verification: the public keys of all possible off-chain destinations, such as Swift participating banks, such as security certificates, are stored in the smart contract in advance. At this time, the off-chain destination may include the target node device with a blockchain account. The smart contract can verify the signature of the off-chain scheduling result in the form of HTTPS message. If the verification is passed, the off-chain scheduling result is stored and parsed.
[0103] In an optional implementation, before calling the smart contract and verifying the signature information in the off-chain scheduling result, the blockchain-based resource scheduling method provided in the embodiment of this specification may further include the following steps:
[0104] Generate a verification key corresponding to the signature information through the transport layer security protocol between the target node device and the off-chain destination, and store the verification key in the distributed ledger;
[0105] Accordingly, the above-mentioned calling of the smart contract to verify the signature information in the off-chain scheduling result may specifically include the following steps:
[0106] Call the smart contract and use the verification key to verify the signature information in the off-chain scheduling result.
[0107] This embodiment implements the verification of the TLSNotary mode: the node device in the blockchain network, that is, the node in the blockchain, acts as the auditor to control the key generation process during the HTTPS handshake, so that the HTTPS message can also be verified on the chain. Among them, when the TLSNotary mode is applied to this embodiment, the audited party is the [target node device to forward the Swift message], and what is audited is the [HTTPS message forwarded by the target node device]. It can be seen that this embodiment does not need to pre-store the public key of the destination end off the chain. Therefore, convenience can be improved.
[0108] In an optional implementation, the above-mentioned use of the off-chain scheduling result to update the on-chain scheduling result to obtain the target scheduling result corresponding to the resource scheduling request may specifically include the following steps:
[0109] Parse the off-chain scheduling results and obtain the specified scheduling information;
[0110] Add the specified scheduling information to the on-chain scheduling result, obtain the updated on-chain scheduling result and store it in the distributed ledger, and obtain the target scheduling result corresponding to the resource scheduling request.
[0111] Among them, the designated scheduling information can be information used to prove that the target resource is scheduled to the off-chain destination. For example, the designated scheduling information can be the attribute information of the target resource received by the off-chain destination, the reception time of the target resource, the signature of the off-chain destination, and other information. Among them, the attribute information of the target resource may include the type of target resource such as currency, the quantity of target resources, the name and identification of the target resource, etc. Exemplarily, when the node device CUK or the target node device CHK in the blockchain network receives the amount update message sent by the off-chain destination CBK in the Swift network, the amount update message is updated to the node device in the blockchain network by calling the interface of the remittance management contract. As follows Figure 6 In a resource scheduling method based on blockchain provided in one embodiment of this specification, a flowchart of the process of uploading off-chain resource scheduling results is shown as follows:
[0112] S602, obtaining an off-chain resource scheduling result including a signature of an off-chain destination from an off-chain resource network;
[0113] S604, calling the smart contract to verify the signature using the pre-stored certificate;
[0114] S606, determine whether the verification is passed; if not, execute S608, if passed, execute S610 to S612;
[0115] S608, refusing to store the resource scheduling result;
[0116] S610, storing resource scheduling results for query and backtracking by node devices in the blockchain network;
[0117] S612, extracting designated information from the resource scheduling result, and using the designated information to update the resource scheduling result on the chain.
[0118] In a specific application, the executor of this embodiment is a node device in a blockchain network. The designated information is the designated scheduling information in the above optional embodiment. This embodiment combines the designated scheduling information in the off-chain scheduling result with the on-chain scheduling result and stores it in the node device in the blockchain network, which can ensure that the target scheduling result on the node device in the blockchain network is more comprehensive, making resource scheduling more accurate and reliable.
[0119] In an optional implementation, after calling the smart contract and verifying the signature information in the off-chain scheduling result, the blockchain-based resource scheduling method provided in the embodiment of this specification may further include the following steps:
[0120] If the verification result is passed, the incentive resources are determined based on the on-chain scheduling result and scheduled to the target node device.
[0121] This embodiment improves the tracking timeliness of off-chain resource scheduling results on node devices in the blockchain network by introducing a forwarding mechanism for off-chain messages. Specifically, for off-chain resource scheduling results, that is, messages sent by off-chain resource networks such as Swift networks, the forwarding end is incentivized: which target node device first forwards the Swift message to the blockchain network, and calls the smart contract for verification and storage, then the forwarding end is incentivized accordingly. Among them, incentives include but are not limited to: allocating a portion of the resources on the node devices in the blockchain network to the forwarding end. For example, a resource scheduling is a remittance of 10,000 yuan. Generally, the node devices in the blockchain network will deduct 10 yuan as a handling fee, and the payee will only receive 9,990 yuan. A certain amount of 1 or 2 yuan can be taken out of the 10 yuan to incentivize the forwarding end: transfer part of the handling fee of the resource scheduling to the user, that is, the on-chain account of the forwarding end (the balance of the on-chain account has increased a little). When the user sees that the balance of his on-chain account has increased, he can use the account balance as a voucher to ask the bank to transfer money offline. In this way, by introducing a competitive forwarding model, the operating efficiency is improved, and it is also ensured that the chain can receive status changes off the chain in a timely manner, making the on-chain data more accurate and comprehensive, which is conducive to the credibility of resource scheduling.
[0122] The following combination Figure 7 , taking the application of the resource scheduling method provided in this specification as an example, further explanation is given. Figure 7 A schematic diagram of an application scenario of a resource scheduling method based on blockchain provided in another embodiment of this specification is shown, including:
[0123] Node device C1, node device C2, node device C3. Among them, node device C1 and node device C2 are target node devices with blockchain accounts, and node device C2 is the off-chain destination. The node devices in the blockchain network may include each node in the blockchain network to which node device C1 and node device C2 belong. Moreover, node device C1 and node device C2 are both connected to node device C3 through the Swift network. Therefore, node device C1 or node device C2 can be used as a bridge end to obtain Swift messages and deliver Swift messages. Among them, Swift message acquisition refers to obtaining the off-chain scheduling results of off-chain resource scheduling for node device C3 through the Swift network; Swift message delivery refers to uploading the off-chain scheduling results to the blockchain network, that is, each node in the blockchain. The node devices in the blockchain network corresponding to the blockchain network can process the on-chain resource scheduling between node device C1 and node device C2 initiated by the user through node device C1 through smart contracts. In the case where the resource scheduling initiated by the user involves the node device C3, the resource scheduling system provided in this embodiment can obtain the off-chain resource scheduling result for the node device C3 through the bridge end, and merge it into the on-chain resource scheduling result, thereby ensuring that the node device C3 does not need to access the blockchain network, and can store the corresponding resource scheduling result in the blockchain to improve security, taking into account the availability and security of the resource scheduling system. For ease of understanding, the following takes the resource as the funds stored in the bank account and the resource scheduling as the fund transaction as an example to further explain the application scenario of the resource scheduling system provided in this embodiment.
[0124] Exemplarily, in this application scenario, the resource scheduling system includes: bank 1 corresponding to node device C1, bank 2 corresponding to node device C2, bank 3 corresponding to node device C3, and user user. Among them, bank 1 and bank 2 are both in the Swift network and have blockchain accounts. Bank 1, bank 2, and user correspond to participants on the blockchain, and participate in the confirmation and scheduling status promotion process of on-chain resource scheduling. Bank 1, bank 2, and bank 3 are participants in the Swift network and are connected through the Swift network. The bridge has both Swift network inspection capabilities and blockchain accounts, and can forward and store Swift information on the blockchain. The bridge end can be bank 1 or bank 2. There are traditional Swift networks and blockchain networks in the system. Among them, the Swift network, as a centralized messaging system, connects different participants in resource scheduling. The blockchain network realizes the functions of promoting the resource scheduling status of participants, trusted storage and tracking of off-chain information, etc.
[0125] Figure 8This is an example diagram of information used by smart contracts in a resource scheduling method based on blockchain provided by an embodiment of this specification. For example, smart contracts deployed in node devices in a blockchain network can use Figure 8 The information shown is used for resource scheduling. Among them, the information used by the smart contract may include: resource scheduling information, status information, off-chain tracking information and other information. Specifically: resource scheduling information may include: node device information in the blockchain network, resource attribute information, off-chain destination information and other information used to initiate resource scheduling. The status information may include: initialization → scheduling path confirmation → participant review → transaction completion. Among them, "→" represents the order in which the status information is generated, that is, first initialize and obtain resource scheduling information; when the resource scheduling information is obtained, confirm the scheduling path, that is, obtain the scheduling path in the resource scheduling request; and then perform on-chain resource scheduling according to the scheduling path to obtain block information. On this basis, the participant, that is, the target node device, reviews the block information and generates feedback information, thereby generating information on the completion of the transaction, and the completion of the transaction is the completion of resource scheduling. The off-chain tracking information may include: [Hypertext Transfer Protocol Security message and / or signature information] + off-chain status information, that is, the off-chain status information can be added to the HTTPS message, or the signature information can be added to the off-chain status information, and the signature information is the signature information of the off-chain destination, or the off-chain status information and signature information can be added to the HTTPS message. In this way, for resource scheduling, the resource scheduling information is filled in when the smart contract is initialized, and then after the scheduling path is confirmed, the participants review, and the transaction is completed, the smart contract maintains the status information. In addition, the smart contract can receive the off-chain tracking information through the target node device connected to the off-chain destination, thereby obtaining the off-chain status information and verifying and storing it.
[0126] The method in this embodiment is the same as the above Figure 1 Embodiment and Figure 1 The optional embodiments belong to the same inventive concept. Therefore, the specific steps performed by each execution subject in this embodiment can be referred to in the above Figure 1 Embodiment and Figure 1 The description of the optional embodiments will not be repeated here.
[0127] Corresponding to the above method embodiment, this specification also provides a resource scheduling device embodiment based on blockchain, Fig. 9 The following is a schematic diagram showing a resource scheduling device based on blockchain provided by an embodiment of this specification. Fig. 9 As shown, a node device is applied to a blockchain network, wherein a smart contract for resource scheduling management is deployed in the blockchain network; the device includes:
[0128] The scheduling request receiving module 902 receives a resource scheduling request, wherein the resource scheduling request carries off-chain destination information and target resource information;
[0129] The on-chain resource scheduling module 904, in response to the resource scheduling request, calls the smart contract, and schedules the target resource corresponding to the target resource information to the target node device according to the off-chain destination information, so that the target node device schedules the target resource to the off-chain destination corresponding to the off-chain destination information;
[0130] Among them, the target node device is deployed in the blockchain network and the off-chain resource network. The off-chain resource network is a network that deploys the off-chain destination and is used for resource scheduling.
[0131] In one embodiment of this specification, the target node device is deployed in the blockchain network and the off-chain resource network, and the off-chain resource network is a network where the off-chain destination is deployed and used for resource scheduling. Therefore, for the case where the destination of resource scheduling does not have a blockchain account, that is, it is deployed in the off-chain resource network, this embodiment can schedule the target resources in the resource scheduling for the off-chain destination to the off-chain destination through the above-mentioned target node device. In this way, resource scheduling with the off-chain destination can be achieved, so there is no need to restrict the destination of resource scheduling to be in the blockchain network. It can be seen that this solution does not need to restrict the destination of resource scheduling to be in the blockchain network, thereby broadening the scope of applicable scenarios of the blockchain-based resource scheduling method.
[0132] Optionally, a distributed ledger is also deployed in the blockchain network;
[0133] The on-chain resource scheduling module 904 further obtains an on-chain scheduling result after scheduling the target resource corresponding to the target resource information to the target node device, and stores the on-chain scheduling result in the distributed ledger;
[0134] Receive the off-chain scheduling result sent by the target node device, update the on-chain scheduling result based on the off-chain scheduling result, and obtain the target scheduling result corresponding to the resource scheduling request, wherein the off-chain scheduling result is fed back to the target node device by the off-chain destination when receiving the target resource.
[0135] Optionally, the off-chain scheduling result carries the signature information of the off-chain destination end;
[0136] The on-chain resource scheduling module 904 further calls the smart contract to verify the signature information in the off-chain scheduling result; if the verification result is passed, the on-chain scheduling result is updated using the off-chain scheduling result to obtain the target scheduling result corresponding to the resource scheduling request.
[0137] Optionally, the device further comprises: a public key storage module, storing a public key corresponding to the signature information;
[0138] The on-chain resource scheduling module 904 further calls the smart contract and uses the public key to verify the signature information in the off-chain scheduling result.
[0139] Optionally, the device further comprises: a key generation module, which generates a verification key corresponding to the signature information through a transport layer security protocol between the target node device and the off-chain destination, and stores the verification key in the distributed ledger;
[0140] The on-chain resource scheduling module 904 further calls the smart contract and uses the verification key to verify the signature information in the off-chain scheduling result.
[0141] Optionally, the device further includes: an incentive module, which, when the verification result is passed, determines incentive resources based on the on-chain scheduling result, and schedules the incentive resources to the target node device.
[0142] Optionally, the on-chain resource scheduling module 904 further analyzes the off-chain scheduling result to obtain specified scheduling information;
[0143] The specified scheduling information is added to the on-chain scheduling result, an updated on-chain scheduling result is obtained and stored in the distributed ledger, and a target scheduling result corresponding to the resource scheduling request is obtained.
[0144] Optionally, the on-chain resource scheduling module 904 further schedules the target resource corresponding to the target resource information to the target node device, obtains the state change information of the target resource, and obtains the on-chain scheduling result based on the state change information.
[0145] Optionally, the on-chain resource scheduling module 904 further stores the state change information as block information of the blockchain network, so that each node device in the blockchain network verifies whether the block information meets the preset consistency condition when monitoring the block information, and if so, sends verification feedback information to the node device in the blockchain network;
[0146] When the feedback information is received, the block information is determined as the on-chain scheduling result.
[0147] The above is a schematic scheme of a resource scheduling device of this embodiment. It should be noted that the technical scheme of the resource scheduling device and the technical scheme of the resource scheduling method applied to the blockchain belong to the same concept, and the details of the technical scheme of the resource scheduling device applied to the blockchain that are not described in detail can be found in the description of the technical scheme of the resource scheduling method applied to the blockchain.
[0148] Fig.10 The structural block diagram of a node device in a blockchain network provided according to an embodiment of the present specification is shown. The components of the node device 1000 include but are not limited to a memory 1010 and a processor 1020. The processor 1020 is connected to the memory 1010 via a bus 1030, and the database 1050 is used to store data.
[0149] The node device 1000 also includes an access device 1040, which enables the node device 1000 to communicate via one or more networks 1060. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1040 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0150] In one embodiment of the present specification, the above components of the node device 1000 and Fig.10 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.10 The node device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0151] The node device 1000 may be any type of stationary or mobile device, including a mobile computer or mobile device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary device such as a desktop computer or a PC. The node device 1000 may also be a mobile or stationary server.
[0152] Among them, the processor 1020 is used to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-mentioned blockchain-based resource scheduling method.
[0153] The above is a schematic scheme of a node device in a blockchain network of this embodiment. It should be noted that the technical scheme of the node device and the technical scheme of the resource scheduling method based on blockchain mentioned above belong to the same concept, and the details of the technical scheme of the node device that are not described in detail can be found in the description of the technical scheme of the resource scheduling method based on blockchain mentioned above.
[0154] An embodiment of the present specification also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned blockchain-based resource scheduling method.
[0155] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the resource scheduling method based on blockchain mentioned above belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the resource scheduling method based on blockchain mentioned above.
[0156] An embodiment of the present specification also provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned blockchain-based resource scheduling method.
[0157] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the resource scheduling method described above belong to the same concept, and the details not described in detail in the technical scheme of the computer program can be found in the description of the technical scheme of the resource scheduling method based on blockchain.
[0158] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0159] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0160] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0161] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0162] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. A resource scheduling method based on blockchain, applied to node devices in a blockchain network, wherein: A smart contract for resource scheduling management is deployed in the blockchain network, and a distributed ledger is also deployed in the blockchain network; the method includes: Receiving a resource scheduling request, wherein the resource scheduling request carries a scheduling path, off-chain destination information, and target resource information; In response to the resource scheduling request, the smart contract is called, and according to the off-chain destination information, the target resource corresponding to the target resource information is scheduled to the target node device, so that the target node device schedules the target resource to the off-chain destination corresponding to the off-chain destination information, wherein the smart contract obtains the scheduling path in the resource scheduling request during initialization, and the scheduling path is used for on-chain resource scheduling; Obtaining an on-chain scheduling result, and storing the on-chain scheduling result in the distributed ledger; Receive the off-chain scheduling result sent by the target node device, update the on-chain scheduling result based on the off-chain scheduling result, and obtain the target scheduling result corresponding to the resource scheduling request, wherein the off-chain scheduling result is fed back to the target node device by the off-chain destination end when receiving the target resource; Among them, the target node device is deployed in the blockchain network and the off-chain resource network, and the off-chain resource network is a network where the off-chain destination is deployed and used for resource scheduling.
2. According to the method of claim 1, the off-chain scheduling result carries the signature information of the off-chain destination; The updating the on-chain scheduling result based on the off-chain scheduling result to obtain the target scheduling result corresponding to the resource scheduling request includes: Call the smart contract to verify the signature information in the off-chain scheduling result; If the verification result is passed, the on-chain scheduling result is updated using the off-chain scheduling result to obtain the target scheduling result corresponding to the resource scheduling request.
3. According to the method of claim 2, before receiving the off-chain scheduling result sent by the target node device, the method further comprises: Storing a public key corresponding to the signature information; The calling of the smart contract and verification of the signature information in the off-chain scheduling result include: The smart contract is called, and the signature information in the off-chain scheduling result is verified using the public key.
4. According to the method of claim 2, before calling the smart contract and verifying the signature information in the off-chain scheduling result, the method further comprises: Generate a verification key corresponding to the signature information through a transport layer security protocol between the target node device and the off-chain destination, and store the verification key in the distributed ledger; The calling of the smart contract and verification of the signature information in the off-chain scheduling result include: The smart contract is called, and the verification key is used to verify the signature information in the off-chain scheduling result.
5. According to the method according to any one of claims 2 to 4, after calling the smart contract and verifying the signature information in the off-chain scheduling result, the method further comprises: If the verification result is passed, the incentive resources are determined based on the on-chain scheduling result, and the incentive resources are scheduled to the target node device.
6. The method according to any one of claims 2 to 4, wherein the step of updating the on-chain scheduling result using the off-chain scheduling result to obtain the target scheduling result corresponding to the resource scheduling request comprises: Parsing the off-chain scheduling result to obtain the specified scheduling information; The specified scheduling information is added to the on-chain scheduling result, an updated on-chain scheduling result is obtained and stored in the distributed ledger, and a target scheduling result corresponding to the resource scheduling request is obtained.
7. The method according to any one of claims 1 to 4, wherein the step of scheduling the target resource corresponding to the target resource information to the target node device according to the off-chain destination information comprises: The target resource corresponding to the target resource information is scheduled to the target node device, the state change information of the target resource is obtained, and based on the state change information, the on-chain scheduling result is obtained.
8. According to the method of claim 7, obtaining the on-chain scheduling result based on the state change information comprises: The state change information is stored as the block information of the blockchain network, so that each node device in the blockchain network verifies whether the block information meets the preset consistency condition when monitoring the block information, and if so, sends feedback information of the verification to the node device in the blockchain network; When the feedback information is received, the block information is determined as the on-chain scheduling result.
9. A resource scheduling device based on blockchain, applied to node devices in a blockchain network, wherein: The blockchain network is deployed with a smart contract for resource scheduling management, and the blockchain network is also deployed with a distributed ledger; the device includes: A scheduling request receiving module receives a resource scheduling request, wherein the resource scheduling request carries a scheduling path, off-chain destination information, and target resource information; The on-chain resource scheduling module calls the smart contract in response to the resource scheduling request, and schedules the target resource corresponding to the target resource information to the target node device according to the off-chain destination information, so that the target node device schedules the target resource to the off-chain destination corresponding to the off-chain destination information, wherein the smart contract obtains the scheduling path in the resource scheduling request at the time of initialization, and the scheduling path is used for on-chain resource scheduling; The on-chain resource scheduling module further obtains an on-chain scheduling result after scheduling the target resource corresponding to the target resource information to the target node device, and stores the on-chain scheduling result in the distributed ledger; receives the off-chain scheduling result sent by the target node device, updates the on-chain scheduling result based on the off-chain scheduling result, and obtains the target scheduling result corresponding to the resource scheduling request, wherein the off-chain scheduling result is fed back to the target node device by the off-chain destination end when receiving the target resource; Among them, the target node device is deployed in the blockchain network and the off-chain resource network, and the off-chain resource network is a network where the off-chain destination is deployed and used for resource scheduling.
10. A resource scheduling system based on blockchain, comprising: A node device in a blockchain network, and a target node device deployed in the blockchain network and an off-chain resource network, wherein a smart contract for resource scheduling management is deployed in the blockchain, a distributed ledger is also deployed in the blockchain network, and the off-chain resource network is a network that deploys an off-chain destination and is used for resource scheduling; The node device in the blockchain network receives a resource scheduling request, wherein the resource scheduling request carries a scheduling path, off-chain destination information, and target resource information, and in response to the resource scheduling request, calls the smart contract, and schedules the target resource corresponding to the target resource information to the target node device according to the off-chain destination information, wherein the smart contract obtains the scheduling path in the resource scheduling request during initialization, and the scheduling path is used for on-chain resource scheduling; The target node device schedules the target resource to the off-chain destination corresponding to the off-chain destination information; The node device in the blockchain network further obtains an on-chain scheduling result and stores the on-chain scheduling result in the distributed ledger; receives the off-chain scheduling result sent by the target node device, updates the on-chain scheduling result based on the off-chain scheduling result, and obtains the target scheduling result corresponding to the resource scheduling request, wherein the off-chain scheduling result is fed back to the target node device by the off-chain destination when receiving the target resource.
11. A node device in a blockchain network, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the blockchain-based resource scheduling method described in any one of claims 1 to 8 are implemented.
12. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the blockchain-based resource scheduling method described in any one of claims 1 to 8.
