Containerized deployment-based block chain system adaptive scaling method

Through the resource allocation method based on cybernetics and step-by-step and the hot and cold data separation storage strategy, the resource management problem of blockchain system under high dynamic load is solved, flexible scheduling and efficient utilization of resources are achieved, and the performance and service quality of the system are improved.

CN120343044AActive Publication Date: 2025-07-18NORTHEASTERN UNIV CHINA
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510697111.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-28
Publication Date
2025-07-18
Estimated Expiration
2045-05-28

AI Technical Summary

Technical Problem

The existing blockchain system resource scheduling methods cannot respond to load changes in time, resulting in uneven or insufficient resource allocation, and cannot meet the real-time and flexibility requirements of high dynamic loads, especially in high concurrency scenarios.

Method used

Using the consensus node scaling method based on cybernetics, the step-by-step communication node scaling method and the scaling method based on hot and cold data separation storage, the system status is monitored in real time and the CPU, network and storage resource allocation is dynamically adjusted, and the elastic allocation of resources is achieved through the controller and the supervisor respectively.

Benefits of technology

It improves the dynamic adaptability of blockchain systems in high concurrency scenarios, avoids over-supply or insufficient resources, reduces storage costs, and improves system performance and service quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120343044A_ABST
    Figure CN120343044A_ABST
Patent Text Reader

Abstract

The invention discloses a blockchain system adaptive scaling method based on containerized deployment, and relates to the technical field of blockchains. A consensus node scaling method based on a control theory, a communication node scaling method based on a stepping mode and a scaling method based on cold and hot data separation storage are provided, the consensus node scaling method based on the control theory ensures that the response time of the block chain system does not exceed a set threshold value, and meanwhile resources are effectively allocated; server resources are effectively allocated based on a stepping communication node scaling method, a single service is prevented from occupying excessive network bandwidth, and the problem of demand fluctuation is flexibly solved; the scaling method based on cold and hot data separation storage realizes storage capacity expansion, reduces the storage cost, and can improve the service quality of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of blockchain, and in particular to an adaptive scaling method for a blockchain system based on containerized deployment. Background Art

[0002] In order to meet the performance requirements of blockchain systems in high-concurrency and complex transaction scenarios, blockchain platforms mostly adopt containerized deployment methods to improve the flexibility and scalability of the systems. However, in the actual operation of blockchain systems, their resource requests and loads are highly dynamic, and resource requirements will continuously change with factors such as transaction volume, node participation, and network status. This highly dynamic load change poses higher requirements for the scheduling of container resources. How to intelligently and dynamically allocate container resources according to the changes in system load has become a key issue in improving the performance of blockchain systems.

[0003] Existing research on container resource management mainly includes the default scheduling strategy of Kubernetes, the threshold-based scheduling strategy, and the multi-objective optimization scheduling strategy based on meta-heuristic algorithms. The default scheduling strategy of Kubernetes is one of the most commonly used container orchestration and scheduling methods. The Kubernetes scheduler listens for Pods in the cluster that are newly created but not yet assigned nodes, and schedules them to the most suitable nodes based on a preset filtering and scoring mechanism. This strategy gives priority to factors such as node resource utilization rate, affinity, and taint tolerance to achieve basic resource balance and high availability. However, in scenarios where multiple services coexist and business loads fluctuate frequently, this strategy fails to effectively perceive the sensitivity and real-time requirements of blockchain systems for resources, and it is difficult to make dynamic adaptations according to the current business status, resulting in a disconnection between scheduling decisions and the actual load of the system.

[0004] The threshold-based scheduling strategy mainly triggers resource scaling operations by manually setting upper and lower threshold values for resources such as CPU and memory. This strategy is simple to implement and convenient to deploy, and has a certain practicality in an environment where resource utilization changes relatively stably. However, this method relies too much on static parameter settings and lacks the ability to adapt to load fluctuations. Especially when dealing with sudden loads such as a surge in blockchain transactions, it cannot respond in a timely manner, easily leading to an increase in system latency or uneven resource allocation. In addition, as the cluster scale expands and the number of service types increases, the complexity and maintenance cost of threshold setting also increase accordingly.

