An information processing method, a control node and a computer readable storage medium
Patent Information
- Application Number
- CN202210570378.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-24
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2042-05-24
AI Technical Summary
[0003]为解决上述技术问题,本申请实施例期望提供一种信息处理方法、控制节点及计算机可读存储介质,解决了确定目标Node节点的准确率低的问题,提高了确定目标Node节点的准确率
[0035]本申请实施例所提供的信息处理方法、控制节点及计算机可读存储介质,接收用于创建中间件的创建请求,并基于创建请求确定待创建的中间件的类型;在类型为第一类型且创建请求中未携带业务节点的标识的情况下,基于待创建的中间件对应的需求信息和容器编排系统的状态信息,从多个业务节点中确定用于创建待创建的中间件的目标业务节点;其中,业务节点为容器编排系统中除控制节点之外的节点;在类型为第二类型的情况下,基于需求信息和每个业务节点的状态信息,从多个业务节点中确定目标业务节点;控制在目标业务节点上创建待创建的中间件;如此,可以基于待创建的中间件的不同类型,采用不同的信息来确定目标业务节点,不再如相关技术中针对每一待创建的中间件都是基于需求信息和每一业务节点的状态信息来确定目标业务节点,提高了确定的目标业务节点的准确率。
Smart Images

Figure CN117149343B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing, and more particularly to an information processing method, a control node, and a computer-readable storage medium. Background Technology
[0002] Kubernetes (Container Orchestration System) provides large-scale container deployment, orchestration, and management capabilities, and can be used to create hybrid clouds, containerized middleware, etc. When creating middleware, the container orchestration system typically determines the target node from multiple nodes based on the requirements of the middleware and the status information of each node, and then creates the middleware on the target node. However, using this method to determine the target node for every middleware to be created results in low accuracy in determining the target node. Summary of the Invention
[0003] To address the aforementioned technical problems, embodiments of this application aim to provide an information processing method, a control node, and a computer-readable storage medium, thereby solving the problem of low accuracy in determining target nodes and improving the accuracy of target node determination.
[0004] The technical solution of this application is implemented as follows:
[0005] An information processing method applied to a control node in a container orchestration system, the method comprising:
[0006] Receive a creation request for creating middleware, and determine the type of middleware to be created based on the creation request;
[0007] When the type is the first type and the creation request does not carry the identifier of the business node, based on the requirement information corresponding to the middleware to be created and the status information of the container orchestration system, a target business node for creating the middleware to be created is determined from multiple business nodes; wherein, the business node is a node in the container orchestration system other than the control node;
[0008] In the case where the type is the second type, the target business node is determined from the plurality of business nodes based on the demand information and the status information of each business node;
[0009] Control the creation of the middleware to be created on the target business node.
[0010] In the above scheme, determining the target business node for creating the middleware from multiple business nodes based on the requirement information corresponding to the middleware to be created and the status information of the container orchestration system includes:
[0011] Obtain the status information of the container orchestration system;
[0012] Based on the requirement information and the status information of the container orchestration system, a status value corresponding to the container orchestration system after the middleware to be created is determined on each business node; wherein, the status value represents the performance of the container orchestration system;
[0013] The target service node is determined from the plurality of service nodes based on the status value.
[0014] In the above scheme, obtaining the status information of the container orchestration system includes:
[0015] If the creation request is the first creation request received within the target period, determine the current state information of the container orchestration system;
[0016] If the creation request is not an initial creation request received within the target period, the predicted state information of the container orchestration system is obtained; wherein, the predicted state information is the predicted state information of the container orchestration system after the middleware is created on the previously selected business node.
[0017] In the above scheme, determining the state value of the container orchestration system, which represents the state of the middleware to be created on each business node, based on the requirement information and the state information of the container orchestration system, includes:
[0018] The multiple creation requests are grouped based on the target time window to obtain multiple groups of creation requests;
[0019] For each creation request, based on the requirement information in each creation request and the status information of the container orchestration system, multiple status values are determined for each creation request.
[0020] In the above scheme, determining multiple status values corresponding to each creation request based on the requirement information in each creation request and the status information of the container orchestration system includes:
[0021] Based on each requirement information and the status information of the container orchestration system, predict the predicted status of the container orchestration system after creating the middleware to be created on each business node.
[0022] Based on the predicted state corresponding to each business node, the state value corresponding to the predicted state is determined.
[0023] In the above scheme, determining the target service node from the plurality of service nodes based on the status value includes:
[0024] For each of the required information, a target state value that satisfies the state value condition is determined from the plurality of state values;
[0025] The business node corresponding to the target state value is determined as the target business node.
[0026] The method in the above scheme further includes:
[0027] If the type is the first type and the creation request carries the identifier, the business node corresponding to the identifier is determined to be the target business node.
[0028] In the above scheme, determining the target business node from the plurality of business nodes based on the demand information and the status information of each business node includes:
[0029] Based on the aforementioned requirement information, target state information that satisfies the state conditions is determined from multiple state information;
[0030] The business node corresponding to the target status information is determined to be the target business node.
[0031] A control node, the control node comprising: a processor, a memory, and a communication bus;
[0032] The communication bus is used to realize the communication connection between the processor and the memory;
[0033] The processor is used to execute the information processing program in the memory to implement the steps of the above-described information processing method.
[0034] A computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps of the above-described information processing method.
[0035] The information processing method, control node, and computer-readable storage medium provided in this application embodiment receive a creation request for creating middleware and determine the type of middleware to be created based on the creation request. If the type is a first type and the creation request does not carry the identifier of a business node, a target business node for creating the middleware is determined from multiple business nodes based on the requirement information corresponding to the middleware to be created and the status information of the container orchestration system. The business node is a node in the container orchestration system other than the control node. If the type is a second type, a target business node is determined from multiple business nodes based on the requirement information and the status information of each business node. The middleware to be created is then created on the target business node. Thus, different information can be used to determine the target business node based on different types of middleware to be created, instead of determining the target business node based solely on requirement information and the status information of each business node for each middleware to be created, as in related technologies, thereby improving the accuracy of the determined target business node. Attached Figure Description
[0036] Figure 1 A flowchart illustrating an information processing method provided in an embodiment of this application;
[0037] Figure 2 A flowchart illustrating another information processing method provided in an embodiment of this application;
[0038] Figure 3 This is a schematic diagram of the structure of a Q-learning scheduling module provided in an embodiment of this application;
[0039] Figure 4 A flowchart illustrating another information processing method provided in an embodiment of this application;
[0040] Figure 5 This is a schematic diagram of the structure of a control node provided in an embodiment of this application. Detailed Implementation
[0041] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0042] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0043] This application provides an information processing method, which can be applied to control nodes in a container orchestration system, as described below. Figure 1 As shown, the method includes the following steps:
[0044] Step 101: Receive a creation request for creating middleware, and determine the type of middleware to be created based on the creation request.
[0045] In this embodiment, the container orchestration system can be abbreviated as Kubernetes (k8s). The control node receives a creation request from the client for creating middleware, parses the creation request, and obtains the type of middleware to be created from the creation request. The types of middleware to be created include a first type and a second type; the first type can be a single pod; the second type can be multiple pods. A pod is the smallest deployable computing unit that can be created and managed in the container orchestration system, and a pod consists of at least one container. The middleware to be created can also be understood as containerized middleware to be created.
[0046] It should be noted that the type of middleware to be created can be carried in the creation request, and the control node can directly obtain it from the creation request after parsing it; the type of middleware to be created can also be obtained by the control node after analyzing the requirement information in the creation request; the requirement information is the requirement information corresponding to the middleware to be created.
[0047] In one feasible implementation, the middleware to be created can be a containerized middleware such as Redis, MongoDB, ElasticSearch, or Kafka.
[0048] Step 102: If the type is Type 1 and the creation request does not carry the identifier of the business node, determine the target business node for creating the middleware from multiple business nodes based on the requirement information corresponding to the middleware to be created and the status information of the container orchestration system.
[0049] The state information can be the current state information of the container orchestration system or the predicted state information of the container orchestration system.
[0050] In this embodiment, the business node is a Node node in Kubernetes other than the control node (Master node). If the type is Type 1 and the creation request does not include a business node identifier, it indicates that the user has not specified a business node to create middleware of type single pod. In this case, the control node can independently determine the target business node to create the middleware. Specifically, when determining the target business node, the control node can predict the predicted state of the container orchestration system after creating the middleware on each business node based on requirement information and the container orchestration system's state information. Based on the predicted state corresponding to each business node, the target business node is determined from multiple business nodes.
[0051] In one feasible implementation, the requirements information could be the number of Central Processing Units (CPUs), the size of memory, and the size of storage needed when creating the middleware to be created.
[0052] It should be noted that step 104 can be executed after step 102.
[0053] Step 103: In the case of type 2, determine the target business node from multiple business nodes based on the demand information and the status information of each business node.
[0054] Among them, the business node is the node in the container orchestration system other than the control node.
[0055] In this application embodiment, when the type is the second type, each business node can be detected to obtain the status information of each business node, and multiple business nodes can be filtered to obtain the target business node based on the demand information and the status information of each business node.
[0056] It should be noted that the status information of a business node includes information such as the remaining CPU, memory, and storage, as well as the type and volume of business being processed.
[0057] In one feasible implementation, when the type is the second type, the control node can filter multiple business nodes to obtain the target business node based on the demand information and the status information of the business nodes.
[0058] It should be noted that step 104 can be executed after step 103.
[0059] Step 104: Control the creation of the middleware to be created on the target business node.
[0060] In this embodiment of the application, after determining the target business node, the control node can actively modify the configuration file used for scheduling nodes in the container orchestration system, so as to control the creation of the middleware to be created on the target business node through the modified configuration file; wherein, the configuration file can specifically be the values.yaml configuration file.
[0061] In one feasible implementation, the control node can dynamically modify the Node Selector option in the values.yaml configuration file to configure the creation of the middleware to be created on the target business node, and control the creation of the middleware to be created on the target business node based on the modified values.yaml configuration file.
[0062] The information processing method provided in this application embodiment receives a creation request for creating middleware and determines the type of middleware to be created based on the creation request. If the type is a first type and the creation request does not carry the identifier of a business node, a target business node for creating the middleware is determined from multiple business nodes based on the requirement information corresponding to the middleware to be created and the status information of the container orchestration system. The business node is a node in the container orchestration system other than the control node. If the type is a second type, a target business node is determined from multiple business nodes based on the requirement information and the status information of each business node. The middleware to be created is then created on the target business node. Thus, different information can be used to determine the target business node based on different types of middleware to be created, instead of determining the target business node for each middleware to be created based solely on the requirement information and the status information of each business node, as is done in related technologies, thereby improving the accuracy of the determined target business node.
[0063] Based on the foregoing embodiments, this application provides an information processing method, referring to... Figure 2 As shown, the method includes the following steps:
[0064] Step 201: The control node receives a creation request for creating middleware and determines the type of middleware to be created based on the creation request.
[0065] It should be noted that any of steps 202, 205, and 206 can be performed after step 201.
[0066] Step 202: If the type is Type 1 and the creation request does not carry the identifier of the business node, the control node obtains the status information of the container orchestration system.
[0067] In this embodiment of the application, the time when the creation request is received can be determined, and based on the time, it can be determined whether the creation request is the first creation request received within the target period. Based on the determination result, different methods are used to obtain the status information of the container orchestration system. The status information of the container orchestration system can be the current status information of the container orchestration system or the predicted status information of the container orchestration system.
[0068] It should be noted that step 202 can be achieved through steps A1-A2:
[0069] Step A1: If the creation request is the first creation request received within the target cycle, the control node determines the current state information of the container orchestration system.
[0070] In this embodiment of the application, if it is determined that the creation request is the first creation request received within the target period, the current status information of each business node in the container orchestration system can be obtained, and the current status information of the container orchestration system can be determined based on the current status information of multiple business nodes.
[0071] In one feasible implementation, the current state information of the container orchestration system can include information such as the number of CPUs remaining, the amount of memory remaining, the amount of storage remaining, the usage and load of input / output (IO).
[0072] Step A2: When the creation request is not the initial creation request received within the target period, the control node obtains the predicted state information of the container orchestration system.
[0073] Among them, the predicted state information is the predicted state information of the container orchestration system after the middleware is created on the previously selected business node.
[0074] In this embodiment of the application, if it is determined that the creation request is not the first creation request received within the target period, the state information of the container orchestration system after the middleware was created on the previously selected business node is determined and the predicted state information is obtained.
[0075] In one feasible implementation, the creation request is the third request to be created received within the target period. It is possible to obtain the state information of the container orchestration system after the middleware to be created corresponding to the second request is created on the target business node selected by the second request, and thus obtain the predicted state information.
[0076] Step 203: Based on the demand information and the status information of the container orchestration system, the control node determines the status value of the container orchestration system corresponding to the middleware to be created on each business node.
[0077] Among them, the state value characterizes the performance of the container orchestration system.
[0078] In the embodiments of this application, it is possible to predict the state value of the container orchestration system after creating the middleware to be created on each business node when the container orchestration system is in the state corresponding to the state information.
[0079] It should be noted that step 203 can be achieved through steps B1-B2:
[0080] Step B1: The control node groups multiple creation requests based on the target time window to obtain multiple groups of creation requests.
[0081] In this context, the middleware to be created in each of the multiple creation requests is of type 1, and each creation request does not carry the identifier of the business node.
[0082] In this embodiment of the application, the size of the target time window is determined by the number of service nodes in Kubernetes; the size of the time window is equal to the number of service nodes; multiple creation requests can be sorted according to the receiving time to obtain multiple sorted creation requests, and the sorted multiple creation requests can be segmented according to the target time window to obtain multiple sets of creation requests.
[0083] In one feasible implementation, if the number of business nodes in Kubernetes is 6, then the target time window size is 6. When the number of creation requests is 18, the 18 creation requests are divided into 3 groups, with each group containing 6 creation requests.
[0084] Step B2: For each group of creation requests, the control node determines multiple status values corresponding to each creation request based on the requirement information in each creation request and the status information of the container orchestration system.
[0085] It should be noted that there can be multiple creation requests or only one creation request within the target period.
[0086] In this embodiment of the application, for each creation request in each group of creation requests, if the state of the container orchestration system is predicted to be in the state corresponding to the state information, the state value of the container orchestration system is created on each business node after the middleware to be created corresponding to the creation request is created, and multiple state values corresponding to each creation request are obtained.
[0087] In one feasible implementation, for each creation request in each group of creation requests, the number of business nodes in the container orchestration system is 5, namely Node1, Node2, Node3, Node4, and Node5. The control node can predict the state value of the container orchestration system after creating the middleware to be created on Node1 when the state of the container orchestration system is in the state corresponding to the state information, and obtain the state value corresponding to Node1. Then, the state values corresponding to Node2, Node3, Node4, and Node5 are determined in the same way.
[0088] It should be noted that B2 can be achieved through steps b1-b2:
[0089] Step b1: Based on each requirement information and the status information of the container orchestration system, the control node predicts the predicted state of the container orchestration system after the middleware to be created is created on each business node.
[0090] In this embodiment of the application, the predicted state of the container orchestration system is determined by creating the middleware to be created on each business node based on the requirement information, when the state of the container orchestration system is in the state corresponding to the state information.
[0091] In one feasible implementation, there is only one set of creation requests within the target period, and the number of creation requests in this set is 5. For the first creation request in this set, based on the requirement information in the first creation request and the current state information of the container orchestration system, the predicted state of the container orchestration system after creating the middleware to be created on each business node can be predicted, thus obtaining the predicted state corresponding to each business node. For the second creation request in this set, the predicted state information of the container orchestration system after creating the middleware to be created corresponding to the first creation request on the target business node corresponding to the first creation request can be determined first. This predicted state information is then used as the state information of the container orchestration system for the second creation request. When the container orchestration system is in the state corresponding to this state information, the predicted state of the container orchestration system after creating the middleware to be created corresponding to the second creation request on each business node can be predicted, thus obtaining the predicted state corresponding to each business node.
[0092] Step b2: The control node determines the state value corresponding to the predicted state based on the predicted state of each business node.
[0093] In this embodiment of the application, for each creation request, based on the predicted state corresponding to each business node, the state value corresponding to the predicted state is calculated using a target reward function.
[0094] Step 204: The control node determines the target business node from multiple business nodes based on the status value.
[0095] In this embodiment of the application, multiple state values can be filtered to obtain a target state value, and the business node corresponding to the target state value can be used as the target business node.
[0096] It should be noted that step 204 can be achieved through steps C1-C2:
[0097] Step C1: For each requirement information, the control node determines the target state value that meets the state value conditions from multiple state values.
[0098] In this embodiment of the application, the state value condition can be that the state value is greater than a preset state value. In this case, the control node can determine the state value that is greater than the preset state value from multiple state values and filter the state values that are greater than the preset state value to obtain the target state value. Alternatively, the state value condition can be that the maximum state value is selected from multiple state values. In this case, the control node can determine the maximum state value as the target state value from multiple state values.
[0099] Step C2: The control node determines the business node corresponding to the target state value as the target business node.
[0100] The target state value can characterize the optimal performance of the container orchestration system.
[0101] In one feasible implementation, for any creation request, if it is predicted that the performance of the container orchestration system will be optimal after creating the middleware to be created corresponding to the creation request on the Node3 node, then the Node3 node can be used as the target business node.
[0102] It should be noted that step 208 can be executed after step 204.
[0103] Step 205: If the type is Type 1 and the creation request carries an identifier, the control node determines the business node corresponding to the identifier as the target business node.
[0104] The identifier can be the number of the business node, and the identifier is used to uniquely identify the business node.
[0105] In this embodiment of the application, if the type of the middleware to be created is the first type and the creation request carries the business node number "3", then the business node with the number 3 can be determined as the target business node from multiple business nodes.
[0106] It should be noted that step 208 can be executed after step 205.
[0107] Step 206: When the type is the second type, the control node determines the target state information that meets the state conditions from multiple state information based on the demand information.
[0108] In this embodiment of the application, when the middleware to be created is of the second type, candidate status information matching the requirement information is determined from multiple status information; when there is only one candidate status information, the candidate status information is used as the target status information; when there are multiple candidate status information, the candidate status information that best represents the state of the business node is determined from multiple candidate status information and used as the target status information.
[0109] Step 207: The control node determines the business node corresponding to the target status information as the target business node.
[0110] In one feasible implementation, if the determined target state information is the state information of Node3, then Node3 can be used as the target business node.
[0111] Step 208: Control the creation of the middleware to be created on the target business node.
[0112] The following section provides a detailed explanation of the information processing method provided in the embodiments of this application, in conjunction with application scenarios.
[0113] In this embodiment, based on the impact of different types of middleware to be created on Kubernetes performance and considering long-term returns, two methods are used to determine the target node, employing different methods for different types of middleware to be created. The information processing architecture proposed in this embodiment is explained below.
[0114] The information processing architecture includes a middleware type discrimination module, a node discrimination module, a configuration module, a Q-learning scheduling module, a k8s scheduling module, a node status detection module, and a policy execution module.
[0115] The middleware type identification module is primarily responsible for determining the type of the middleware to be created. If the middleware to be created is a single Pod, this module interacts with the Q-learning scheduling module to determine the target Node from multiple business nodes based on the requirement information corresponding to the middleware and the status information of the container orchestration system. If the middleware to be created is multiple Pods, this module interacts with the Kubernetes scheduling module to determine the target Node from multiple business nodes based on the requirement information and the status information of each business node.
[0116] Node identification module: The main function of this module is to determine whether the middleware to be created specifies a particular Node to be created (that is, to determine whether the creation request of type 1 carries a node identifier). If so, this module interacts with the configuration module to realize the creation of the middleware to be created on the specific Node.
[0117] Configuration Module: The main function of this module is to dynamically modify the values.yaml configuration file and use the NodeSelector option to create the middleware to be created on a specified Node. The configuration module can interact with both the Q-learning and Kubernetes scheduling modules. After the Q-learning or Kubernetes scheduling module determines the target Node, it dynamically modifies the values.yaml configuration file to create the middleware to be created on the determined target Node.
[0118] The following combination Figure 3 A detailed explanation of the Q-learning scheduling module is provided.
[0119] like Figure 3 As shown, when the middleware to be created is a single pod and does not carry the identifier of the business node, the learning module in the Q-learning scheduling module uses the Q-learning algorithm to determine the target Node for the middleware to be created. Figure 3 As shown, the Q-learning scheduling module adopts a reinforcement learning model design, mainly comprising the following components: system environment (i.e., Kubernetes state information), agent, reward function, state function, and selection policy. The agent represents the middleware to be created; the state value is determined by the reward value calculated by the reward function; the state function is used to calculate the state of the Kubernetes system when selecting a particular node; and the selection policy refers to selecting a node.
[0120] like Figure 3 As shown, the agent selects a Node at the current moment, which is the state in which the agent begins to try the Kubernetes system (i.e., the Kubernetes environment). The agent observes the Kubernetes state and receives a specific reward value, which can be positive or negative. The agent continuously tries to interact with the Kubernetes environment, and after a certain number of attempts, the agent can eventually make the optimal decision (i.e., determine the target Node from multiple Nodes).
[0121] In one feasible implementation, the agent, acting as the middleware 1 to be created in request 1, selects Node 1 when Kubernetes (k8s) is in the state corresponding to the state information. It then predicts the k8s state value after creating the middleware 1 on Node 1. Subsequently, the middleware 1 selects other Nodes and predicts the k8s state value after creating it on each of these Nodes. This process yields multiple state values for the middleware 1 to be created. The agent then determines the maximum state value from these values and assigns the corresponding N values to the middleware 1. The ode node is used as the target Node node. When Node3 is determined as the target Node node for middleware 1 to be created in creation request 1, it is necessary to obtain the predicted state information of Node3 after creating middleware 1 on Node3, and obtain the predicted first state information of Kubernetes based on the predicted state information of Node3 and the state information of other Node nodes. When the agent is creating middleware 2 to be created in creation request 2, it is necessary to predict the state value of the Node when creating middleware 2 on each Node node when the Kubernetes state is in the state corresponding to the first state information. It should be noted that when middleware 2 to be created attempts to select Node3, the initial state information of Node3 for middleware 2 to be created is the predicted state information of Node3 after creating middleware 1 on Node3.
[0122] The Kubernetes scheduling module is used to determine the target node from multiple nodes based on demand information and the status information of each node.
[0123] The main function of the Node state detection module is to determine the current state information of the Node and, based on the current state information of the Node, determine the current state information of Kubernetes.
[0124] The main function of the strategy execution module is to create the middleware to be created on the target Node determined by the Q-Learning module.
[0125] The following provides a detailed explanation of the information processing methods implemented on the information processing architecture according to the embodiments of this application.
[0126] like Figure 4 As shown, the middleware type determination module first determines the type of the middleware to be created. If the middleware to be created is a single Pod, the module interacts with the Q-learning scheduling module to determine the target Node. If the middleware to be deployed is multiple Pods, the module interacts with the K8S scheduling module to determine the target Node.
[0127] The Q-learning scheduling module receives multiple creation requests from the middleware type discrimination module. Each creation request corresponds to a middleware of type 1 and does not carry a Node identifier. The Q-learning scheduling module sorts these requests by reception time and groups them into multiple groups using a target time window N. It also obtains the status information of each Node, trains a Q-value sequence based on the Q-learning algorithm, and selects the Node with the largest Q-value as the target Node; the Q-value is the status value. After determining the target Node for each creation request, the r-value sequence needs to be updated according to the reward function to update the Node's status; the r-value sequence is the reward value sequence. For creation requests within the same group, when a target Node is determined for each request, the Q-learning scheduling module sends each creation request and its corresponding target Node identifier to the configuration module. The configuration module then modifies the values.yaml configuration file so that the middleware deployment and execution module can create the middleware based on the modified values.yaml configuration file.
[0128] If the middleware to be created is of type 2, the creation request is sent to the Kubernetes scheduling module, which uses native Kubernetes scheduling to determine the target Node. The native Kubernetes scheduling determines the target Node based on the requirement information of the middleware to be created and the status information of each Node.
[0129] If the type of the middleware to be created is Type 1, and the creation request carries the identifier of the Node node, then the target Node node is determined to be the Node node corresponding to the identifier.
[0130] The following explains the Q-learning algorithm used by the Q-learning scheduling module.
[0131] Q-Learning is an advanced version of reinforcement learning; it's a model-free and policy-free learning process. As a model-free version of reinforcement learning, Q-Learning relies on iterative Q-value selection to choose a policy. During the iteration process, Q-Learning generally selects the policy in the direction that maximizes the Q-value. However, this principle isn't followed in every iteration. Q-Learning uses the results of multiple trials, following a certain probability distribution, to maximally advance in the direction of maximizing the Q-value.
[0132] The Q-Learning-based containerized middleware scheduling method uses a numerical iterative solution to approximate the optimal value. The complex network environment in which the middleware to be created resides is a finite-state Markov process. When the middleware to be created selects a Node from the action set (multiple Nodes), i.e., chooses a Node to create the middleware, Kubernetes accepts this action and performs a state transition, while simultaneously assigning a reward value to this decision. The larger the reward value obtained from a Node, the higher the probability of selecting that Node again in the future.
[0133] Specifically, determining the target Node from multiple Node nodes can be described as a quadruple.<S,R,A,Q> Where S represents the Node in the entire Kubernetes cluster; R (Reward) represents a matrix of reward values obtained after selecting an action (a Node); A (Action) represents the behavior of the next Node selected based on the Kubernetes state; as shown in Table 1, Q represents the Q matrix obtained after training (where a set of creation requests corresponds to one Q matrix), which can represent the knowledge that the agent has learned from experience; each element in the Q matrix represents a state value; for each row in the table, it represents the state value corresponding to each Node for a creation request, where max represents the maximum state value.
[0134]
[0135] Table 1. Schematic diagram of the Q matrix
[0136] As shown in Table 1, for request 1 to be created, Node3 represents the target Node node determined for the middleware 1 to be created corresponding to request 1; for request 2 to be created, Node1 represents the target Node node determined for the middleware 2 to be created in request 2, based on the Node3 determined for the middleware 1 to be created.
[0137] The reward function R used to calculate the Q value is shown in formula (1):
[0138]
[0139] in,
[0140] Here, α is the compensation function, which determines the reward value when the node's memory, CPU, and storage cannot meet the minimum resource requirements of the pod. A large negative value indicates that the node's resources are insufficient for the pod's minimum needs. μ is the weighting function. x can represent any one of memory, CPU, and storage. This represents any one of the following: memory free value, CPU free value, and storage free value of the i-th Node. The specific value is determined by the meaning of x. For example, when x represents memory... This represents the free memory value of the i-th Node. This represents any one of the total memory, total CPU, and total storage of the i-th Node, and the specific value is determined according to the meaning of x. This represents the minimum required memory, minimum CPU, or minimum storage for a Pod, specifically determined by the meaning of 'x'. memory_limits This indicates the maximum memory that a Pod node can use. This represents the free memory value of the i-th Node; This represents the total memory usage of the i-th Node.
[0141] Based on certain prior knowledge, a reward matrix R (where each element represents the reward value assigned to a selected node) is given, and the Q matrix is initialized, typically as a zero matrix. A routing action is executed, and the changes in the reward value and the new link state are observed. The Q value is then iteratively updated according to formula (2).
[0142] Q(S,a)←Q(S,a)+α[r+γ*max(Q(S′,a′)-Q(S,a))] Formula (2)
[0143] Wherein, γ (which can also be understood as the attenuation factor) represents the damping coefficient, with a value range of [0,1), Q(S,a) represents the Q value after performing action a in state S corresponding to the state information in k8s; Q(S′,a′) represents the Q value after performing action a′ in the next state S′, r is the reward after performing action a in the current state S (i.e., the reward r in the next state), γ is the discount factor, α is the learning efficiency, γ*max(Q(S′,a′) is the discounted reward of the subsequent state, and γ*max(Q(S′,a′)-Q(S,a)) constitutes the improved estimate of the reward of the subsequent state. According to formula (2), the Q values in the Q matrix are iteratively updated until S is the final state (i.e., each creation request in the same group is determined to the corresponding target business node), and the trained Q matrix is obtained. The middleware is created based on the trained Q matrix.
[0144] It should be noted that the descriptions of the same steps and contents as in other embodiments in this embodiment can be found in the descriptions in other embodiments, and will not be repeated here.
[0145] The information processing method provided in this application embodiment can determine the target business node based on different types of middleware to be created, instead of determining the target business node based on demand information and status information of each business node for each middleware to be created as in related technologies, thus improving the accuracy of determining the target business node.
[0146] Based on the foregoing embodiments, embodiments of this application provide a control node that can be applied to... Figures 1-2 In the information processing method provided in the corresponding embodiment, refer to Figure 5 As shown, the control node 3 may include: a processor 31, a memory 32, and a communication bus 33, wherein:
[0147] Communication bus 33 is used to realize the communication connection between processor 31 and memory 32;
[0148] The processor 31 is used to execute the information processing program in the memory 32 to perform the following steps:
[0149] Receive a creation request for creating middleware, and determine the type of middleware to be created based on the creation request;
[0150] In the case where the type is Type 1 and the creation request does not carry the identifier of the business node, the target business node for creating the middleware to be created is determined from multiple business nodes based on the requirement information corresponding to the middleware to be created and the status information of the container orchestration system; wherein, the business node is a node in the container orchestration system other than the control node;
[0151] In the case of type 2, the target business node is determined from multiple business nodes based on the demand information and the status information of each business node;
[0152] Control the creation of the middleware to be created on the target business node.
[0153] In other embodiments of this application, the processor 31 is used to execute the information processing program in the memory 32 to determine the target business node for creating the middleware to be created from multiple business nodes based on the requirement information corresponding to the middleware to be created and the status information of the container orchestration system, so as to achieve the following steps:
[0154] Obtain the status information of the container orchestration system;
[0155] Based on the demand information and the status information of the container orchestration system, determine the status value of the container orchestration system after creating the middleware to be created on each business node; the status value represents the performance of the container orchestration system.
[0156] The target business node is determined from multiple business nodes based on its status value.
[0157] In other embodiments of this application, the processor 31 is used to execute the information processing program in the memory 32 to obtain the status information of the container orchestration system in order to implement the following steps:
[0158] If the creation request is the first creation request received within the target lifecycle, determine the current state information of the container orchestration system;
[0159] If the creation request is not the initial creation request received within the target period, obtain the predicted state information of the container orchestration system; wherein, the predicted state information is the predicted state information of the container orchestration system after the middleware is created on the last selected business node.
[0160] In other embodiments of this application, the processor 31 is used to execute the information processing program in the memory 32 to determine the state value of the container orchestration system after creating the middleware to be created on each service node, based on demand information and the state information of the container orchestration system, in order to implement the following steps:
[0161] Multiple creation requests are grouped based on the target time window to obtain multiple groups of creation requests;
[0162] For each creation request, based on the requirement information in each creation request and the status information of the container orchestration system, multiple status values are determined for each creation request.
[0163] In other embodiments of this application, the processor 31 is used to execute the information processing program in the memory 32 to determine multiple status values corresponding to each creation request based on the demand information in each creation request and the status information of the container orchestration system, in order to implement the following steps:
[0164] Based on each requirement information and the status information of the container orchestration system, predict the predicted status of the container orchestration system after creating the middleware to be created on each business node.
[0165] Based on the predicted state of each business node, determine the state value corresponding to the predicted state.
[0166] In other embodiments of this application, the processor 31 is used to execute the information processing program in the memory 32 to determine the target service node from multiple service nodes based on the state value, in order to implement the following steps:
[0167] For each requirement, determine the target state value that meets the state value conditions from multiple state values;
[0168] The business node corresponding to the target state value is identified as the target business node.
[0169] In other embodiments of this application, the processor 31 is used to execute an information processing program in the memory 32 to perform the following steps:
[0170] If the type is Type 1 and the creation request carries an identifier, the business node corresponding to the identifier is determined to be the target business node.
[0171] In other embodiments of this application, the processor 31 is used to execute the information processing program in the memory 32 to determine the target service node from multiple service nodes based on demand information and the status information of each service node, in order to implement the following steps:
[0172] Based on the demand information, the target state information that meets the state conditions is determined from multiple state information.
[0173] The business node corresponding to the target status information is identified as the target business node.
[0174] It should be noted that the specific implementation process of the steps executed by the processor in this embodiment can be referred to Figures 1-2 The implementation process of the information processing method provided in the corresponding embodiments will not be described in detail here.
[0175] The control node provided in the embodiments of this application can use different information to determine the target business node based on different types of middleware to be created, instead of determining the target business node based on demand information and status information of each business node for each middleware to be created as in related technologies, thus improving the accuracy of determining the target business node.
[0176] Based on the foregoing embodiments, embodiments of this application provide a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement... Figures 1-2 The steps in the information processing method provided in the corresponding embodiment.
[0177] It should be noted that the aforementioned computer-readable storage media can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it can be various electronic devices that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0178] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0179] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0180] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0181] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0182] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0183] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0184] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. An information processing method, characterized in that, The method, applied to a control node in a container orchestration system, includes: Receive a creation request for creating middleware, and determine the type of middleware to be created based on the creation request; If the type is the first type and the creation request does not carry the identifier of the business node, If the creation request is the first creation request received within the target period, determine the current state information of the container orchestration system; If the creation request is not an initially received creation request within the target period, the predicted state information of the container orchestration system is obtained; wherein, the predicted state information is the predicted state information of the container orchestration system after the middleware is created on the previously selected business node; multiple creation requests are grouped based on a target time window to obtain multiple groups of creation requests; wherein, the size of the target time window is determined by the number of business nodes in the container orchestration system, and the size of the time window is equal to the number of business nodes; For each group of creation requests, based on each requirement information and the status information of the container orchestration system, predict the predicted status of the container orchestration system after the middleware to be created is created on each business node. Based on the predicted state corresponding to each business node, a state value corresponding to the predicted state is calculated using a target reward function; wherein, the state value characterizes the performance of the container orchestration system; Based on the state value, a target business node for creating the middleware to be created is determined from multiple business nodes; the reward value sequence is updated according to the target reward function to update the state of the business node, until a corresponding target business node is determined for each creation request in the same group; wherein, the business node is a node in the container orchestration system other than the control node; In the case where the type is the second type, the target business node is determined from the plurality of business nodes based on the demand information and the status information of each business node; Control the creation of the middleware to be created on the target business node.
2. The method according to claim 1, characterized in that, The step of determining the target business node for creating the middleware to be created from multiple business nodes based on the status value includes: For each of the required information, a target state value that satisfies the state value condition is determined from the plurality of state values; The business node corresponding to the target state value is determined as the target business node.
3. The method according to claim 1, characterized in that, The method further includes: If the type is the first type and the creation request carries the identifier, the business node corresponding to the identifier is determined to be the target business node.
4. The method according to claim 1, characterized in that, The step of determining the target business node from the plurality of business nodes based on the demand information and the status information of each business node includes: Based on the aforementioned requirement information, target state information that satisfies the state conditions is determined from multiple state information; The business node corresponding to the target status information is determined to be the target business node.
5. A control node, characterized in that, The control node includes: a processor, a memory, and a communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute an information processing program in the memory to implement the steps of the information processing method as described in any one of claims 1 to 4.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps of the information processing method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method and device for deploying pod
CN112948050A