Method for processing a container, blockchain node, and system
A blockchain-based decentralized system addresses the security and stability issues of Kubernetes by distributing container tasks across multiple nodes, enhancing reliability and reducing latency through load balancing and immutable data storage.
Patent Information
- Application Number
- CN202210037967.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-13
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-01-13
AI Technical Summary
The centralized master-worker architecture of Kubernetes (k8s) leads to single-point failures, affecting the security and stability of container handling due to reliance on a centralized etcd database, which is also prone to failures.
Implement a container handling method using a decentralized blockchain network where container tasks are distributed across multiple blockchain nodes, utilizing load balancing algorithms to manage resource allocation and task distribution, eliminating the need for a centralized master node and ensuring data consistency and security through blockchain's immutable and traceable features.
This approach enhances the security, stability, and reliability of container handling by reducing network latency and errors, ensuring data consistency, and enabling historical information retrieval for troubleshooting, while eliminating the risk of single-point failures.
Smart Images

Figure CN114385364B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and particularly to a method for processing containers, a blockchain node, and a system. Background Art
[0002] With the wide use and development of container technologies, the orchestration and scheduling of containers have also become an important research content. The most prominent existing container orchestration and scheduling engine is Kubernetes (abbreviated as k8s) developed by Google, and the framework of this engine has also become the standard for current container orchestration and scheduling frameworks.
[0003] K8s adopts a master-worker master-slave framework structure. In this framework, the master node serves as a centralized control center and is responsible for distributing container processing tasks, such as container creation, expansion, and contraction tasks, to multiple worker nodes for execution. Summary of the Invention
[0004] The inventors have found that: K8s adopts a master-worker centralized architecture. The master, as the control center, has a serious single point problem. If the master node has a problem, the use of the entire cluster will be affected. All information of the cluster (including information such as container creation information) is stored in a centrally deployed etcd database, and this database also has a single point problem. If the database has problems such as downtime, the use of the entire cluster will be affected. Therefore, using K8s to process containers has problems of poor security and poor stability.
[0005] One technical problem to be solved by the present disclosure is: how to improve the security and stability of processing application containers.
[0006] According to some embodiments of the present disclosure, a method for processing containers is provided, including: receiving a container processing request for an application; selecting one or more blockchain nodes as task nodes according to the container processing request and the resource status information of each blockchain node stored in the local blockchain ledger, and generating corresponding container processing tasks for each task node; for each task node, writing the corresponding container processing task into the task list of the task node in the blockchain ledger of each blockchain node, so that the task node completes the corresponding container processing task.
[0007] In some embodiments, the container processing request includes a container creation request, the container creation request includes the number of containers created for an application, and the container processing task includes a container creation task; according to the container processing request and the resource status information of each blockchain node stored in the local blockchain ledger, one or more blockchain nodes are selected as task nodes, and for each task node, generating a corresponding container processing task includes: according to the number of containers created for the application and the resource status information of each blockchain node stored in the local blockchain ledger, using a first load balancing algorithm, one or more blockchain nodes are selected as task nodes, and the number of containers to be created by each task node is determined, and a corresponding container creation task is generated.
[0008] In some embodiments, the container processing request includes a container scaling-up request, the container scaling-up request includes the number of newly created containers for an application, and the container processing task includes a container creation task; according to the container processing request and the resource status information of each blockchain node stored in the local blockchain ledger, one or more blockchain nodes are selected as task nodes, and for each task node, generating a corresponding container processing task includes: according to the current running status of each container corresponding to the application stored in the local blockchain ledger, determining the number of containers running normally corresponding to the application; determining the number of containers to be newly created according to the number of containers running normally corresponding to the application and the number of newly created containers for the application; according to the number of containers to be newly created and the resource status information of each blockchain node, using a second load balancing algorithm, one or more blockchain nodes are selected as task nodes, and the number of containers to be newly created by each task node is determined, and a corresponding container creation task is generated.
[0009] In some embodiments, the container processing request includes a container scaling-down request, the container scaling-down request includes the number of containers scaled down for an application, and the container processing task includes a container scaling-down task; according to the container processing request and the resource status information of each blockchain node stored in the local blockchain ledger, one or more blockchain nodes are selected as task nodes, and for each task node, generating a corresponding container processing task includes: according to the current running status of each container corresponding to the application stored in the local blockchain ledger, determining the number of containers running normally corresponding to the application; determining the number of containers to be scaled down according to the container scaling-down request and the number of containers running normally corresponding to the application; searching for the resource status information of the blockchain nodes that have created containers for the application from the resource status information of each blockchain node stored in the local blockchain ledger; according to the number of containers to be scaled down and the resource status information of the blockchain nodes that have created containers for the application, using a third load balancing algorithm, one or more blockchain nodes that have created containers for the application are selected as task nodes, and the number of containers to be scaled down by each task node is determined, and a corresponding container scaling-down task is generated.
[0010] In some embodiments, the method further includes: receiving a call request for an application; selecting, according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of the blockchain nodes that have created containers for the application, a blockchain node that has created a container for the application as the node to be called; calling the container corresponding to the application on the node to be called; and in the case of successful call, writing the call information into the blockchain ledgers of each blockchain node.
[0011] In some embodiments, selecting, according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of the blockchain nodes that have created containers for the application, a blockchain node that has created a container for the application as the node to be called includes: determining the normally running containers corresponding to the application according to the current running status of each container corresponding to the application stored in the local blockchain ledger; and selecting, according to the resource status information of the blockchain node where the normally running container is located and by using a fourth load balancing algorithm, a blockchain node where the normally running container is located as the node to be called.
[0012] In some embodiments, the method further includes: in the case of call failure, taking the node to be called as the called node, and selecting, according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of each blockchain node except the called node, a blockchain node as the replacement node; generating a corresponding container creation task for the replacement node and a corresponding container scaling-down task for the called node; writing the information indicating that the call of the called node fails into the blockchain ledgers of each blockchain node, writing the container creation task corresponding to the replacement node into the task list corresponding to the replacement node in the blockchain ledgers of each blockchain node, and writing the container scaling-down task corresponding to the called node into the task list corresponding to the called node in the blockchain ledgers of each blockchain node, so that the called node scales down the corresponding container and the replacement node creates the corresponding replacement container.
[0013] In some embodiments, the method further includes: in the case of call failure, taking the node to be called as the called node, and reselecting, according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of the blockchain nodes that have created containers for the application except the called node, a blockchain node as the node to be called; and repeatedly executing the step of calling the container corresponding to the application on the node to be called.
[0014] In some embodiments, the method further includes: scanning the task list of the local node in the local blockchain ledger; and calling the container engine to execute the corresponding container processing task according to the container processing task in the task list of the local node.
[0015] In some embodiments, the method further includes: writing the resource status information of the present node into the blockchain ledger of each blockchain node every first period.
[0016] In some embodiments, when the blockchain node is a monitoring node, the method further includes: monitoring whether each blockchain node writes the resource status information of the present node into the blockchain ledger of each blockchain node according to a preset first period; taking the blockchain nodes that do not write the resource status information of the present node into the blockchain ledger of each blockchain node according to the preset first period as inactivated nodes; marking the inactivated nodes in the blockchain ledger of each blockchain node, so that the containers on the inactivated nodes are no longer called.
[0017] In some embodiments, the method further includes: selecting one or more blockchain nodes as replacement nodes according to the information of the containers already created on the inactivated nodes and the resource status information of each blockchain node other than the inactivated nodes stored in the local blockchain ledger; generating a corresponding container creation task for each replacement node; writing the corresponding container creation task for each replacement node into the task list corresponding to the replacement node in the blockchain ledger of each blockchain node, so that the replacement node creates the corresponding replacement container.
[0018] In some embodiments, the method further includes: writing the current running status of the containers already created by the present node into the blockchain ledger of each blockchain node every second period.
[0019] In some embodiments, when the blockchain node is a monitoring node, the method further includes: scanning the container creation task of each container and the current running status of the corresponding container in the blockchain ledger every third period, wherein the container creation task further includes the configuration information of the container; for each container creation task, determining the blockchain node where the container that does not meet the container creation task is located as an abnormal node; selecting one or more blockchain nodes as replacement nodes according to the information of the containers already created on the abnormal node and the resource status information of each blockchain node other than the abnormal node stored in the local blockchain ledger; generating a corresponding container creation task for each replacement node; generating a corresponding container scaling-down task for the abnormal node; writing the container creation task corresponding to the replacement node into the task list corresponding to the replacement node in the blockchain ledger of each blockchain node, and writing the container scaling-down task corresponding to the abnormal node into the task list corresponding to the abnormal node in the blockchain ledger of each blockchain node, so that the abnormal node scales down the corresponding container and the replacement node creates the corresponding replacement container.
[0020] In some embodiments, the container processing request further includes: authentication information; the method further includes: authenticating the sender of the container creation request according to the authentication information; in the case where the authentication passes, executing selecting one or more blockchain nodes as task nodes according to the resource status information of each blockchain node stored in the local blockchain ledger.
[0021] According to some other embodiments of the present disclosure, a blockchain node is provided, including: a receiving unit, configured to receive a container processing request for an application; a selecting unit, configured to select one or more blockchain nodes as task nodes according to the container processing request and the resource status information of each blockchain node stored in the local blockchain ledger, and generate corresponding container processing tasks for each task node; a writing unit, configured to, for each task node, write the corresponding container processing task into the task list of the task node in the blockchain ledger of each blockchain node, so that the task node completes the corresponding container processing task.
[0022] According to still some other embodiments of the present disclosure, a blockchain node is provided, including: a processor; and a memory coupled to the processor for storing instructions, which when executed by the processor, cause the processor to execute the method for processing a container as described in any of the foregoing embodiments.
[0023] According to still some other embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, wherein when the program is executed by a processor, the method for processing a container as described in any of the foregoing embodiments is implemented.
[0024] According to still some other embodiments of the present disclosure, a blockchain system is provided, including: the blockchain node as described in any of the foregoing embodiments.
[0025] The method of the present disclosure is executed by a blockchain node. A user can initiate a container processing request at any blockchain node. The node that receives the container processing request can obtain the resource status information of each blockchain node based on the local blockchain ledger, thereby selecting one or more task nodes, and synchronize the container processing task to the entire blockchain network through the blockchain ledger. The task node can then learn about the container processing task to complete the corresponding task.
[0026] The method of the present disclosure is implemented based on the distributed node mechanism of the blockchain network, eliminating the need for a master control center node and achieving the goal of decentralization. It realizes the distributed storage and sharing of information data in the cluster based on the shared ledger and data synchronization mechanism of the blockchain, and no longer uses a centrally deployed etcd database, thereby ensuring the reliability of the cluster information. The blockchain nodes in the cluster only need to interact with the local blockchain ledger to obtain the information of each blockchain node in the cluster, without the need for network transmission, thus reducing latency and network transmission errors. Based on the data synchronization mechanism of the blockchain ledger, information can be synchronized and updated to the ledgers of other blockchain nodes in real time to ensure data consistency. This greatly reduces network latency and network transmission errors. Based on the characteristics of the blockchain network such as data immutability and traceability, it is convenient to query all historical information of the container, providing the possibility for troubleshooting historical problems and so on.
[0027] Other features and advantages of the present disclosure will become clear from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present disclosure, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0029] Figure 1 The flowchart showing the processing method of the container in some embodiments of the present disclosure.
[0030] Figure 2 The flowchart showing the processing method of the container in some other embodiments of the present disclosure.
[0031] Figure 3 The structural schematic diagram showing the blockchain network in some embodiments of the present disclosure.
[0032] Figure 4 The structural schematic diagram showing the blockchain node in some embodiments of the present disclosure.
[0033] Figure 5 The structural schematic diagram showing the blockchain node in some other embodiments of the present disclosure.
[0034] Figure 6 The structural schematic diagram showing the blockchain node in some other embodiments of the present disclosure.
[0035] Figure 7 The structural schematic diagram showing the blockchain system in some embodiments of the present disclosure. Detailed implementation manners
[0036] Next, the technical solutions in the embodiments of the present disclosure will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part rather than all of the embodiments of the present disclosure. The following description of at least one exemplary embodiment is actually illustrative only and in no way limits the present disclosure and its application or use. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present disclosure without creative efforts shall fall within the scope of protection of the present disclosure.
[0037] The present disclosure provides a method for processing a container. The following is described in conjunction with Figures 1 to 3 for description.
[0038] Figure 1 is a flowchart of some embodiments of the method for processing a container according to the present disclosure. As Figure 1 shown, the method of this embodiment is executed by a blockchain node and includes steps S102 to S106.
[0039] In step S102, a container processing request for an application is received.
[0040] The container processing request includes: a container creation request, a container expansion request, or a container contraction request, etc. A user can initiate a container processing request for a certain application on any blockchain node, and no longer requires a master node, realizing the decentralization of the overall network architecture.
[0041] In some embodiments, the container processing request further includes: authentication information; the sender of the container creation request is authenticated according to the authentication information; and subsequent steps are executed when the authentication passes. Authentication refers to verifying the user identity and operation permissions to ensure that the user has the permissions to perform operations such as creating, expanding, and contracting the container. Usernames, passwords, and the operation permissions they possess can be assigned to upper-layer users. When a container processing request is sent from an upper-layer application, the assigned username and password need to be carried, and the username and password are verified for correctness and the operation permissions they possess, so as to decide whether to continue the processing.
[0042] In step S104, according to the container processing request and the resource status information of each blockchain node stored in the local blockchain ledger, one or more blockchain nodes are selected as task nodes, and a corresponding container processing task is generated for each task node.
[0043] In some embodiments, the container processing request includes a container creation request, the container creation request includes the number of containers created for an application, and the container processing task includes a container creation task; according to the number of containers created for the application and the resource status information of each blockchain node stored in the local blockchain ledger, using a first load balancing algorithm, one or more blockchain nodes are selected as task nodes, and the number of containers to be created by each task node is determined, and a corresponding container creation task is generated.
[0044] In a blockchain network, the blockchain ledgers of each node are synchronized, and a blockchain node only needs to query the local blockchain ledger to obtain information in the network. In some embodiments, every first period, the blockchain node writes the resource status information of the node into the blockchain ledgers of each blockchain node. The resource status information includes, for example, at least one of the resource utilization rate of the memory and the resource utilization rate of the CPU, and is not limited to the examples given. The first load balancing algorithm includes, for example, the "round-robin algorithm": sequentially distributing and processing to multiple blockchain nodes; the "random algorithm": randomly selecting a certain blockchain node for processing each time; the "weighted algorithm": selecting the blockchain node with the highest current processing capacity according to factors such as the processing capacity and current load of each blockchain node; not limited to the examples given.
[0045] One or more containers can be created for an application, one or more blockchain nodes can be selected as task nodes, and one or more containers can be created on each task node.
[0046] In some embodiments, the container processing request includes a container expansion request, the container expansion request includes the number of new containers to be created for an application, and the container processing task includes a container creation task; according to the current running status of each container corresponding to the application stored in the local blockchain ledger, the number of containers running normally corresponding to the application is determined; according to the number of containers running normally corresponding to the application and the number of new containers to be created for the application, the number of containers to be newly created is determined; according to the number of containers to be newly created and the resource status information of each blockchain node, using a second load balancing algorithm, one or more blockchain nodes are selected as task nodes, and the number of new containers to be created by each task node is determined, and a corresponding container creation task is generated.
[0047] In some embodiments, every second period, the blockchain node writes the current running status of the containers already created by the node into the blockchain ledgers of each blockchain node. The current running status of the already created containers includes how many containers already created for the application are currently running and whether the running status is normal, etc. For example, the container expansion request includes creating 2 new containers for the application. Currently, the application has 3 containers, and only 2 are running normally, then the number of containers to be newly created is 3. The second load balancing algorithm can be the same as or different from the first load balancing algorithm.
[0048] In some embodiments, the container processing request includes a container scaling-down request, the container scaling-down request includes the number of containers scaled down for the application, and the container processing task includes a container scaling-down task; according to the container scaling-down request and the number of normally running containers corresponding to the application, determine the number of containers to be scaled down; search for the resource status information of the blockchain nodes that have created containers for the application from the resource status information of each blockchain node stored in the local blockchain ledger; according to the number of containers to be scaled down and the resource status information of the blockchain nodes that have created containers for the application, adopt the third load balancing algorithm to select one or more blockchain nodes that have created containers for the application as task nodes, and determine the number of containers to be scaled down for each task node, and generate corresponding container scaling-down tasks.
[0049] For example, the container scaling-down request includes scaling down 2 containers for the application. Currently, the application has 3 containers, and only 2 are running normally, so the number of containers to be scaled down is 1. The third load balancing algorithm may be the same as or different from the first and second load balancing algorithms.
[0050] The purpose of adopting the first, second, and third load balancing algorithms in the above embodiments is to make the workload of all current blockchain nodes relatively balanced through regulation, so that there will be no situation where some blockchain nodes have a particularly heavy workload while some blockchain nodes are very idle.
[0051] In step S106, for each task node, write the corresponding container processing task into the task list of the task node in the blockchain ledger of each blockchain node, so that the task node can complete the corresponding container processing task.
[0052] The writing process of the blockchain ledger is, for example, that after the blockchain node simulates transaction endorsement for the task information to be written into the ledger, reaches a consensus with other blockchain nodes, and commits the block, etc., it can be written into the task list of the corresponding task node in the blockchain ledger. Specifically, reference can be made to the writing process of the blockchain ledger in the prior art, and details will not be elaborated.
[0053] In some embodiments, the blockchain node scans the task list of the local node in the local blockchain ledger; according to the container processing tasks in the task list of the local node, call the container engine to execute the corresponding container processing tasks.
[0054] The blockchain node can periodically scan the task list of this node in the local blockchain ledger. If it finds a container processing task, it can call the Docker engine to execute tasks such as container creation, expansion, and contraction. For example, by calling the Docker engine to create the corresponding Pod and container (the instantiated application image file is the container), the blockchain node can create multiple pods, each pod contains multiple containers, and the user's application runs inside the containers.
[0055] The method of the above embodiment is executed by the blockchain node. The user can initiate a container processing request at any blockchain node. The node that receives the container processing request can obtain the resource status information of each blockchain node based on the local blockchain ledger, so as to select one or more task nodes, and synchronize the container processing task to the entire blockchain network through the blockchain ledger. The task node can then learn about the container processing task to complete the corresponding task.
[0056] The method of the above embodiment is implemented based on the distributed node mechanism of the blockchain network, and no longer requires a master control center node, achieving the goal of decentralization. Based on the shared ledger and data synchronization mechanism of the blockchain, it realizes the distributed storage and sharing of information data in the cluster, and no longer uses a centrally deployed etcd database, thus ensuring the reliability of the cluster information. The blockchain nodes in the cluster only need to interact with the local blockchain ledger to obtain the information of each blockchain node in the cluster, without the need for network transmission, thereby reducing network latency and network transmission errors. Based on the data synchronization mechanism of the blockchain ledger, the information can be synchronized and updated to the ledgers of other blockchain nodes in real time to ensure data consistency. This greatly reduces network latency and network transmission errors. Based on the characteristics of the blockchain network such as data immutability and traceability, it is convenient to query all historical information of the container, thus providing the possibility for troubleshooting historical problems, etc. In addition, by adopting the channel isolation mechanism of the blockchain, it is very convenient to achieve the grouped isolation of resources in the cluster, and no additional isolation measures are required.
[0057] Next, in combination with Figure 2 Describe some other embodiments of the method for processing containers of the present disclosure.
[0058] Figure 2 It is a flowchart of some other embodiments of the method for processing containers of the present disclosure. As Figure 2 shown, the method of this embodiment is executed by the blockchain node, including: steps S202 to S214.
[0059] In step S202, receive a call request for the application.
[0060] In some embodiments, the call request further includes: authentication information; authenticating the sender of the container creation request according to the authentication information; and performing subsequent steps when the authentication is passed.
[0061] In step S204, according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of the blockchain nodes that have created containers for the application, select a blockchain node that has created a container for the application as the node to be called.
[0062] In some embodiments, according to the current running status of each container corresponding to the application stored in the local blockchain ledger, determine the containers that are running normally for the application; according to the resource status information of the blockchain nodes where the containers running normally are located, use the fourth load balancing algorithm to select a blockchain node where a container running normally is located as the node to be called. The fourth load balancing algorithm may be the same as or different from the first, second, and third load balancing algorithms.
[0063] In step S206, call the container corresponding to the application on the node to be called.
[0064] In step S208, when the call is successful, write the call information into the blockchain ledgers of each blockchain node.
[0065] Writing the call information into the blockchain ledger facilitates traceability.
[0066] In step S210, when the call fails, use the node to be called as the called node, and according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of each blockchain node except the called node, select a blockchain node as the replacement node.
[0067] The load balancing algorithm described in the foregoing embodiments may be referred to for selecting the replacement node.
[0068] In step S212, trigger the replacement node to create a container to replace the container on the called node.
[0069] In some embodiments, generate a corresponding container creation task for the replacement node and a corresponding container scaling-down task for the called node; write the information that the call of the called node fails into the blockchain ledgers of each blockchain node, write the container creation task corresponding to the replacement node into the task list corresponding to the replacement node in the blockchain ledgers of each blockchain node, and write the container scaling-down task corresponding to the called node into the task list corresponding to the called node in the blockchain ledgers of each blockchain node, so that the called node can scale down the corresponding container and the replacement node can create the corresponding replacement container.
[0070] In step S214, according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of the blockchain nodes that have created containers for the application except for the already called nodes, a blockchain node is reselected as the to-be-called node, and the process returns to step S206 to be executed again.
[0071] Steps S214 and S210 can be executed in any order.
[0072] The method of the above embodiments realizes the calling of the containers of the application based on the blockchain network, improving the security, stability and reliability of the calling.
[0073] In some embodiments, the blockchain node can be used as a monitoring node to monitor whether each blockchain node writes its own node resource status information into the blockchain ledger of each blockchain node according to a preset first period; the blockchain nodes that do not write their own node resource status information into the blockchain ledger of each blockchain node according to the preset first period are regarded as inactivated nodes; the inactivated nodes are marked in the blockchain ledger of each blockchain node so that the containers on the inactivated nodes are no longer called.
[0074] Furthermore, in some embodiments, according to the information of the containers already created on the inactivated nodes and the resource status information of each blockchain node stored in the local blockchain ledger except for the inactivated nodes, one or more blockchain nodes are selected as replacement nodes; for each replacement node, a corresponding container creation task is generated; for each replacement node, the corresponding container creation task is written into the task list corresponding to the replacement node in the blockchain ledger of each blockchain node, so that the replacement node creates the corresponding replacement container.
[0075] A container scaling-down task can also be generated for the inactivated nodes and written into the task list of the inactivated nodes in the blockchain ledger of each blockchain node, and the already created containers can be removed after the inactivated nodes are troubleshot.
[0076] In some embodiments, a blockchain node can act as a monitoring node. Every third cycle, it scans each container creation task in the blockchain ledger and the current running status of the corresponding container. The container creation task also includes the configuration information of the container. For each container creation task, it determines the blockchain node where the container that does not meet the container creation task is located as an abnormal node. Based on the information of the containers already created on the abnormal node and the resource status information of each blockchain node other than the abnormal node stored in the local blockchain ledger, it selects one or more blockchain nodes as replacement nodes. For each replacement node, it generates a corresponding container creation task. For the abnormal node, it generates a corresponding container scaling-down task. It writes the container creation tasks corresponding to the replacement nodes into the task list corresponding to the replacement nodes in the blockchain ledgers of each blockchain node, and writes the container scaling-down tasks corresponding to the abnormal nodes into the task list corresponding to the abnormal nodes in the blockchain ledgers of each blockchain node, so that the abnormal node can scale down the corresponding container and the replacement node can create the corresponding replacement container.
[0077] The monitoring node can regularly scan the container creation requests of all applications in the ledger (i.e., the expected values of the application, for example, how many containers are expected to be created and what ports each container needs to develop), and check the current running status of all containers created for the application in the current cluster. If the initial expected values are not met, adjustments are made.
[0078] To prevent concurrency issues, a blockchain node can be used as a monitoring node.
[0079] The method of the above embodiments utilizes the characteristics of the blockchain ledger for storing information, which is immutable and traceable, to regularly monitor the situation of the application's containers, ensuring the safe, stable, and reliable operation of the application.
[0080] Next, in combination with Figure 3 Describe some application examples of the blockchain network of the present disclosure.
[0081] As Figure 3 shown, the blockchain network of the present disclosure includes n blockchain nodes, namely Node-1 to Node-n. The structure of each blockchain node is as follows.
[0082] (1) "API layer": Receives requests such as creating containers, scaling up, and scaling down sent by users, as well as requests for invoking a certain application deployed in the cluster, and forwards the requests to the "middle layer". In particular, authentication, verification, and other processes are also carried out at this layer.
[0083] (2) "Middle layer": mainly includes a scheduling module, a timing module, an Operator module, a monitoring module (optional), a blockchain SDK module, and a Docker engine workspace:
[0084] ● "Scheduling Module": Receives requests sent by the "API Layer", creates tasks for the requests, and writes them into the task list of the corresponding node in the blockchain ledger.
[0085] ● "Timing Module": On the one hand, it regularly updates all status information of the local node to the local blockchain ledger (for example, resource status information includes: resource utilization rates such as memory / CPU, the running status of the currently running Pods and containers on this machine, etc. In particular, based on the synchronization mechanism of the blockchain ledger, changes to the local ledger will be synchronously updated to the ledgers of all other Node nodes, so the ledger data of all Node nodes will be consistent. If a certain Node node does not update its status information to the ledger within the set time, it is considered that the Node node is inactive). On the other hand, it regularly scans the task list of the local node in the blockchain ledger and calls the "Operator Module" for processing.
[0086] ● "Operator Module": Receives task commands such as creating containers, scaling up, and scaling down sent by the "Timing Module", and performs corresponding operations such as container creation, scaling up, and scaling down based on the Docker engine.
[0087] ● "Monitoring Module": This module is an optional module. It regularly scans the commands for creating the initial containers of all applications in the ledger (i.e., the expected values of the applications, such as how many containers are expected to be created and what ports each container needs to develop, etc.), and checks the current running status of all containers created for the application in the current cluster. If it does not meet the initial expected values, it creates tasks through the "Scheduling Module" for adjustment. In particular, to prevent concurrency issues, it is recommended to install this module on only one Node node in the cluster.
[0088] ● "Blockchain SDK Module": Responsible for interacting with the underlying blockchain.
[0089] ● "Docker Engine Workspace": It is the actual workspace of the Node node, referring to multiple created pods, each pod contains multiple containers, and the user's application runs inside the containers.
[0090] (3) "Distributed Blockchain Network": Each Node node accesses the blockchain network by installing peer nodes, order nodes, and the blockchain ledger. In particular, the blockchain ledger contains all information of the entire cluster, and the ledgers of all Node nodes are consistent.
[0091] The framework adopts a decentralized distributed mode, and users can access the cluster through any Node node in the cluster. Each Node node realizes its functions through the three-layer service mode shown in the above figure. A new node can be connected to the blockchain network by simply installing a blockchain peer node (based on the ledger mechanism of the blockchain, the newly added node will automatically pull the entire blockchain ledger to the local).
[0092] When a container creation request is sent from the upper layer:
[0093] ① The "API layer" receives the request. After authentication, it sends the request to the "scheduling module".
[0094] ② After receiving the request, the "scheduling module" first looks up the resource status information of all Node nodes in the blockchain ledger at this time. Through the first load balancing algorithm, it selects one or more Node nodes to create the container of this application and writes it into the task list of the corresponding node in the blockchain ledger in the form of a container creation task.
[0095] ③ The "timing module" scans the task list of this node in the blockchain ledger. After finding the task, it calls the "Operator module" to process it.
[0096] ④ The "Operator module" calls the Docker engine to create the corresponding Pod and container.
[0097] When a container expansion or container contraction request is sent from the upper layer:
[0098] ① The "API layer" receives the request. After authentication, it sends the request to the "scheduling module".
[0099] ② After receiving the request, the "scheduling module" first looks up the current running status of the containers that have been created for this application in the current cluster in the blockchain ledger:
[0100] ▲ If it is an "expansion" request, it looks up the resource status information of all Node nodes in the blockchain ledger at this time. Through the second load balancing algorithm, it selects one or more Node nodes to create the expansion containers of this application.
[0101] ▲ If it is a "contraction" request, it looks up the resource status information of the Node nodes where the containers for this application have been created in the blockchain ledger. Through the third load balancing algorithm, it decides to contract the containers of this application on one or more Node nodes.
[0102] Write the container creation task or container contraction task into the task list of the corresponding Node node in the blockchain ledger.
[0103] ③ The "Timing Module" scans the task list of this node in the blockchain ledger. After finding a task, it calls the "Operator Module" for processing;
[0104] ④ The "Operator Module" calls the Docker engine to perform corresponding scale-out and scale-in tasks.
[0105] When a call request for an application is sent from the upper layer:
[0106] ① The "API Layer" receives the request. After authentication, it sends the request to the "Scheduling Module";
[0107] ② After receiving the request, the "Scheduling Module" first checks the current running status of the containers that have been created for this application in the current cluster in the blockchain ledger, and then selects a container of this application on a certain Node node for call through the fourth load balancing algorithm:
[0108] ▲ If the call to this Node node is successful, the result is returned, and the call situation is updated to the blockchain ledger for traceability;
[0109] ▲ If the call to this Node node fails, another Node node is selected for call. And trigger the processing process for the failed container: Mark the container on the Node where the call fails as inactivated in the blockchain ledger. On the one hand, trigger the scale-in of this container on this Node node, and on the other hand, trigger the selection of a new Node node in the cluster to create a replacement container.
[0110] The present disclosure also provides a blockchain node, which will be described below in conjunction with Figure 4 for description.
[0111] Figure 4 is a structural diagram of some embodiments of the blockchain node of the present disclosure. As Figure 4 shown, the blockchain node 40 of this embodiment includes: a receiving unit 410, a selecting unit 420, and a writing unit 430.
[0112] The receiving unit 410 is used to receive a container processing request for an application. The receiving unit 410 is located in the API layer in the foregoing embodiment.
[0113] In some embodiments, the container processing request further includes: authentication information; the receiving unit 410 is used to authenticate the sender of the container creation request according to the authentication information; in the case of successful authentication, select one or more blockchain nodes as task nodes according to the resource status information of each blockchain node stored in the local blockchain ledger.
[0114] The selection unit 420 is configured to select one or more blockchain nodes as task nodes according to the container processing request and the resource status information of each blockchain node stored in the local blockchain ledger, and generate corresponding container processing tasks for each task node.
[0115] In some embodiments, the container processing request includes a container creation request, the container creation request includes the number of containers created for an application, and the container processing task includes a container creation task; the selection unit 420 is configured to select one or more blockchain nodes as task nodes according to the number of containers created for the application and the resource status information of each blockchain node stored in the local blockchain ledger, and determine the number of containers to be created by each task node, and generate corresponding container creation tasks.
[0116] In some embodiments, the container processing request includes a container expansion request, the container expansion request includes the number of newly created containers for an application, and the container processing task includes a container creation task; determine the number of normally running containers corresponding to the application according to the current running status of each container corresponding to the application stored in the local blockchain ledger; the selection unit 420 is configured to determine the number of containers to be newly created according to the number of normally running containers corresponding to the application and the number of newly created containers for the application; select one or more blockchain nodes as task nodes according to the number of containers to be newly created and the resource status information of each blockchain node, and determine the number of containers to be newly created by each task node, and generate corresponding container creation tasks.
[0117] In some embodiments, the container processing request includes a container scaling-down request, the container scaling-down request includes the number of containers scaled down for an application, and the container processing task includes a container scaling-down task; determine the number of normally running containers corresponding to the application according to the current running status of each container corresponding to the application stored in the local blockchain ledger; determine the number of containers to be scaled down according to the container scaling-down request and the number of normally running containers corresponding to the application; find the resource status information of the blockchain nodes that have created containers for the application from the resource status information of each blockchain node stored in the local blockchain ledger; select one or more blockchain nodes that have created containers for the application as task nodes according to the number of containers to be scaled down and the resource status information of the blockchain nodes that have created containers for the application, and determine the number of containers to be scaled down by each task node, and generate corresponding container scaling-down tasks.
[0118] The writing unit 430 is configured to write the corresponding container processing task into the task list of the task node in the blockchain ledger of each blockchain node for each task node, so that the task node can complete the corresponding container processing task.
[0119] In some embodiments, the receiving unit 410 is further configured to receive a call request for an application; the selecting unit 420 is further configured to select, according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of the blockchain nodes that have created containers for the application, a blockchain node that has created a container for the application as the node to be called; the blockchain node 40 further includes: a calling unit 440, configured to call the container corresponding to the application on the node to be called; the writing unit 430 is further configured to, in the case of successful call, write the call information into the blockchain ledgers of each blockchain node.
[0120] In some embodiments, the selecting unit 420 is configured to determine the containers running normally corresponding to the application according to the current running status of each container corresponding to the application stored in the local blockchain ledger; and select, according to the resource status information of the blockchain node where the normally running container is located and by using a fourth load balancing algorithm, a blockchain node where the normally running container is located as the node to be called.
[0121] In some embodiments, the selecting unit 420 is further configured to, in the case of call failure, take the node to be called as the called node, and select, according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of each blockchain node except the called node, a blockchain node as the replacement node; generate a corresponding container creation task for the replacement node and a corresponding container scaling-down task for the called node; the writing unit 430 is further configured to write the information indicating that the call of the called node fails into the blockchain ledgers of each blockchain node, write the container creation task corresponding to the replacement node into the task list corresponding to the replacement node in the blockchain ledgers of each blockchain node, and write the container scaling-down task corresponding to the called node into the task list corresponding to the called node in the blockchain ledgers of each blockchain node, so that the called node scales down the corresponding container and the replacement node creates a corresponding replacement container.
[0122] In some embodiments, the selecting unit 420 is further configured to, in the case of call failure, take the node to be called as the called node, and reselect, according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of the blockchain nodes that have created containers for the application except the called node, a blockchain node as the node to be called, and trigger the calling unit 440 to call the container corresponding to the application on the node to be called.
[0123] In some embodiments, the blockchain node 40 further includes: a scanning unit 450, configured to scan the task list of the local node in the blockchain ledger; and an execution unit 460, configured to call the container engine to execute the corresponding container processing task according to the container processing tasks in the task list of the local node.
[0124] In some embodiments, the blockchain node 40 further includes an update unit 470, configured to write the resource status information of the node into the blockchain ledger of each blockchain node every first period.
[0125] In some embodiments, the blockchain node 40 further includes a monitoring unit 480, configured to monitor whether each blockchain node writes the resource status information of the node into the blockchain ledger of each blockchain node according to a preset first period; determine the blockchain nodes that do not write the resource status information of the node into the blockchain ledger of each blockchain node according to the preset first period as deactivated nodes; the writing unit 430 is further configured to mark the deactivated nodes in the blockchain ledger of each blockchain node, so that the containers on the deactivated nodes are no longer called.
[0126] In some embodiments, the selection unit 420 is further configured to select one or more blockchain nodes as replacement nodes according to the information of the containers created on the deactivated nodes and the resource status information of each blockchain node stored in the local blockchain ledger except the deactivated nodes; generate a corresponding container creation task for each replacement node; the writing unit 430 is further configured to write the corresponding container creation task for each replacement node into the task list corresponding to the replacement node in the blockchain ledger of each blockchain node, so that the replacement node creates the corresponding replacement container.
[0127] In some embodiments, the update unit 470 is further configured to write the current running status of the containers created by the node into the blockchain ledger of each blockchain node every second period.
[0128] In some embodiments, the monitoring unit 480 is further configured to scan each container creation task and the current running status of the corresponding container in the blockchain ledger every third period, where the container creation task further includes the configuration information of the container; for each container creation task, determine the blockchain node where the container that does not meet the container creation task is located as an abnormal node; the selection unit 420 is further configured to select one or more blockchain nodes as replacement nodes according to the information of the containers created on the abnormal node and the resource status information of each blockchain node stored in the local blockchain ledger except the abnormal node; generate a corresponding container creation task for each replacement node; generate a corresponding container scaling-down task for the abnormal node; the writing unit 430 is further configured to write the container creation task corresponding to the replacement node into the task list corresponding to the replacement node in the blockchain ledger of each blockchain node, and write the container scaling-down task corresponding to the abnormal node into the task list corresponding to the abnormal node in the blockchain ledger of each blockchain node, so that the abnormal node scales down the corresponding container and the replacement node creates the corresponding replacement container.
[0129] The selection unit 420, the writing unit 430, and the calling unit 440 can be arranged in Figure 3 the scheduling module in the corresponding embodiment. The execution unit 460 can be arranged in the Operator module. The scanning unit 450 and the updating unit 470 can be arranged in the timing module. The monitoring unit 480 can be arranged in the monitoring module.
[0130] The blockchain nodes in the embodiments of the present disclosure can each be implemented by various computing devices or computer systems. Below, in conjunction with Figure 5 and Figure 6 description will be given.
[0131] Figure 5 is a structural diagram of some embodiments of the blockchain node of the present disclosure. As Figure 5 shown, the blockchain node 50 of this embodiment includes: a memory 510 and a processor 520 coupled to the memory 510. The processor 520 is configured to execute the processing method of the container in any of the embodiments of the present disclosure based on the instructions stored in the memory 510.
[0132] Among them, the memory 510 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory stores, for example, an operating system, application programs, a boot loader, a database, and other programs.
[0133] Figure 6 is a structural diagram of other embodiments of the blockchain node of the present disclosure. As Figure 6 shown, the blockchain node 60 of this embodiment includes: a memory 610 and a processor 620, which are respectively similar to the memory 510 and the processor 520. It may further include an input / output interface 630, a network interface 640, a storage interface 650, etc. These interfaces 630, 640, 650 and the memory 610 and the processor 620 can be connected through a bus 660, for example. Among them, the input / output interface 630 provides a connection interface for input / output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 640 provides a connection interface for various networking devices, and can be connected to, for example, a database server or a cloud storage server. The storage interface 650 provides a connection interface for external storage devices such as an SD card and a USB flash drive.
[0134] The present disclosure also provides a blockchain system. Below, in conjunction with Figure 7 description will be given.
[0135] Figure 7 is a structural diagram of some embodiments of the blockchain system of the present disclosure. As Figure 7 shown, the blockchain system 7 of this embodiment includes: a plurality of blockchain nodes 40 / 50 / 60 in any of the foregoing embodiments.
[0136] Those skilled in the art should understand that the embodiments of the present disclosure may be provided as a method, a system, or a computer program product. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable non-transitory storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
[0137] The present disclosure is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the specified functions in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0138] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implements the specified functions in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0139] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the specified functions in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0140] The above are only the preferred embodiments of the present disclosure and are not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for processing a container, wherein, The described processing method is executed by a blockchain node and includes: Receiving a container processing request for an application; Selecting one or more blockchain nodes as task nodes according to the container processing request and the resource status information of each blockchain node stored in the local blockchain ledger, and generating corresponding container processing tasks for each task node, where the resource status information includes at least one of the resource utilization rate of memory and the resource utilization rate of CPU; For each task node, writing the corresponding container processing task into the task list of the task node in the blockchain ledger of each blockchain node, so that the task node can complete the corresponding container processing task; Among them, the container processing request includes at least one of a container creation request, a container expansion request, and a container contraction request. When the container processing request includes at least one of the container creation request and the container expansion request, the container processing task includes a container creation task, and one or more containers are created on each task node. When the container processing request includes the container contraction request, the container processing task includes a container contraction task.
2. The processing method according to claim 1, wherein, The container creation request includes the number of containers created for the application; The selecting one or more blockchain nodes as task nodes according to the container processing request and the resource status information of each blockchain node stored in the local blockchain ledger, and generating corresponding container processing tasks for each task node includes: According to the number of containers created for the application and the resource status information of each blockchain node stored in the local blockchain ledger, using a first load balancing algorithm, selecting one or more blockchain nodes as the task nodes, and determining the number of containers created by each task node, and generating corresponding container creation tasks.
3. The processing method according to claim 1, wherein The container expansion request includes the number of newly created containers for the application; The selecting one or more blockchain nodes as task nodes according to the container processing request and the resource status information of each blockchain node stored in the local blockchain ledger, and generating corresponding container processing tasks for each task node includes: Determining the number of containers running normally corresponding to the application according to the current running status of each container corresponding to the application stored in the local blockchain ledger; Determining the number of containers to be newly created according to the number of containers running normally corresponding to the application and the number of newly created containers for the application; According to the number of containers to be newly created and the resource status information of each blockchain node, using a second load balancing algorithm, selecting one or more blockchain nodes as the task nodes, and determining the number of newly created containers by each task node, and generating corresponding container creation tasks.
4. The processing method according to claim 1, wherein, The container contraction request includes the number of containers to be reduced for the application; The selecting one or more blockchain nodes as task nodes according to the container processing request and the resource status information of each blockchain node stored in the local blockchain ledger, and generating corresponding container processing tasks for each task node includes: Determine the number of containers running normally for the application according to the current running status of each container corresponding to the application stored in the local blockchain ledger; Determine the number of containers to be reduced according to the container scaling-down request and the number of containers running normally for the application; Search for the resource status information of the blockchain nodes that have created containers for the application from the resource status information of each blockchain node stored in the local blockchain ledger; According to the number of containers to be reduced and the resource status information of the blockchain nodes that have created containers for the application, adopt the third load balancing algorithm to select one or more blockchain nodes that have created containers for the application as the task nodes, and determine the number of containers to be reduced for each task node, and generate corresponding container reduction tasks.
5. The processing method according to claim 1, further comprising: Receive a call request for the application; Select a blockchain node that has created a container for the application as the node to be called according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of the blockchain nodes that have created containers for the application; Call the container corresponding to the application on the node to be called; In the case of successful call, write the call information into the blockchain ledgers of each blockchain node.
6. The processing method according to claim 5, wherein, The step of selecting a blockchain node that has created a container for the application as the node to be called according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of the blockchain nodes that have created containers for the application includes: Determine the containers running normally for the application according to the current running status of each container corresponding to the application stored in the local blockchain ledger; Adopt the fourth load balancing algorithm to select one blockchain node where the normally running container is located as the node to be called according to the resource status information of the blockchain node where the normally running container is located.
7. The processing method according to claim 5, further comprising: In the case of call failure, use the node to be called as the called node, and select a blockchain node as the replacement node according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of each blockchain node except the called node; Generate a corresponding container creation task for the replacement node and a corresponding container scaling-down task for the called node; Write the information that the called node call fails into the blockchain ledgers of each blockchain node, write the container creation task corresponding to the replacement node into the task list corresponding to the replacement node in the blockchain ledgers of each blockchain node, and write the container scaling-down task corresponding to the called node into the task list corresponding to the called node in the blockchain ledgers of each blockchain node, so that the called node reduces the corresponding container and the replacement node creates the corresponding replacement container.
8. The processing method according to claim 7, further comprising: In the case of a call failure, take the node to be called as the called node, and reselect a blockchain node as the node to be called according to the current running status of each container corresponding to the application stored in the local blockchain ledger and the resource status information of the blockchain nodes that have created containers for the application except the called node; Repeat the execution of calling the container corresponding to the application on the node to be called.
9. The processing method according to any one of claims 1-8 further includes: Scan the task list of the local node in the local blockchain ledger; Call the container engine to execute the corresponding container processing task according to the container processing task in the task list of the local node.
10. The processing method according to any one of claims 1-8 further includes: Write the local node resource status information into the blockchain ledgers of each blockchain node every first period.
11. The processing method according to claim 10, wherein, In the case where the blockchain node is a monitoring node, the method further includes: Monitor whether each blockchain node writes the local node resource status information into the blockchain ledgers of each blockchain node according to a preset first period; Take the blockchain node that fails to write the local node resource status information into the blockchain ledgers of each blockchain node according to the preset first period as an inactivated node; Mark the inactivated node in the blockchain ledgers of each blockchain node so that the containers on the inactivated node are no longer called.
12. The processing method according to claim 11 further includes: Select one or more blockchain nodes as replacement nodes according to the information of the containers already created on the inactivated node and the resource status information of each blockchain node stored in the local blockchain ledger except the inactivated node; Generate a corresponding container creation task for each replacement node; For each replacement node, write the corresponding container creation task into the task list corresponding to the replacement node in the blockchain ledgers of each blockchain node so that the replacement node creates the corresponding replacement container.
13. The processing method according to any one of claims 1-8 further includes: Write the current running status of the containers already created by the local node into the blockchain ledgers of each blockchain node every second period.
14. The processing method according to claim 13, wherein, In the case where the blockchain node is a monitoring node, the method further includes: Scan each container creation task and the current running status of the corresponding container in the blockchain ledger every third period, where the container creation task further includes the configuration information of the container; For each container creation task, determine the blockchain node where the container that does not meet the container creation task is located as an abnormal node; Select one or more blockchain nodes as replacement nodes according to the information of the containers already created on the abnormal node and the resource status information of each blockchain node stored in the local blockchain ledger except the abnormal node; Generate a corresponding container creation task for each replacement node; generate a corresponding container scaling-down task for the abnormal node; Write the container creation task corresponding to the replacement node into the task list corresponding to the replacement node in the blockchain ledger of each blockchain node, and write the container scaling-down task corresponding to the abnormal node into the task list corresponding to the abnormal node in the blockchain ledger of each blockchain node, so that the abnormal node scales down the corresponding container, and the replacement node creates the corresponding replacement container.
15. The processing method according to any one of claims 1-8, wherein, The container processing request further includes: authentication information; The method further includes: Authenticate the sender of the container creation request according to the authentication information; In the case where the authentication is passed, execute the selection of one or more blockchain nodes as the task nodes according to the resource status information of each blockchain node stored in the local blockchain ledger.
16. A blockchain node, comprising: A receiving unit, configured to receive a container processing request for an application; A selection unit, configured to select one or more blockchain nodes as task nodes according to the container processing request and the resource status information of each blockchain node stored in the local blockchain ledger, and generate corresponding container processing tasks for each task node, where the resource status information includes at least one of the resource utilization rate of the memory and the resource utilization rate of the CPU; A writing unit, configured to write the corresponding container processing task into the task list of the task node in the blockchain ledger of each blockchain node for the task node to complete the corresponding container processing task, where the container processing request includes at least one of a container creation request, a container scaling-up request, and a container scaling-down request. In the case where the container processing request includes at least one of the container creation request and the container scaling-up request, the container processing task includes a container creation task, and one or more containers are created on each task node. In the case where the container processing request includes the container scaling-down request, the container processing task includes a container scaling-down task.
17. A blockchain node, comprising: A processor; And A memory coupled to the processor for storing instructions, which when executed by the processor, cause the processor to execute the method for processing a container according to any one of claims 1-15.
18. A non-transitory computer-readable storage medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the steps of the method according to any one of claims 1-15.
19. A blockchain system, comprising: Multiple blockchain nodes as claimed in claim 16 or 17.
Citation Information
Patent Citations
System, method and apparatus for providing container services
CN109582441A
Cloud computing task scheduling system and method based on block chain
CN111190714A