Cloud Service Provisioning Method for Resource-Constrained Nodes in Blockchain

By setting up a service alliance outside the blockchain network and providing computing and storage services, the performance and security problems of resource-constrained nodes are solved, reliable and secure cloud services are achieved, and the overall performance and security of the blockchain network are improved.

CN116633675BActive Publication Date: 2025-07-29YUNNAN UNIV

Patent Information

Application Number
CN202310797010.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2025-07-29
Estimated Expiration
2043-06-30

AI Technical Summary

Technical Problem

When blockchain node resources are limited, insufficient computing, storage and network resources lead to performance degradation and increased security risks. The existing cloud service provision methods have security risks and single point of failure risks.

Method used

Set up a service alliance outside the blockchain network, including several cloud service nodes, build a P2P network and service alliance blockchain network, provide computing and storage services, and ensure the reliability and security of services through credit value mechanisms and consensus algorithms.

Benefits of technology

Provide reliable and secure cloud services for blockchain nodes with limited resources, improve node maintenance capabilities, and ensure service traceability and security through the immutable characteristics of blockchain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116633675B_ABST
    Figure CN116633675B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for providing cloud services for resource-constrained nodes in a blockchain. A service alliance is set up outside the blockchain network. The service alliance is a blockchain network composed of several cloud service nodes, which provides computing services and storage services to blockchain nodes. When a node in the blockchain network needs cloud services, it generates a service request including a transfer transaction, service content, and data required for the service, and sends it to the selected cloud service node. After the cloud service node verifies and passes the service request, it executes the service request, then generates a service transaction and feedbacks it to the service request node, and broadcasts the current service transaction in the service alliance and conducts consensus by the service alliance. After the consensus is passed, the current service transaction is recorded in the blockchain. The present invention provides reliable and secure cloud services to resource-constrained nodes in the blockchain network by setting up a service alliance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of blockchain. More specifically, it relates to a method for providing cloud services for resource-constrained nodes in a blockchain. Background Art

[0002] A blockchain is a decentralized, trustless, tamper-proof, traceable, and multi-party jointly maintained distributed database. Based on these good characteristics, blockchain technology has been widely applied in industries such as finance, supply chain, and healthcare. However, the deployment of a blockchain usually requires various resources, mainly including the following three types of resources:

[0003] 1. Computational resources. Some consensus algorithms of blockchains require nodes to have a large amount of computing power for generating new blocks and maintaining the blockchain. When the computational resources of a node are limited, it may affect the transaction confirmation speed and the security of the entire blockchain.

[0004] 2. Storage resources. Nodes in a blockchain need a large amount of storage space to store transaction records and block data. Moreover, as the blockchain is constantly growing, newly generated transactions and blocks also require space for storage. When the storage resources of a node are limited, it may affect the performance and scalability of the entire blockchain.

[0005] 3. Network resources. Transactions, blocks, or information in blockchain maintenance between nodes need to be transmitted between nodes through the network. When the network resources of a node are limited, the information transmission speed and transaction confirmation speed between nodes will be reduced, which may affect the performance of the entire blockchain.

[0006] When the resources of nodes in a blockchain are limited, it will affect the performance or security of the entire blockchain. Therefore, if a blockchain is deployed in a resource-constrained environment, it may lead to problems such as a decrease in blockchain performance, network congestion, and an increase in security risks. Currently, some work has been done to reduce the consumption of computational resources, storage resources, and network resources by nodes in a blockchain through measures such as improving consensus algorithms and compressing block data, so as to optimize the scalability of the blockchain.

[0007] Meanwhile, there is also work on integrating blockchain with cloud computing. Nodes with limited computational resources can offload their own computational tasks to the cloud for processing to make up for the lack of their own computational resources. Nodes with limited storage resources can, after adopting a lightweight strategy for the blockchain structure, only save necessary key data on the local blockchain and then store specific data off-chain. The cloud is often considered as a storage container.

[0008] However, this method of enhancing blockchain scalability by integrating the cloud also brings new problems. Since these methods usually use a centralized architecture to provide cloud services, this will pose serious security risks. The tampering of critical data will directly affect the normal function of the blockchain network using these services. Moreover, the centralized architecture has the risk of single-point failure and needs further improvement. Summary of the Invention