[0005] The multi-objective optimization scheduling strategy based on meta-heuristic algorithms introduces intelligent optimization algorithms (such as genetic algorithms, particle swarm optimization, ant colony algorithms, etc.) and simultaneously considers multiple optimization objectives during the scheduling process, including resource utilization rate, task response time, and system energy consumption, etc. This type of strategy can more comprehensively balance resource allocation and performance requirements and is applicable to environments with heterogeneous node resources and high task complexity. However, since meta-heuristic algorithms mostly use iterative methods to find the optimal solution, they have large computational overhead, slow convergence speed, and are prone to falling into local optimal solutions, resulting in unstable scheduling and severe load fluctuations in high-dynamic trading scenarios, affecting the overall performance of the system and user experience.

[0006] In summary, the existing technical solutions mainly have the following defects:

[0007] (1) The load of the blockchain system fluctuates frequently and unpredictably, while the existing resource scheduling methods often rely on static rules or preset thresholds and cannot respond to sudden load changes in a timely manner. This leads to the problem that when the system faces rapid fluctuations or extreme loads, resource allocation cannot match the actual demand, resulting in resource contention or resource shortage.

[0008] (2) Many existing scheduling methods, especially the scheduling strategies based on optimization algorithms, usually require a large amount of computing time for iterative solution. Although these methods have certain advantages in long-term optimization, in the scenario of dealing with high-dynamic loads, the computing time is too long or the convergence speed is slow, which cannot meet the requirements of the blockchain system for real-time and low latency, affecting the overall performance of the system.

[0009] (3) When the blockchain system schedules resources, it not only involves the allocation of computing resources but also needs to consider multiple dimensions such as network bandwidth, storage resources, and service quality. Although the existing methods can optimize a single objective to a certain extent, they lack sufficient flexibility and real-time performance in the trade-off between multiple objectives and resource scheduling decisions, resulting in difficulty in adapting to high-concurrency and high-fluctuation actual workloads and prone to uneven resource allocation or performance degradation. Summary of the Invention

[0010] Aiming at the deficiencies of the existing technology, the present invention provides an adaptive scaling method for a blockchain system based on containerized deployment to schedule resources, and proposes a consensus node scaling method based on cybernetics, a communication node scaling method based on step-by-step, and a scaling method based on separation storage of hot and cold data. The consensus node scaling method based on cybernetics ensures that the response time of the blockchain system does not exceed the set threshold and effectively allocates resources at the same time; the communication node scaling method based on step-by-step effectively allocates server resources, prevents a single service from occupying too much network bandwidth, and elastically solves the problem of demand fluctuations; the scaling method based on separation storage of hot and cold data realizes storage expansion, reduces storage costs, and can improve the service quality of the system.

[0011] The technical solution of the present invention is as follows:

[0012] In the first aspect of the present invention, an adaptive scaling method for a blockchain system based on containerized deployment is provided, including the following steps:

[0013] Componentize the blockchain system, and divide the blockchain system into a communication component, a consensus component, and a storage component; the storage component includes an on-chain storage component and an off-chain Ceph storage component;

[0014] Use containerization technology to achieve distributed deployment of the componentized blockchain system. Use nodes as running instances of the blockchain system, where different types of nodes run different corresponding components in the blockchain system. Nodes include consensus nodes, communication nodes, and storage nodes, corresponding to the consensus component, communication component, and storage component in the blockchain system respectively, and each node corresponds to a container;

[0015] Real-time monitor the running state of the blockchain system. The running state of the blockchain system is represented by three monitoring metrics, including CPU usage, storage capacity, and network traffic;

[0016] According to the monitoring metrics of the blockchain system, use an auto-scaling method to achieve elastic allocation of resources of the blockchain system; the auto-scaling method includes a consensus node scaling method based on cybernetics, a communication node scaling method based on step-by-step, and a scaling method for separating hot and cold data storage.

[0017] Further, for consensus nodes, adopt a consensus node scaling method based on cybernetics to allocate CPU resources; for communication nodes, use a communication node scaling method based on step-by-step to allocate network resources; and for storage nodes, adopt a scaling method for separating hot and cold data storage to allocate storage resources.

[0018] Further, the consensus node scaling method based on cybernetics is specifically as follows: The container corresponding to each consensus node is managed by an independent controller. Each controller monitors the response time of the corresponding container in real time, and calculates the difference ε between the current response time and the target response time of the current container in each control step, and calculates the CPU resource allocation μ of the current container according to the difference ε c , and then use a supervisor to aggregate the CPU resource allocations μ obtained by all controllers c into a vector μ M , if the total sum of the CPU resources to be allocated is higher than the capacity of the machine M used to run the blockchain system, then scale the CPU resource allocation of each container according to the set policy to obtain the adjusted CPU resource allocation u ' c; If the total CPU resources to be allocated are lower than the capacity of machine M used to run the blockchain system, then expand the CPU resource allocation μ c , to obtain the adjusted CPU resource allocation u ' c ; Finally, execute the adjusted CPU resource allocation u ' c , or directly execute the CPU resource allocation μ c .

[0019] Further, the step - based communication node scaling method is specifically as follows: The container corresponding to each communication node is managed by an independent controller. The controller obtains the usage rate UC of the network resources of the container. Each controller obtains the network bandwidth allocation A according to the preset policy table based on the usage rate UC of the network resources of the current container c , and each controller submits the calculated network bandwidth allocation A c to the supervisor. The supervisor aggregates all the network bandwidth allocations A c . If the total network bandwidth to be allocated is higher than the network bandwidth capacity of machine M running the blockchain system, then scale the network bandwidth allocation of each container according to the set policy to obtain the adjusted network bandwidth allocation A' c . If the total network bandwidth to be allocated is not higher than the network bandwidth capacity of machine M used to run the blockchain system, then no scaling is performed; The supervisor transmits the adjusted network bandwidth allocation A' c or the network bandwidth allocation A calculated by the controller c to the container network management tool. The container network management tool adjusts the network bandwidth limit of each container according to the adjusted network bandwidth allocation A' c or the network bandwidth allocation A calculated by the controller c .

[0020] Further, in the policy table, different usage rate thresholds of network resources are used to divide the usage rate of network resources into different intervals, and different network bandwidth adjustment values are set for each interval. According to the usage rate of the network resources of the current container, the corresponding interval and the network bandwidth adjustment value are determined, and then the network bandwidth allocation A is obtained c .

[0021] Further, the scaling method for cold - hot data separation storage is specifically as follows: Store the hot data in a high - performance cluster with performance higher than the set threshold, and copy the cold data to another low - cost cluster with performance lower than the set threshold through multi - source configuration, and then clear the data in the original cluster

[0022] In a second aspect of the present invention, an electronic device is provided, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, the steps of the method for adaptive scaling of a blockchain system based on containerized deployment are performed.

[0023] In a third aspect of the present invention, a computer-readable storage medium is provided. A computer program is stored in the computer-readable storage medium. When the computer program is run by a processor, the steps of the method for adaptive scaling of a blockchain system based on containerized deployment as described above are performed.

[0024] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0025] (1) The method for scaling consensus nodes based on cybernetics and the method for scaling communication nodes step by step in the present invention can respond to changes in resource requirements in a timely manner, avoiding problems of over-supply or resource shortage. The real-time feedback of cybernetics and the step-by-step hierarchical adjustment together improve the dynamic adaptability of the system.

[0026] (2) By scaling the separation storage of hot and cold data in the present invention, the cost of storage expansion is reduced, and at the same time, the service quality of the system under large-scale deployment is improved. The hierarchical storage strategy achieves a balance between performance and cost, enhancing the long-term operation ability of the system.