[0009] The object of the present invention is to overcome the deficiencies of the prior art and provide a method for providing cloud services for resource-constrained nodes in a blockchain. By setting up a service alliance, reliable and secure cloud services are provided to the resource-constrained nodes in the blockchain network to ensure the security of the service provision process, so as to help these nodes better maintain the blockchain network they join.

[0010] To achieve the above object of the invention, the method for providing cloud services for resource-constrained nodes in the blockchain of the present invention includes the following steps:

[0011] S1: Set up a service alliance outside the blockchain network. The service alliance includes several cloud service nodes. All cloud service nodes jointly construct a P2P network and a service alliance blockchain network based on this P2P network. The service alliance is used to provide computing services and storage services to the nodes in the blockchain network; the service alliance assigns an account to each cloud service node. The nodes in the blockchain network register with the service alliance. After successful registration, the service alliance assigns an account to each node in the blockchain network. The account stores credit values for payment. The credit value of the cloud service node is obtained through block rewards and providing services to the nodes in the blockchain network. The credit value of the blockchain network node is obtained through recharge;

[0012] S2: When a node in the blockchain network needs cloud services due to resource constraints, select a cloud service node from the service alliance according to a preset service node selection strategy, and then generate a transfer transaction, including its own account in the service alliance, the account of the selected cloud service node, and the credit value paid for this cloud service; at the same time, generate service content according to the requested cloud service, including a service type identifier Method and data input Input. When the requested cloud service is a computing service, the service type identifier Method is the identifier of the computing service, and the data input Input is the block header data of the computing block. When the requested cloud service is a storage service, the service type identifier Method is the identifier of the storage service, and the data input Input is the hash value of the required storage block; package the transfer transaction, service content, and service required data into a service request and send it to the selected cloud service node; when the requested cloud service is a computing service, the service required data is empty. When the requested cloud service is a storage service, the service required data is the required storage block;

[0013] S3: When the cloud service node receives a service request, it extracts the service transaction and the data required for the service from the service request, verifies whether the service request node is a legitimate node, detects whether the transfer transaction in the service transaction is valid, and checks whether the data input Input in the service content is consistent with the data required for the service. If any one of the verifications fails, the service request verification fails, and the cloud service node responds to the service request node with the failure of this service, and this service ends. Otherwise, it proceeds to step S4;

[0014] S4: The cloud service node first broadcasts this transfer transaction in the service alliance and freezes the amount of fees of the service request node according to the transfer transaction. Then the cloud service node starts to execute the service. If the service execution fails, the cloud service node responds to the service request node with the failure of this service, generates a service transaction and feeds it back to the service request node, and then releases the fund freeze of the service request node. If the service execution is successful, it executes the transfer transaction, and then generates a service transaction and feeds it back to the service request node. The service transaction includes a transfer transaction field transaction and a service content field SC. The transfer transaction field transaction is the transfer transaction. The service content field includes a service type identifier Method, a data input Input, an execution result Output, and a signature Signature. The execution result Output is the return value obtained by the cloud service node for executing this service for the service request node, and the signature Signature is the signature of the cloud service node for this service;

[0015] S5: The cloud service node forms a service transaction block from multiple copies of this service transaction and broadcasts it in the service alliance. The service alliance conducts consensus on the service transaction block. After the consensus is passed, the service transaction block is stored in the service alliance blockchain network.

[0016] To achieve the above invention object, the present invention provides a method for cloud services of resource-constrained nodes in a blockchain. A service alliance is set up outside the blockchain network. The service alliance is a blockchain network composed of several cloud service nodes, which provides computing services and storage services to the blockchain nodes. When a node in the blockchain network needs cloud services, it generates a service request including a transfer transaction, service content, and data required for the service and sends it to the selected cloud service node. After the cloud service node verifies the service request and passes, it executes the service request, then generates a service transaction and feeds it back to the service request node, and broadcasts this service transaction in the service alliance and conducts consensus by the service alliance. After the consensus is passed, this service transaction is recorded in the blockchain.

[0017] The present invention has the following beneficial effects:

[0018] 1) By setting up a service alliance, reliable and secure cloud services are provided to resource-constrained nodes in the blockchain network, ensuring the security of the service provision process to help these nodes better maintain the blockchain network they join.

[0019] 2) The service alliance set up in the present invention is implemented based on the blockchain. By utilizing the characteristics of the blockchain such as immutability and traceability, while providing services to the blockchain network nodes, the provided services can also be traced, and the data stored on the service alliance will not be maliciously modified. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flowchart of the specific implementation manner of the method for providing cloud services to resource-constrained nodes in the blockchain according to the present invention;