[0027] In summary, the method for adaptive scaling of a blockchain system based on containerized deployment proposed by the present invention can improve the overall performance of the blockchain system, effectively cope with performance challenges in high-concurrency scenarios, solve the resource management problem of the blockchain system under high dynamic loads, and provide a methodology and practical tool for performance breakthroughs of decentralized applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is the overall architecture diagram of the method for adaptive scaling of a blockchain system based on containerized deployment in an embodiment of the present invention;

[0029] Figure 2 It is an example diagram of the method for scaling consensus nodes based on cybernetics in an embodiment of the present invention;

[0030] Figure 3 It is an example diagram of the method for scaling communication nodes step by step in an embodiment of the present invention;

[0031] Figure 4 It is an example diagram of the method for scaling based on the separation storage of hot and cold data in an embodiment of the present invention;

[0032] Figure 5CPU usage graph of consensus nodes at different times in the embodiments of the present invention;

[0033] Figure 6 Response time graph of consensus nodes at different times in the embodiments of the present invention;

[0034] Figure 7 Network usage graph of communication nodes under the fixed resource allocation strategy in the embodiments of the present invention;

[0035] Figure 8 Network usage graph of communication nodes under the step - based strategy in the embodiments of the present invention;

[0036] Figure 9 Throughput performance test result graph under different concurrent thread request volumes in the embodiments of the present invention;

[0037] Figure 10 Response time performance test result graph under different concurrent thread request volumes in the embodiments of the present invention. Detailed implementation manners

[0038] The present invention will be described in detail below with reference to the accompanying drawings and embodiments.

[0039] An adaptive scaling method for a blockchain system based on containerized deployment, as Figure 1 shown, includes the following steps:

[0040] Step 1: First, componentize the blockchain system, divide the blockchain system into a communication component, a consensus component, and a storage component, so as to improve the modular management and scalability of the blockchain system; the storage component includes an on - chain storage component and an off - chain Ceph storage component;

[0041] The storage component mainly realizes the storage service of multi - modal data, the consensus component mainly realizes the query and transaction processing service, and the communication component is responsible for the information exchange and coordination work between components to ensure the coordinated operation of each component;

[0042] Step 2: In order to make full use of the flexibility and elasticity of the cloud environment, use containerization technology to implement the distributed deployment of the componentized blockchain system, so as to achieve efficient deployment and dynamic scheduling, and use nodes as running instances of the blockchain system, where different types of nodes run different corresponding components in the blockchain system;

[0043] Specifically: the nodes include consensus nodes, communication nodes, and storage nodes, which respectively correspond to the consensus component, communication component, and storage component in the blockchain system, and each node corresponds to a container;

[0044] Step 3: To ensure the stable operation of the containerized deployment system, a resource monitoring mechanism is further implemented. A resource monitoring tool is used to monitor the running state of the blockchain system in real time. The running state of the blockchain system is represented by three monitoring metrics, including CPU usage, storage capacity, and network traffic;

[0045] In this embodiment, these monitoring metrics are provided by the Prometheus Client Component and collected and aggregated through the scraping operations regularly initiated by the Prometheus Server, providing data support for the subsequent optimization of the blockchain system. Container resource monitoring mainly relies on the native API interfaces provided by the container engine (such as Docker) to collect the resource usage at the container level in real time. Through the Docker Engine API, the detailed resource usage data of each container can be obtained, including CPU usage time, storage capacity, and network traffic. This method has the advantages of strong real-time performance and low system overhead and is suitable for the dynamically changing blockchain running environment. To improve the modularity and maintainability of the blockchain system, resource monitoring is designed as an independent component and deployed and run separately. Various monitoring metrics are exposed through the interfaces of the Prometheus Client Component, and the Prometheus Server regularly initiates scraping (pull) operations for collection and aggregation. This method supports the unified collection of multiple targets, facilitating subsequent expansion and centralized management.