[0021] Figure 2 is a schematic diagram of the service alliance of the present invention;

[0022] Figure 3 is a data structure diagram of service transactions in the present invention;

[0023] Figure 4 is a flowchart of the consensus method for electing a leader based on credit values in this embodiment. DETAILED DESCRIPTION OF THE INVENTION

[0024] The following describes the specific implementation manner of the present invention with reference to the accompanying drawings so that those skilled in the art can better understand the present invention. It should be particularly noted that in the following description, when the detailed description of known functions and designs may obscure the main content of the present invention, these descriptions will be omitted here.

[0025] EXAMPLE

[0026] Figure 1 is a flowchart of the specific implementation manner of the method for providing cloud services to resource-constrained nodes in the blockchain according to the present invention. As Figure 1 shown, the specific steps of the method for providing cloud services to resource-constrained nodes in the blockchain according to the present invention include:

[0027] S101: Construct a service alliance:

[0028] A service alliance is set up outside the blockchain network. The service alliance includes several cloud service nodes. All cloud service nodes jointly construct a P2P network and a service alliance blockchain network based on this P2P network. The service alliance provides computing services and storage services to the nodes in the blockchain network. The service alliance assigns an account to each cloud service node. The nodes in the blockchain network register with the service alliance. After successful registration, the service alliance assigns an account to each node in the blockchain network. The account stores credit values for payment. The credit values of cloud service nodes are obtained through block rewards and providing services to the nodes in the blockchain network. The credit values of blockchain network nodes are obtained through top-ups.

[0029] Figure 2 It is a schematic diagram of the service alliance of the present invention. As Figure 2 shown, a blockchain network is composed of various terminal devices. However, due to the shortage of various resources of some devices, it is difficult to join the maintenance of the blockchain. The service alliance is another blockchain network independent of the blockchain network and provides cloud services to the nodes in the blockchain network. Deploying the service alliance on the cloud can ensure the reliability of these cloud services while providing cloud services for these resource-constrained nodes. By using these reliable cloud services, these resource-constrained nodes can participate in the maintenance of the blockchain and can trace the provided services, and the data stored on the cloud will not be maliciously modified.

[0030] The reliable cloud services provided by the service alliance in the present invention are mainly divided into two types: 1. Computing services. A large amount of computing resources are required for hash calculation in some blockchain maintenance to reach consensus. The service alliance can provide computing services, perform computing processing for nodes, and ensure the correctness of this calculation. 2. Storage services. Each participating node in the blockchain needs sufficient storage space to store the entire ledger. The service alliance can provide storage services, store content for nodes, and ensure that the stored content will not be tampered with by other malicious attackers. To better provide storage services, all cloud service nodes in the service alliance of this embodiment jointly construct an IPFS (InterPlanetary File System) system. IPFS is a media protocol based on blockchain technology. It adopts distributed storage and content addressing technology, changes the point-to-point single-point transmission into P2P (multi-point to multi-point) transmission, and realizes more efficient storage.

[0031] S102: Initiate a service request:

[0032] When a node in the blockchain network needs cloud services due to resource constraints, a cloud service node is selected from the service alliance according to a preset service node selection policy, and then a transfer transaction is generated, including its own account in the service alliance, the account of the selected cloud service node, and the credit value paid for this cloud service. At the same time, service content is generated according to the requested cloud service, including a service type identifier Method and data input Input. When the requested cloud service is a computing service, the service type identifier Method is the identifier of the computing service, and the data input Input is the block header data of the computing block. When the requested cloud service is a storage service, the service type identifier Method is the identifier of the storage service, and the data input Input is the hash value of the required storage block. The transfer transaction, service content, and service required data are packaged into a service request and sent to the selected cloud service node. When the requested cloud service is a computing service, the service required data is empty. When the requested cloud service is a storage service, the service required data is the required storage block.

[0033] S103: Verify the service request:

[0034] When the cloud service node receives the service request, it extracts the service transaction and service required data from the service request, verifies whether the service request node is a legitimate node, detects whether the transfer transaction in the service transaction is valid, and whether the data input Input in the service content is consistent with the service required data. If any one of the verifications fails, the service request verification fails, and the cloud service node responds to the service request node that this service fails, and this service ends. Otherwise, it enters step S104.

[0035] S104: Execute the service request:

[0036] The cloud service node first broadcasts this transfer transaction in the service alliance and freezes the amount of funds of the service request node according to the transaction fee amount in the transfer transaction. This can prevent the service request node from using one sum of funds to request services multiple times. Then the cloud service node starts to execute the service. If the service execution fails, the cloud service node responds to the service request node that this service fails, generates a service transaction and feeds it back to the service request node, and then unfreezes the funds of the service request node. If the service execution is successful, the transfer transaction is executed, and then a service transaction is generated and fed back to the service request node. Figure 3 It is the data structure diagram of the service transaction in the present invention. As Figure 3As shown, in the present invention, the service transaction includes a transfer transaction field "transaction" and a service content field "SC". The transfer transaction field "transaction" is a transfer transaction. The service content field includes a service type identifier "Method", data input "Input", execution result "Output", and signature "Signature". The execution result "Output" is the return value obtained by the cloud service node for executing this service for the service request node, and the signature "Signature" is the signature of the cloud service node for this service.

[0037] S105: Service transaction consensus:

[0038] The cloud service node forms service transaction blocks from multiple service transactions and broadcasts them in the service alliance. The service alliance conducts consensus on the service transaction blocks. After the consensus is passed, the service transaction blocks are stored in the service alliance blockchain network.

[0039] In this embodiment, in order to improve the effectiveness and reliability of service transaction block consensus, a consensus method for electing a leader based on credit value is proposed based on the hotstuff consensus algorithm. Figure 4 is the flowchart of the consensus method for electing a leader based on credit value in this embodiment. As Figure 4 shown, the specific steps of the consensus method for electing a leader based on credit value in this embodiment include:

[0040] S401: Statistic the credit values of cloud service nodes:

[0041] Traverse the most recent K blocks in the service alliance blockchain network. The value of K is set according to actual needs. Statistic the cloud service node accounts that appear in these K blocks and the total credit values of these cloud service node accounts. Denote the number of cloud service node accounts that appear as N, and the total credit value corresponding to the nth account A n as T n , where n = 1, 2,..., N.

[0042] S402: Calculate the scores of cloud service nodes:

[0043] Use the following formula to calculate the scores S of each of the N accounts n :

[0044] S n = T n ×(1 - α n × ε)

[0045] where α n represents the number of blocks produced by the cloud service node corresponding to the nth account in the most recent K blocks, and ε represents a preset decay coefficient, which is used to prevent a single node from being elected for multiple blocks within a period of time and prevent the possible Matthew effect.

[0046] S403: Select the leader node:

[0047] Select the account with the highest score from N accounts. If the number of accounts with the highest score is 1, the cloud service node corresponding to this account is used as the leader node. If the number of accounts with the highest score M is greater than or equal to 2, then sort the M accounts in ascending order according to the account ID. Denote the m-th account ID after sorting as C m , m = 0, 1, …, M - 1, calculate h = hash(C0|C1|…|C M-1 ) mod M, and select account C h as the leader node.

[0048] S404: Perform consensus using the hotstuff algorithm:

[0049] The leader node leads other cloud service nodes in the service alliance to perform consensus on the service transaction block using the hotstuff algorithm. If the consensus fails, discard the service transaction block. If the consensus is successful, save the service transaction block to the ledger of the service alliance. The specific implementation method of the hotstuff algorithm can refer to the literature "Yin M, Malkhi D, Reiter M K, et al. HotStuff: BFT Consensus in the Lens of Blockchain[J]. 2018. DOI: 10.48550 / arXiv.1803.05069."

[0050] Although the above describes the illustrative specific embodiments of the present invention for the convenience of those skilled in the art to understand the present invention, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention defined and determined by the appended claims, these changes are obvious, and all inventions created using the concept of the present invention are within the scope of protection.

Claims