[0046] Step 4: According to the monitoring metrics of the blockchain system, an automatic scaling method is used to achieve elastic allocation of the resources of the blockchain system; the automatic scaling method includes a consensus node scaling method based on cybernetics, a communication node scaling method based on step-by-step, and a scaling method for separating hot and cold data storage;

[0047] To achieve elastic allocation of resources, the present invention adopts an automatic scaling method and schedules these resources through containerized deployment. Specifically, for the consensus nodes, a consensus node scaling method based on cybernetics is adopted for CPU resource allocation; for the communication nodes, a communication node scaling method based on step-by-step is used for network resource allocation; and for the storage nodes, a scaling method for separating hot and cold data storage is adopted for storage resource allocation;

[0048] The consensus node scaling method based on cybernetics, as Figure 2 shown, is specifically as follows: The container corresponding to each consensus node is managed by an independent controller. The goal of the controller is to ensure that the response time of the consensus node does not exceed the set threshold. Each controller monitors the response time of the corresponding container in real time and calculates the difference ε between the current response time and the target response time of the current container at each control step (1 second), and calculates the CPU resource allocation μ of the current container according to the difference εc , and then a supervisor is used to allocate the CPU resources obtained by all controllers to μ c aggregate into a vector μ M , if the total sum of the CPU resources to be allocated is higher than the capacity of the machine M used to run the blockchain system, then the CPU resource allocation for each container is scaled according to the set policy to obtain the adjusted CPU resource allocation u ' c ; optionally, if the total sum of the CPU resources to be allocated is lower than the capacity of the machine M used to run the blockchain system, then the CPU resource allocation μ is increased c to accelerate the performance of the application at the cost of sub-optimal allocation (oversupply), and the adjusted CPU resource allocation u is obtained ' c ; finally, the adjusted CPU resource allocation u is executed ' c ;

[0049] The difference ε between the response time of the current container and the target response time is:

[0050]

[0051] where T c is the response time of the container, is the set target response time, and ε is the difference between the response time of the container and the target response time;

[0052] The step-based communication node scaling method elastically solves the problem of demand fluctuations. The step-based vertical scaling method is an evolution of the rule-based method, as Figure 3 shown. Specifically: The container corresponding to each communication node is managed by an independent controller. The controller obtains the usage rate UC of the network resources of the container. Each controller obtains the network bandwidth allocation A according to the usage rate UC of the network resources of the current container according to the preset policy table c , and each controller submits the calculated network bandwidth allocation A c to the supervisor. The supervisor aggregates all the network bandwidth allocations A c , if the total sum of the network bandwidth to be allocated is higher than the network bandwidth capacity of the machine M running the blockchain system, then the network bandwidth allocation for each container is scaled according to the set policy to obtain the adjusted network bandwidth allocation A' c , if the total sum of the network bandwidth to be allocated is not higher than the network bandwidth capacity of the machine M used to run the blockchain system, then no scaling is performed; the supervisor adjusts the network bandwidth allocation A' c or the network bandwidth allocation A calculated by the controller cTransmitted to the container network management tool in the form of HTTP or API, and the container network management tool allocates A' according to the adjusted network bandwidth c Or the network bandwidth allocation A calculated by the controller c Adjust the network bandwidth limit of each container;

[0053] In the policy table, the utilization rate of different network resources is divided into different intervals by using the utilization rate thresholds of different network resources, and different network bandwidth adjustment values are set for each interval. According to the utilization rate of the network resources of the current container, the corresponding interval and the corresponding network bandwidth adjustment value are determined, and then the network bandwidth allocation A is obtained c ;

[0054] In this embodiment, a policy table is provided based on the step-by-step communication node scaling method to define the scaling operations to be performed when certain conditions are met. By restricting the bandwidth of the container, server resources can be allocated more effectively, preventing a single service from occupying too much network bandwidth;