1. A method for providing cloud services for resource-constrained nodes in a blockchain, characterized in that, It includes the following steps: S1: Set up a service alliance outside the blockchain network. The service alliance includes several cloud service nodes. All cloud service nodes jointly construct a P2P network and a service alliance blockchain network based on the P2P network. The service alliance is used to provide computing services and storage services to the nodes in the blockchain network. The service alliance assigns an account to each cloud service node. Nodes in the blockchain network register with the service alliance. After successful registration, the service alliance assigns an account to each node in the blockchain network. The account stores credit values for payment. The credit values of cloud service nodes are obtained through block rewards and providing services to blockchain network nodes. The credit values of blockchain network nodes are obtained through recharge; S2: When a node in the blockchain network needs cloud services due to resource constraints, select a cloud service node from the service alliance according to a preset service node selection strategy, and then generate a transfer transaction, including its own account in the service alliance, the account of the selected cloud service node, and the credit value paid for this cloud service. At the same time, generate service content according to the requested cloud service, including a service type identifier Method and data input Input. When the requested cloud service is a computing service, the service type identifier Method is the identifier of the computing service, and the data input Input is the block header data of the computing block. When the requested cloud service is a storage service, the service type identifier Method is the identifier of the storage service, and the data input Input is the hash value of the required storage block. Package the transfer transaction, service content, and service required data into a service request and send it to the selected cloud service node. When the requested cloud service is a computing service, the service required data is empty. When the requested cloud service is a storage service, the service required data is the required storage block; S3: When the cloud service node receives the service request, extract the service transaction and service required data from the service request, verify whether the service request node is a legitimate node, detect whether the transfer transaction in the service transaction is valid, and whether the data input Input in the service content is consistent with the service required data. If any one of the verifications fails, the service request verification fails, and a service failure is responded to the service request node, and this service ends. Otherwise, go to step S4; S4: The cloud service node first broadcasts this transfer transaction in the service alliance and freezes the service request node's fee amount according to the transfer transaction this time; Then the cloud service node starts to execute the service. If the service execution fails, it responds to the service request node about the service failure, generates a service transaction and feeds it back to the service request node, and then unfreezes the funds of the service request node. If the service execution is successful, it executes a transfer transaction, then generates a service transaction and feeds it back to the service request node; the service transaction includes a transfer transaction field "transaction" and a service content field "SC". The transfer transaction field "transaction" is a transfer transaction, and the service content field includes a service type identifier "Method", data input "Input", execution result "Output", and signature "Signature". The execution result "Output" is the return value obtained by the cloud service node for executing this service for the service request node, and the signature "Signature" is the signature of the cloud service node for this service. S5: The cloud service node forms service transaction blocks from multiple service transactions of this time and broadcasts them in the service alliance. The service alliance conducts consensus on the service transaction blocks. After the consensus is passed, the service transaction blocks are stored in the service alliance blockchain network.

2. The cloud service providing method according to claim 1, wherein All cloud service nodes in the service alliance together construct an IPFS system to provide storage services.

3. The cloud service providing method according to claim 1, wherein The consensus of the service transaction blocks in step S5 includes the following steps: S5.1: Traverse the most recent K blocks of the service alliance blockchain network, where the value of K is set according to actual needs, and count the cloud service node accounts that appear in these K blocks and the total credit values of these cloud service node accounts; record the number of cloud service node accounts that appear as N, and the total credit value corresponding to the nth account A n is T n , n = 1, 2,..., N; S5.2: Calculate the scores S of each of the N accounts using the following formula n : S n = T n × (1 - α n × ε) where α n represents the number of blocks produced by the cloud service node corresponding to the nth account in the most recent K blocks, and ε represents a preset attenuation coefficient; S5.3: Select the account with the highest score from N accounts. If the number of accounts with the highest score is 1, the cloud service node corresponding to this account is used as the leader node. If the number M of accounts with the highest score is greater than or equal to 2, sort the M accounts in ascending order according to the account ID. Denote the account ID of the m-th account after sorting as C m , where m = 0, 1, …, M - 1, calculate h = hash(C0|C1|…|C M-1 ) mod M, and select account C h as the leader node; S5.4: The leader node leads other cloud service nodes in the service alliance to conduct consensus on the service transaction blocks using the hotstuff algorithm. If the consensus fails, this service transaction block of this service transaction is discarded. If the consensus is successful, this service transaction block is saved to the ledger of the service alliance.

Citation Information

Patent Citations

  • Multi-cloud data center service quality determination method based on block chain

    CN110489493A

  • Wide-area resource scheduling system based on cloud platform and block chain

    CN113946879A

Cited By

  • Lightweight consensus method for large-scale distributed intelligent computing scene

    CN122119903A

  • A lightweight consensus method for large-scale distributed intelligent computing scenarios

    CN122119903B