[0055] In this embodiment, when the formula (2) is satisfied, the bandwidth is increased by 20%; when the formula (3) is satisfied, the bandwidth is increased by 15%; when the formula (4) is satisfied, the bandwidth is increased by 10%; when the formula (5) is satisfied, the bandwidth is reduced by 10%; when the formula (6) is satisfied, the bandwidth is reduced by 15%; when the formula (7) is satisfied, the bandwidth is reduced by 20%;

[0056] if(U c > 90%) (2)

[0057] if(80% < U c ≤ 90%) (3)

[0058] if(70% < U c ≤ 80%) (4)

[0059] if(30% < U c ≤ 70%) (5)

[0060] if(20% < U c ≤ 30%) (6)

[0061] if(U c ≤ 20%) (7)

[0062] Among them, U c Is the utilization rate of real-time network resources;

[0063] In this embodiment, the container network management tool Docker Traffic Control automatically detects and processes containers with specific tags by listening to events of the Docker engine. When a container starts, if com.docker-tc.enabled = 1 is set, this tool will set network rules according to other tags with the com.docker-tc prefix, such as bandwidth limit (limit), delay, packet loss rate (loss), etc. It uses the Linux tc command to control network interfaces to implement these functions without complex configuration or additional dependencies;

[0064] The scaling method for separating hot and cold data storage uses Ceph multi-source configuration technology to keep frequently accessed data (hot data) in a high-performance cluster and migrate less frequently accessed data (cold data) to a low-performance cluster, achieving seamless horizontal scaling, thereby optimizing the utilization efficiency of storage resources. The storage cluster is a unified storage resource pool composed of multiple storage nodes (servers, hard disks, etc.) through distributed software collaboration, with characteristics such as high availability, elastic expansion, and data redundancy; as Figure 4 shown, specifically: store hot data (within 30 days) in a high-performance cluster, copy cold data (more than 30 days ago) to another low-cost cluster through multi-source configuration, and then clear the data in the original cluster to achieve the storage and query of hot and cold data. Through the data replication and automatic cleaning mechanism, seamless expansion of the storage cluster is achieved, avoiding service interruption problems in traditional scaling solutions;

[0065] The relationship among these three methods in resource scheduling is coordinated with each other through their respective characteristics and load requirements. In specific applications, the blockchain system will automatically select the most suitable scheduling scheme according to different node load types. When the blockchain system faces compute-intensive tasks (such as transaction verification and consensus processes), the blockchain system will preferentially use the consensus node scaling method based on cybernetics to adjust CPU resources in real time through an independent controller to ensure that the response time of the consensus node does not exceed the set threshold and avoid response delays caused by insufficient computing resources. If it is a network-intensive task (such as data transmission and inter-node communication), the bandwidth resources will be optimized through the communication node scaling method based on stepping, and dynamic adjustment will be made according to the usage rate threshold table of network resources to prevent a single service from occupying too much bandwidth and ensure the balanced distribution of network resources among multiple services. When the blockchain system faces high demand for storage resources, especially when the access requirements for hot and cold data change, the blockchain system will automatically enable the scaling method for separating hot and cold data storage, adjust storage resources according to the access frequency of data, store hot data in a high-performance cluster, and migrate cold data to a low-cost cluster to ensure that storage expansion is both efficient and cost-effective.

[0066] In this embodiment, the prescription transfer business in the medical field is taken as an example. In the traditional mode, there are problems such as poor data sharing, information silos, difficulty in ensuring data security and privacy, and easy data tampering. After using the blockchain system, for example, in the prescription review link, data such as prescription information and review records are written into the blockchain to achieve data immutability. Patients can query their prescription history at any time, and doctors can quickly obtain accurate prescription information of patients. Medical insurance institutions can also accurately monitor the prescription transfer situation to prevent fraud. At the same time, as the business volume fluctuates, an adaptive scaling method is adopted, which can dynamically adjust the resource allocation of the blockchain system according to the data volume and access volume. During the peak business period, computing and storage resources are automatically increased to ensure the smooth operation of the blockchain system, and idle resources are released during the low period to reduce costs.

[0067] In this embodiment, three scaling methods are verified, and the verification results are as follows:

[0068] (1) Consensus node scaling method based on cybernetics

[0069] The performance testing tool locust is used for testing. The transaction sending volume increases linearly from the initial 0 to 2000, then from 2000 to 4000, and finally the transaction sending rate stabilizes at 4000.

[0070] The experimental results are as Figure 5 and Figure 6 shown. Figure 5 The dotted line in Figure 6 represents the transaction sending volume, and the solid line represents the CPU allocated at different times. The dotted line in

[0071] (2) Communication node scaling method based on step-by-step

[0072] The load testing tool tm-load-test is used to send the load for 20s continuously. The sending rate is 10,000 transactions per second, and the size of each transaction is 250 bytes. The transaction sending volume increases linearly from the initial 0 to 2000, then from 2000 to 6000, from 6000 to 10000, and finally the transaction sending rate stabilizes at 10000.

[0073] The experimental results are as Figure 7 and Figure 8As shown, the network usage of the fixed resource allocation method has always been lower than 1 Mbps. Based on the step-by-step strategy, the bandwidth allocation will be continuously adjusted according to the changes in demand, and the bandwidth usage will be higher or lower than 1 Mbps. The throughput has increased from the original 4.326 kTPS to 5.937 kTPS, with a throughput increase of 23.94%. The experimental results show that the communication node scheduling optimization scheme based on the step-by-step method can effectively allocate network resources and improve the service quality of the system.

[0074] (3) Scaling method based on cold and hot data separation storage

[0075] Use the performance testing tool cosbench to test the performance of the ceph cluster. Each thread sends 30 read requests per second, and test the query throughput and response time performance of single-cluster and multi-cluster scenarios when the number of threads is 1, 2, 4, 8, and 12 respectively. Single-cluster means that the query is only performed in the storage cluster with poor disk performance, and multi-cluster means that the query is performed in the storage cluster with good disk performance and in the storage cluster with poor disk performance.

[0076] The experimental results are as Figure 9 and Figure 10 shown. The query throughput in the multi-cluster scenario is higher than that in the single-cluster query, and the response time is lower than that in the single-cluster. The experimental results show that the storage scheduling optimization scheme based on cold and hot data separation can not only achieve storage expansion, reduce storage costs, but also improve the average query throughput and reduce the average query response time, and can improve the service quality of the system.

[0077] This embodiment also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, the steps of the blockchain system adaptive scaling method based on containerized deployment are executed.

[0078] This embodiment also provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is run by a processor, the steps of the blockchain system adaptive scaling method based on containerized deployment are executed.

Claims

1. An adaptive scaling method for a blockchain system based on containerized deployment, characterized in that, Including the following steps: Componentize the blockchain system, dividing the blockchain system into a communication component, a consensus component, and a storage component; the storage component includes an on-chain storage component and an off-chain Ceph storage component; Use containerization technology to achieve distributed deployment of the componentized blockchain system. Utilize nodes as running instances of the blockchain system, where different types of nodes run different corresponding components in the blockchain system. Nodes include consensus nodes, communication nodes, and storage nodes, corresponding to the consensus component, communication component, and storage component in the blockchain system respectively, and each node corresponds to a container; Monitor the running state of the blockchain system in real time. The running state of the blockchain system is represented by three monitoring metrics, including CPU usage rate, storage capacity, and network traffic; According to the monitoring metrics of the blockchain system, use an auto-scaling method to achieve elastic allocation of resources of the blockchain system; the auto-scaling method includes a consensus node scaling method based on cybernetics, a communication node scaling method based on a step-by-step approach, and a scaling method for separating hot and cold data storage.

2. The adaptive scaling method of the blockchain system based on containerized deployment according to claim 1, wherein For consensus nodes, adopt a consensus node scaling method based on cybernetics to allocate CPU resources; for communication nodes, use a communication node scaling method based on a step-by-step approach to allocate network resources; and for storage nodes, adopt a scaling method for separating hot and cold data storage to allocate storage resources.

3. The adaptive scaling method for a blockchain system based on containerized deployment according to claim 1, wherein, The consensus node scaling method based on cybernetics is specifically as follows: The container corresponding to each consensus node is managed by an independent controller. Each controller monitors the response time of the corresponding container in real time, and calculates the difference ε between the current response time and the target response time of the current container in each control step. Based on the difference ε, the CPU resource allocation μ of the current container is calculated. c , and then a supervisor aggregates the CPU resource allocations μ c obtained by all the controllers into a vector μ M . If the total sum of the CPU resources to be allocated is higher than the capacity of the machine M used to run the blockchain system, the CPU resource allocation of each container is scaled according to the set policy to obtain the adjusted CPU resource allocation u'. c ; if the total sum of the CPU resources to be allocated is lower than the capacity of the machine M used to run the blockchain system, the CPU resource allocation μ is increased c to obtain the adjusted CPU resource allocation u'. c ; finally, the adjusted CPU resource allocation u' is executed c , or the CPU resource allocation μ is directly executed c .

4. The method for adaptive scaling of a blockchain system based on containerized deployment according to claim 1, wherein The step-based communication node scaling method is specifically as follows: The container corresponding to each communication node is managed by an independent controller. The controller obtains the utilization rate UC of the network resources of the container. Each controller obtains the network bandwidth allocation A according to the utilization rate UC of the network resources of the current container and a preset policy table. c Each controller submits the calculated network bandwidth allocation A c to the supervisor. The supervisor aggregates all the network bandwidth allocations A c . If the total network bandwidth to be allocated is higher than the network bandwidth capacity of the machine M running the blockchain system, the network bandwidth allocation of each container is scaled according to the set policy to obtain the adjusted network bandwidth allocation A'. c . If the total network bandwidth to be allocated is not higher than the network bandwidth capacity of the machine M used to run the blockchain system, no scaling is performed. The supervisor transmits the adjusted network bandwidth allocation A' c or the network bandwidth allocation A calculated by the controller c to the container network management tool. The container network management tool adjusts the network bandwidth limit of each container according to the adjusted network bandwidth allocation A' c or the network bandwidth allocation A calculated by the controller. c ​ 5. The adaptive scaling method of the blockchain system based on containerized deployment according to claim 4, wherein In the policy table, the usage rate of network resources is divided into different intervals by using the usage rate thresholds of different network resources, and different network bandwidth adjustment values are set for each interval. According to the usage rate of the network resources of the current container, the corresponding interval and the network bandwidth adjustment value are determined, and then the network bandwidth allocation A is obtained. c 。 6. The adaptive scaling method of the blockchain system based on containerized deployment according to claim 1, wherein The scaling method for separating hot and cold data storage is specifically: store hot data in a high-performance cluster with performance higher than a set threshold, replicate cold data to another low-cost cluster with performance lower than the set threshold through multi-source configuration, and then clear the data in the original cluster.

7. An electronic device, characterized in that, Including: A processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, the steps of the method for adaptively scaling a blockchain system based on containerized deployment according to any one of claims 1-6 are executed.

8. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium. When the computer program is run by the processor, the steps of the method for adaptively scaling a blockchain system based on containerized deployment according to any one of claims 1-6 are executed.

Citation Information

Patent Citations

  • Computing resource method, device and system for managing block chain nodes

    CN107832139A

  • Block-chain architecture

    CN109426952A

  • Block chain node data separate storage method and device

    CN111858520A

  • Rapid deployment type cloud computing architecture based on container arrangement

    CN115499442A

  • Data calculation containerization trusted execution method based on block chain

    CN116248279A