Node control method and device, equipment and storage medium
By obtaining and analyzing node parameters in the distributed system, dynamically updating the regulation threshold and controlling the node status, the problem of inappropriate node adjustment under the static configuration load balancing method is solved, and the stability and resource utilization of the system are improved.
Patent Information
- Application Number
- CN202411693709.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-25
AI Technical Summary
In the prior art, the load balancing method based on static configuration is prone to adjust the number of nodes inappropriately, resulting in unstable system operation, and may cause waste of resources or overloaded system operation.
By obtaining the node parameters of the operating node and the control node in the target system, determining the system operation index and expected operation index, updating the node regulation threshold, and dynamically controlling the operating status of the control node to adapt to changes in system load.
It realizes automatic adjustment of the number of nodes under dynamically changing loads and complex business needs, avoiding the instability of system operation caused by fixed thresholds, and improving the system's resource utilization and reliability.
Smart Images

Figure CN119544531A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a node control method, device, equipment and storage medium. Background Art
[0002] With the rapid development of the Internet and big data technologies, distributed systems have become the mainstream choice for modern information technology architecture. Distributed systems can distribute computing tasks to multiple nodes for execution, thereby improving the processing power and reliability of distributed systems. However, this also brings challenges such as complex resource management, difficult load balancing, and dynamic expansion requirements.
[0003] In the prior art, distributed systems mainly manage resources in advance through static configuration, use load balancers for load balancing, and use automated operation and maintenance tools to adjust the number of nodes in the distributed system. However, these methods have limitations when dealing with dynamically changing loads and complex business needs. At present, distributed systems need to configure fixed thresholds in advance through static configuration. When executing load balancing tasks, the operating indicators of the distributed system are checked. If the operating indicators of the distributed system exceed the fixed thresholds configured in advance, the distributed system is adjusted, for example: the number of nodes in the distributed system is adjusted using operation and maintenance tools.
[0004] However, when facing increasingly complex distributed system scenarios, the load balancing method based on static configuration is prone to cause the problem of unstable operation of the distributed system due to inappropriate adjustment of the number of nodes. For example, if the operating index of the distributed system is greater than the fixed threshold, the number of nodes will be increased. However, if the fixed threshold is small, the number of nodes will be increased frequently, which will not only waste system resources, but also cause system failure due to frequent resource configuration; if the fixed threshold is large, the number of nodes cannot be increased in time, which will cause the system to overload and even crash. Summary of the invention
[0005] The present application provides a node control method, device, equipment and storage medium to solve the problem that the existing technology uses a load balancing method based on static configuration, which is prone to cause unstable operation of the distributed system due to inappropriate adjustment of the number of nodes.
[0006] In view of the above technical problems, the technical solution of this application is solved by the following embodiments:
[0007] An embodiment of the present application provides a node control method, including: obtaining node parameters corresponding to operating nodes in a target system and obtaining node parameters corresponding to control nodes in a control direction of the target system; determining a system operating index and an expected operating index corresponding to the target system according to the node parameters corresponding to the operating nodes and the node parameters corresponding to the control nodes; updating a node control threshold corresponding to the control direction according to the system operating index and the expected operating index; and controlling the operating state of the control node in the target system according to the system operating index and the node control threshold corresponding to the control direction.
[0008] Among them, the obtaining of node parameters corresponding to the control nodes of the target system in the control direction includes: obtaining node parameters corresponding to the control nodes of the target system in different control directions respectively; the types of control directions include increasing node directions and decreasing node directions; or, determining the control direction corresponding to the target system in a future time period, and obtaining node parameters corresponding to the control nodes of the target system in the determined control direction.
[0009] Among them, the obtaining of the node parameters corresponding to the control nodes of the target system in the control direction includes: when the control direction is the direction of increasing nodes, selecting one of the deactivated nodes in the target system as the control node, and obtaining the node parameters corresponding to the control node; when the control direction is the direction of reducing nodes, selecting one of the running nodes in the target system as the control node, and obtaining the node parameters corresponding to the control node.
[0010] Among them, selecting one of the operating nodes in the target system as the control node includes: selecting the operating node that was most recently enabled among the various operating nodes in the target system as the control node; or selecting the operating node with the largest node operation index among the various operating nodes in the target system as the control node.
[0011] Wherein, the node parameters include: multiple remaining resource values and a weight value corresponding to each of the remaining resource values; determining the system operation index and the expected operation index corresponding to the target system according to the node parameters corresponding to the operating node and the node parameters corresponding to the regulating node includes: determining the system operation index corresponding to the target system according to the multiple remaining resource values corresponding to the operating node and the weight value corresponding to each of the remaining resource values; determining the expected operation index corresponding to the target system according to the multiple remaining resource values corresponding to the operating node and the weight value corresponding to each of the remaining resource values and according to the multiple remaining resource values corresponding to the regulating node and the weight value corresponding to each of the remaining resource values.
[0012] Wherein, updating the node control threshold corresponding to the control direction according to the system operation index and the expected operation index includes: determining the control influence coefficient according to the system operation index and the expected operation index; adding a mapping relationship point corresponding to the system operation index and the control influence coefficient in the preset control mapping relationship data; wherein the control mapping relationship data is used to record the system operation index at each historical time in the control direction and the mapping relationship point corresponding to the control influence system; in the control mapping relationship data, determining the extreme value mapping relationship point in the control direction, and using the system operation index corresponding to the extreme value mapping relationship point as the node control threshold corresponding to the control direction.
[0013] Among them, controlling the operating state of the control node in the target system according to the system operating index and the node control threshold corresponding to the control direction includes: when the control direction is the node increase direction, taking the current time as the time end point, forwardly obtaining each system operating index determined within a preset first time length; in the order of determining time from first to last, comparing and obtaining each system operating index from less than the node control threshold corresponding to the node increase direction to greater than or equal to the node control threshold corresponding to the node increase direction, controlling the operating state of the control node when the system operating index was most recently determined to be enabled; when the control direction is the node reduction direction, taking the current time as the time end point, forwardly obtaining each system operating index determined within a preset second time length; in the order of determining time from first to last, comparing and obtaining each system operating index from greater than the node control threshold corresponding to the node reduction direction to less than or equal to the node control threshold corresponding to the node reduction direction, controlling the operating state of the control node when the system operating index was most recently determined to be disabled.
[0014] An embodiment of the present application provides a node control device, including: an acquisition module, used to acquire node parameters corresponding to the operating nodes in the target system and to acquire node parameters corresponding to the control nodes of the target system in the control direction; a determination module, used to determine the system operation index and the expected operation index corresponding to the target system according to the node parameters corresponding to the operating nodes and the node parameters corresponding to the control nodes; an update module, used to update the node control threshold corresponding to the control direction according to the system operation index and the expected operation index; a control module, used to control the operation state of the control node in the target system according to the system operation index and the node control threshold corresponding to the control direction.
[0015] An embodiment of the present application also provides a node control device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to: execute a node control program stored in the memory to implement any of the node control methods described above.
[0016] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed to implement any of the node control methods described above.
[0017] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application can obtain the node parameters corresponding to the running nodes in the target system and obtain the node parameters corresponding to the control nodes of the target system in the control direction; according to the node parameters corresponding to the running nodes and the node parameters corresponding to the control nodes, determine the system operation index and expected operation index corresponding to the target system; according to the system operation index and the expected operation index, update the node control threshold corresponding to the control direction; according to the system operation index and the node control threshold corresponding to the control direction, control the operation state of the control node in the target system. According to the node parameters of the running nodes and the node parameters of the control nodes in the control direction, the embodiment of the present application can determine the system operation index of the target system and the expected operation index after predicting the number of control nodes of the target system. The system operation index and the expected operation index can reflect the resource changes that the number of control nodes can bring to the target system, and the node control threshold is updated according to the resource changes. In this way, in the process of continuously adjusting the number of nodes, the node control threshold can be adjusted according to the resource changes, avoiding the problem of unstable system operation caused by the inability to adjust the number of nodes in time using a fixed threshold. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0021] Figure 1 is a flowchart of a node control method according to an embodiment of the present application;
[0022] Figure 2 A flowchart of the steps of determining a system operation index and an expected operation index according to an embodiment of the present application;
[0023] Figure 3 A flowchart of the steps for updating the node control threshold according to an embodiment of the present application;
[0024] Figure 4 is a structural diagram of a node control device according to an embodiment of the present application;
[0025] Figure 5 It is a structural diagram of a node control device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0027] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0028] The present application embodiment provides a node control method. Figure 1 , which is a flow chart of a node control method according to an embodiment of the present application.
[0029] Step S110, obtaining node parameters corresponding to the operating nodes in the target system and obtaining node parameters corresponding to the control nodes in the control direction of the target system.
[0030] Types of target systems include, but are not limited to: distributed systems.
[0031] A running node refers to a node that is running in the target system. The types of nodes include, but are not limited to, virtual nodes and physical nodes. A virtual node can be a virtual machine, such as a microservice system running on a server. A physical node can be a server.
[0032] The control direction refers to the direction of increasing or decreasing the nodes of the target system. The types of control directions include increasing nodes and decreasing nodes. Increasing nodes means increasing the number of running nodes in the target system. Decreasing nodes means decreasing the number of running nodes in the target system.
[0033] A control node refers to a node to be added or reduced in the target system.
[0034] Node parameters refer to the remaining resource data of a node. The remaining resource data refers to the unused resources of the node, which can reflect the operating capacity that the node can still provide.
[0035] In the embodiment of the present application, the control direction and the control nodes in the control direction can be actively set by the operation and maintenance tool, or automatically set by the control strategy. The method for setting the control direction and the control nodes in the control direction by the control strategy will be described later, so it will not be repeated here.
[0036] Step S120: determining a system operation index and an expected operation index corresponding to the target system according to the node parameters corresponding to the operation node and the node parameters corresponding to the control node.
[0037] The system operation index is used to measure the current operation performance of the target system. The system operation index can reflect the system health of the target system. The higher the system operation index, the more available resources the target system has and the better the operation performance of the target system. The lower the system operation index, the fewer available resources the target system has and the worse the operation performance of the target system.
[0038] The expected operation index is used to measure the operating performance of the target system after adjusting the number of nodes (increasing or reducing the number of running nodes). The expected operation index can reflect the system health of the target system after adjusting the number of nodes. The higher the expected operation index, the more available resources there are after adjusting the number of nodes, and the better the operating performance of the target system. The lower the expected operation index, the fewer available resources there are after adjusting the number of nodes, and the worse the operating performance of the target system.
[0039] In the embodiment of the present application, there is a corresponding relationship between the expected operation index and the control direction. According to the node parameters corresponding to the operation node and the node parameters corresponding to the control node in the control direction, the system operation index corresponding to the target system and the expected operation index corresponding to the control direction are determined.
[0040] Step S130: updating the node control threshold corresponding to the control direction according to the system operation index and the expected operation index.
[0041] The node control threshold is used to measure whether the target system meets the node quantity control conditions.
[0042] In the embodiment of the present application, there is a corresponding relationship between the control direction and the node control threshold, and the increasing node direction and the decreasing node direction correspond to different node control thresholds. According to the system operation index corresponding to the target system and the expected operation index corresponding to the target system in the control direction, the node control threshold corresponding to the control direction is updated.
[0043] Step S140: controlling the operating state of the control node in the target system according to the system operation index and the node control threshold corresponding to the control direction.
[0044] In an embodiment of the present application, node parameters corresponding to the operating nodes in the target system and node parameters corresponding to the control nodes of the target system in the control direction are obtained once every preset update time period; the system operating index and the expected operating index corresponding to the target system are determined based on the node parameters corresponding to the operating nodes and the node parameters corresponding to the control nodes obtained this time; and the node control threshold corresponding to the control direction is updated based on the system operating index and the expected operating index; taking the current time as the time end point, each system operating index determined within a preset time length is obtained; and based on the size change of each system operating index compared to the current node control threshold corresponding to the control direction, the operating state of the current control node in the target system is controlled.
[0045] Furthermore, the preset time length is an empirical value or a value determined by experiment. The system operation index has been determined at least three times within the preset time length. Among them, among the various system operation indexes determined within the preset time length, that is, among the at least three system operation indexes determined, the system operation index determined most recently (this time) is included. Of course, the preset time lengths corresponding to different control directions may be different or different. For example: increasing the node direction corresponds to the first time length, reducing the node direction corresponds to the second time length, and the first time length and the second time length are the same or different.
[0046] Furthermore, each time when the node parameters corresponding to the control nodes of the target system in the control direction are obtained, the control nodes may be the same or different. The embodiment of the present application controls the operation status of the control nodes at this time.
[0047] Furthermore, in the case where the control direction is the direction of increasing nodes, taking the current time as the end point of time, obtain each system operation index determined within the preset first time length; in the order of determining time from first to last, compare and obtain each system operation index from less than the node control threshold corresponding to the direction of increasing nodes to greater than or equal to the node control threshold corresponding to the direction of increasing nodes, and control the operation state of the control node when the system operation index is determined most recently (this time) to be enabled. In other cases, keep the number of running nodes in the target system unchanged. Among them, the determination time refers to the time of determining the system operation index. Enabling means switching the control node to an operating node, that is, a node for processing business traffic.
[0048] Furthermore, when the control direction is to reduce nodes, take the current time as the end point, and obtain the system operation indexes determined within the preset second time length; compare and obtain the system operation indexes from greater than the node control threshold corresponding to the direction of reducing nodes to less than or equal to the node control threshold corresponding to the direction of reducing nodes in the order of determining time from first to last, and control the operation state of the control node when the system operation index was determined most recently (this time) to be disabled. In other cases, keep the number of running nodes in the target system unchanged. Deactivation means switching the control node to a disabled node, that is, a node that does not process business traffic.
[0049] In an embodiment of the present application, the node parameters corresponding to the operating nodes in the target system and the node parameters corresponding to the control nodes of the target system in the control direction are obtained; the system operation index and the expected operation index corresponding to the target system are determined according to the node parameters corresponding to the operating nodes and the node parameters corresponding to the control nodes; the node control threshold corresponding to the control direction is updated according to the system operation index and the expected operation index; the operation state of the control node in the target system is controlled according to the system operation index and the node control threshold corresponding to the control direction. According to the node parameters of the operating nodes and the node parameters of the control nodes in the control direction, the embodiment of the present application can determine the system operation index of the target system and the expected operation index after predicting the number of control nodes of the target system. The system operation index and the expected operation index can reflect the resource changes that the number of operating nodes can bring to the target system, and the node control threshold is updated according to the resource changes. In this way, in the process of continuously adjusting the number of nodes, the node control threshold can be adjusted according to the resource changes, avoiding the problem of unstable system operation caused by the inability to adjust the number of nodes in time using a fixed threshold.
[0050] In order to make the embodiments of the present application easier to understand, the node control method of the embodiments of the present application will be further described below.
[0051] The following further describes how to obtain the node parameters corresponding to the running node and the process of obtaining the node parameters corresponding to the control node.
[0052] The node parameters include: a plurality of remaining resource values and a weight value corresponding to each remaining resource value. Each remaining resource value corresponds to a resource type, and each weight value corresponds to a resource type. In other words, the node parameters include: the remaining resource values and weight values corresponding to a plurality of resource types.
[0053] Resource types include, but are not limited to, memory, CPU (Central Processing Unit), and disk.
[0054] Furthermore, the number of running nodes can be multiple, and the number of regulating nodes can be one. Then, the following steps can be performed for each running node (or regulating node): query the resource usage values corresponding to multiple resource types of the running node, such as: the current memory usage rate, CPU occupancy rate and disk usage rate of the node; use the resource upper limit value corresponding to each resource type to calculate the remaining resource value of the resource type, and obtain multiple remaining resource values corresponding to the running node. The resource upper limit value is the maximum value that the resource can use. For example: the current memory usage value is 0.5, the memory upper limit value is 1, then the remaining memory value is 0.5, of course, the remaining memory value can also be directly expressed as 1-0.5 (that is: 1 minus 0.5). Pre-set a weight value for each resource type. When obtaining the remaining resource value corresponding to each resource type of the running node (or regulating node), the weight value corresponding to each resource type can be obtained, and then the remaining resource values and weight values corresponding to multiple resource types can be obtained.
[0055] Since the control nodes are related to the control direction, the following will further describe how to determine the control direction and control nodes of the target system and obtain the node parameters corresponding to the control nodes of the target system in the control direction.
[0056] In the embodiment of the present application, the control direction is first determined, then the control node is determined, and finally the node parameters corresponding to the control node in the control direction are obtained. The method for determining the control node will be described later, and the method for determining the control direction and obtaining the node parameters corresponding to the control node in the control direction is described first.
[0057] Specifically, method one may be adopted: obtaining node parameters corresponding to the control nodes of the target system in different control directions; the types of control directions include increasing node directions and decreasing node directions; or, method two may be adopted: determining the control direction corresponding to the target system in a future time period, and obtaining node parameters corresponding to the control nodes of the target system in the determined control direction.
[0058] For the first method, both control directions can be taken into consideration, and the node parameters corresponding to the control nodes of the target system in the direction of increasing nodes are obtained, and the node parameters corresponding to the control nodes of the target system in the direction of reducing nodes are obtained.
[0059] Furthermore, in the first approach, it is not necessary to determine which specific control direction is currently being met, and node control can be performed separately for the direction of increasing nodes and the direction of reducing nodes, for example, the following steps:
[0060] Step S1, obtaining node parameters corresponding to the running nodes in the target system, obtaining node parameters corresponding to the regulating nodes in the target system in the direction of increasing nodes, and obtaining node parameters corresponding to the regulating nodes in the target system in the direction of reducing nodes.
[0061] Step S2: determining a system operation index corresponding to the target system according to node parameters corresponding to the operation node.
[0062] The following step S3 and step S4 are parallel steps.
[0063] Step S3, according to the node parameters corresponding to the running nodes and the node parameters corresponding to the regulating nodes in the direction of adding nodes, determine the expected running index of the target system in the direction of adding nodes; according to the system running index and the expected running index corresponding to the direction of adding nodes, update the node regulating threshold corresponding to the direction of adding nodes; according to the system running index and the node regulating threshold corresponding to the direction of adding nodes, control the running state of the regulating node in the direction of adding nodes in the target system.
[0064] Step S4, according to the node parameters corresponding to the running nodes and the node parameters corresponding to the regulating nodes in the direction of reducing the nodes, determine the expected running index of the target system in the direction of reducing the nodes; according to the system running index and the expected running index corresponding to the direction of reducing the nodes, update the node regulation threshold corresponding to the direction of reducing the nodes; according to the system running index and the node regulation threshold corresponding to the direction of reducing the nodes, control the running state of the regulating nodes in the direction of reducing the nodes in the target system.
[0065] Since the system operation index of the target system at the same time point is the same value, and the node control thresholds corresponding to the direction of increasing nodes and the direction of reducing nodes are different, the problem of increasing and reducing the number of nodes in the target system at the same time point will not occur. Therefore, there will be no conflict in taking both control directions into account.
[0066] For method 2, the control direction corresponding to the target system in the future time period can be received and determined, and the control direction is the direction of increasing nodes or reducing nodes; according to the control direction corresponding to the target system in the future time period, the node parameters corresponding to the control nodes in the target system are obtained.
[0067] The starting point of the future time period can be the current time or another future time.
[0068] For example: when it is predicted that a traffic peak will occur in the next period of time, an early warning notification is issued and the early warning notification carries the control direction and the control time period (future time period); after receiving the early warning notification, the control direction corresponding to the target system in the future time period can be determined.
[0069] For method 2, it is also possible to predict the expected traffic data of the target system in a preset future time period based on the historical traffic data corresponding to the target system; determine the control direction of the target system in the future time period by comparing the current traffic data corresponding to the target system with the expected traffic data, and the control direction is to increase the node direction or to reduce the node direction; and obtain the node parameters corresponding to the control nodes in the target system based on the control direction of the target system in the future time period.
[0070] Historical traffic data refers to traffic data in a historical time period. The specific type of traffic data can be determined according to the needs. For example, historical traffic data is the number of visits. The end time of the historical time period can be the current time or the time before the current time point.
[0071] Estimated traffic data refers to traffic data for a future period of time.
[0072] Current traffic data refers to the traffic data at the current time point.
[0073] When the expected traffic data is less than the current traffic data, the control direction corresponding to the future time period is determined to be the direction of reducing nodes. When the expected traffic data is greater than or equal to the current traffic data, the control direction corresponding to the future time period is determined to be the direction of increasing nodes.
[0074] Furthermore, the traffic prediction model can be pre-trained so that the trained traffic prediction model has the ability to predict the expected traffic data for future time periods. After the traffic prediction model is trained, the historical traffic volume is input into the traffic prediction model to obtain the expected traffic data output by the traffic prediction model.
[0075] In the embodiments of the present application, different control directions have different ways of determining control nodes.
[0076] In the case where the control direction is to increase the node direction, one of the disabled nodes is selected as the control node in the target system, and the node parameters corresponding to the control node are obtained. Among them, the disabled node refers to the node that is displayed as unenabled in the target system. Since each disabled node has a large amount of remaining resources, one of the disabled nodes can be randomly selected as the control node. Of course, it is also possible to select a disabled node that matches the remaining resource data based on the expected traffic data in the future time period as the control node in order to cope with future traffic. For example: if the traffic surges in the future, then a disabled node with a larger remaining resource data is selected as the control node.
[0077] In the case where the control direction is a direction of reducing nodes, one of the running nodes is selected in the target system as the control node, and a node parameter corresponding to the control node is obtained.
[0078] Further, selecting one of the running nodes in the target system as the regulating node includes: selecting the running node that was most recently enabled among the running nodes of the target system as the regulating node; or selecting the running node with the largest node running index among the running nodes of the target system as the regulating node.
[0079] Among them, since the running nodes enabled earlier have already taken on more traffic, and the running nodes enabled most recently have just started to take on traffic, even if the running nodes enabled most recently are disabled, the impact on the target system is small, and the running nodes enabled most recently can be selected as the control nodes. The system operation index is used to reflect the resources that can be used by the running nodes. If the system operation index is large, it means that the node has more remaining resources, which means that the node takes on less traffic. Therefore, even if the running node with the largest system operation index is disabled, the impact on the target system is small.
[0080] In the embodiment of the present application, after obtaining the node parameters corresponding to the operating node and the node parameters corresponding to the regulating node, the system operating index and the expected operating index corresponding to the target system can be determined.
[0081] The process of determining the system operation index and the expected operation index is described below.
[0082] like Figure 2 , which is a flowchart of the steps of determining a system operation index and an expected operation index according to an embodiment of the present application.
[0083] Step S210: determining a system operation index corresponding to the target system according to a plurality of remaining resource values corresponding to the operating nodes and a weight value corresponding to each of the remaining resource values.
[0084] In the target system, there can be multiple running nodes; for each running node, the node running index corresponding to the running node is determined according to the multiple remaining resource values corresponding to the running node and the weight value corresponding to each remaining resource value; according to the node running indices corresponding to the multiple running nodes, the system running index corresponding to the target system is determined.
[0085] The node operation index is used to measure the operation performance of the node. The node operation index can reflect the system health of the node. The higher the node operation index, the more available resources the node has and the better the node operation performance. The lower the node operation index, the fewer available resources the node has and the worse the node operation performance.
[0086] Furthermore, the node operation index corresponding to the running node can be determined by the following formula:
[0087] f ti =(a(1-α i )+b(1-β i ))×(v-γ i );
[0088] Where i represents the i-th running node; f ti represents the node operation index corresponding to the i-th operation node; a represents the weight value corresponding to the first resource type; 1-α i represents the remaining resource value corresponding to the first resource type of the i-th running node, where 1 represents the resource upper limit value corresponding to the first resource type is 1; b represents the weight value corresponding to the second resource type; 1-β i represents the remaining resource value corresponding to the second resource type of the i-th running node, where 1 represents the resource upper limit value corresponding to the second resource type is 1; v-γ i represents the remaining resource value corresponding to the third resource type of the i-th running node, and v represents the resource upper limit value corresponding to the third resource type is v. Among them, the weight value corresponding to the third resource type is 1. For example: the first resource type corresponds to the CPU usage rate, the second resource type corresponds to the memory occupancy rate, and the third resource type corresponds to the disk access rate.
[0089] Furthermore, the sum of the node operation indexes corresponding to the multiple operation nodes can be calculated, and the sum can be determined as the system operation index corresponding to the target system. For example, the system operation index corresponding to the target system can be determined using the following formula:
[0090]
[0091] Wherein, f(k) represents the system operation index corresponding to the target system with k running nodes currently enabled, and k is the number of running nodes.
[0092] Step S220, determining the expected operation index corresponding to the target system according to the multiple remaining resource values corresponding to the operating node and the weight value corresponding to each of the remaining resource values and according to the multiple remaining resource values corresponding to the regulation node and the weight value corresponding to each of the remaining resource values.
[0093] Referring to the above steps, the node operation index corresponding to the control node can be calculated according to the multiple remaining resource values corresponding to the control node and the weight value corresponding to each of the remaining resource values; the expected operation index corresponding to the target system can be calculated according to the node operation indices corresponding to the multiple operating nodes and the node operation index corresponding to the control node.
[0094] Furthermore, when the control direction is to increase the node direction, the sum of the node operation indexes corresponding to the multiple operation nodes and the node operation indexes corresponding to the control node can be calculated, and the sum can be used as the expected operation index corresponding to the target system. For example, if the control node is regarded as the operation node, the system operation index corresponding to the target system can be determined by the following formula:
[0095]
[0096] Among them, f(k+1) represents the expected operation index corresponding to the target system, and k+1 is the number of running nodes (including the number of control nodes and sampled in the same way as the running nodes to calculate the node operation index corresponding to the control node).
[0097] Furthermore, when the control direction is to reduce nodes, the sum of the node operation indexes corresponding to the multiple operation nodes after reducing the control nodes can be calculated, and the sum can be used as the expected operation index corresponding to the target system. For example, the following formula can be used to determine the system operation index corresponding to the target system:
[0098]
[0099] Among them, f(k-1) represents the expected operation index corresponding to the target system, and k-1 is the number of operating nodes after reducing the control nodes (the control nodes are nodes selected from the operating nodes).
[0100] After determining the system operation index and the expected operation index, the node control threshold corresponding to the control direction can be updated according to the system operation index and the expected operation index. The process of how to update the node control threshold is described below. Among them, if the embodiment of the present application performs node control only for one control direction, then directly execute the following steps. If the embodiment of the present application performs node control for two control directions respectively, the two control directions need to execute the following steps respectively.
[0101] like Figure 3 , which is a flowchart of the steps of updating the node control threshold according to an embodiment of the present application.
[0102] Step S310: determining a control influence coefficient according to the system operation index and the expected operation index.
[0103] The control impact coefficient is used to measure the impact of the number of control nodes on the target system.
[0104] Furthermore, the difference between the system operation index and the expected operation index can be determined as the control impact coefficient. In this way, the control impact coefficient can reflect the resource gain brought to the target system by adding an operation node and the resource loss brought to the target system by reducing an operation node.
[0105] When the control direction is to increase the number of nodes, the control impact coefficient can reflect the load reduction degree (resource gain) of the target system after increasing the number of running nodes. The larger the control impact coefficient, the greater the load reduction degree of the target system after increasing the number of running nodes, and the smaller the control impact coefficient, the smaller the load reduction degree of the target system after increasing the number of running nodes.
[0106] When the control direction is to reduce nodes, the control impact system can reflect the increase in the target system's load (resource loss) after the number of running nodes is reduced. The larger the control impact coefficient, the greater the increase in the target system's load after the number of running nodes is reduced; the smaller the control impact coefficient, the smaller the increase in the target system's load after the number of running nodes is reduced.
[0107] Step S320, adding a mapping relationship point corresponding to the system operation index and the control influence coefficient to the preset control mapping relationship data; wherein the control mapping relationship data is used to record the mapping relationship point corresponding to the system operation index and the control influence system at each historical time in the control direction.
[0108] The control mapping relationship data may be two-dimensional coordinate data. The mapping relationship point is a discrete point in the two-dimensional coordinate data, the abscissa represents the system operation index corresponding to the mapping relationship point, and the ordinate represents the control influence coefficient corresponding to the mapping relationship point.
[0109] Furthermore, different control mapping relationship data can be set for different control directions. For the control mapping relationship data corresponding to each control direction, the node parameters corresponding to the operating nodes in the target system and the node parameters corresponding to the control nodes of the target system in the control direction can be obtained once every preset recording time period; according to the node parameters corresponding to the operating nodes and the node parameters corresponding to the control nodes, the system operation index and the expected operation index corresponding to the target system are determined; and, according to the system operation index and the expected operation index, the control influence coefficient is determined; in this way, every preset recording time period, a mapping relationship point with the horizontal axis being the system operation index and the vertical axis being the control influence coefficient can be added to the control mapping relationship data corresponding to the control direction. Among them, the time interval between two adjacent historical times is the time length of the recording time period. The time length of the recording time period can be equal to the time length of the above-mentioned update time period.
[0110] Step S330, determining the extreme value mapping relationship point in the control direction in the control mapping relationship data, and using the system operation index corresponding to the extreme value mapping relationship point as the node control threshold corresponding to the control direction.
[0111] The extreme value mapping relationship point refers to the peak mapping relationship point with the largest ordinate (largest control influence coefficient) and the valley mapping relationship point with the smallest ordinate (smallest control influence coefficient) in the control mapping relationship data.
[0112] In the case where the control direction is the direction of increasing nodes, in the control mapping relationship data, the slope value corresponding to each mapping relationship point is determined, and the peak mapping relationship point in the control direction is determined according to the slope value corresponding to each mapping relationship point. The system operation index corresponding to the peak mapping relationship point is determined as the node control threshold corresponding to the direction of increasing nodes.
[0113] The slope value corresponding to the mapping relationship point may be a tangent slope value of the mapping relationship point.
[0114] Furthermore, in the order of the system operation index from large to small, each mapping relationship point is connected, each mapping relationship point is simulated as a curve, and the slope value corresponding to each mapping relationship point is determined according to the curve; after determining the slope value corresponding to each mapping relationship point, the mapping relationship point where the slope value changes from positive to negative is determined, and the mapping relationship point is the peak mapping relationship point. If there are multiple mapping relationship points where the slope value changes from positive to negative, the mapping relationship point with the largest control influence coefficient is taken as the peak mapping relationship point.
[0115] The peak mapping relationship point is the point where the target system increases the number of running nodes to obtain the maximum resource gain. In other words, adding a running node at this peak mapping relationship point will reduce the load of the target system to the greatest extent and improve the performance of the target system most significantly. If this point is used as a reference point, then adding running nodes to the target system can ensure the optimal performance of the target system and avoid the problem of blindly adding running nodes and failing to reduce the load burden on the target system. Because of this property of the peak mapping relationship point, the system operation index corresponding to the peak mapping relationship point can be used as the node control threshold corresponding to the direction of node addition.
[0116] In the case where the control direction is a node reduction direction, in the control mapping relationship data, the slope value corresponding to each mapping relationship point is determined, and the valley mapping relationship point in the control direction is determined according to the slope value corresponding to each mapping relationship point. The system operation index corresponding to the valley mapping relationship point is determined as the node control threshold corresponding to the node reduction direction.
[0117] Furthermore, in the order of the system operation index from small to large, each mapping relationship point is connected, each mapping relationship point is simulated as a curve, and the slope value corresponding to each mapping relationship point is determined according to the curve; after determining the slope value corresponding to each mapping relationship point, the mapping relationship point where the slope value changes from negative to positive is determined, and the mapping relationship point is regarded as the valley mapping relationship point. If there are multiple mapping relationship points where the slope value changes from negative to positive, the mapping relationship point with the smallest control influence coefficient is regarded as the valley mapping relationship point.
[0118] The valley mapping relationship point is the point where the target system reduces the number of running nodes to obtain the minimum resource loss. In other words, if one running node is reduced at this valley mapping relationship point, the load increase of the target system is the smallest, and the performance degradation of the target system is the least obvious. If this point is used as a reference point, then reducing the running nodes in the target system can ensure that the performance of the target system is relatively stable. Avoid the problem of overload operation caused by insufficient resources of the target system due to blindly reducing the number of running nodes. Because of this property of the valley mapping relationship point, the system operation index corresponding to the valley mapping relationship point can be used as the node control threshold corresponding to the node reduction direction.
[0119] After determining the node control threshold corresponding to the control direction, the operation state of the control node in the target system can be controlled according to the system operation index and the node control threshold corresponding to the control direction. The process of controlling the operation state of the control node is described below.
[0120] In the case where the control direction is the direction of increasing nodes, the current time is taken as the time end point, and each system operation index determined within the preset first time length is obtained forward; according to the order of the determined time from first to last, it is compared that each system operation index changes from less than the node control threshold corresponding to the direction of increasing nodes to greater than or equal to the node control threshold corresponding to the direction of increasing nodes, and the operation state of the control node when the system operation index is determined most recently is controlled to be enabled. Further, if each system operation index changes from less than the node control threshold corresponding to the direction of increasing nodes to greater than or equal to the node control threshold corresponding to the direction of increasing nodes, it means that the change trend of each system operation index is gradually increasing. In the process of gradually increasing, the system operation index is less than the node control threshold, which means that if the number of operating nodes is increased, the resource gain of the target system can be increased, but the maximum resource gain cannot be achieved. When the system operation index gradually increases to greater than or equal to the node control threshold, it means that if the number of operating nodes is increased, not only the resource gain of the target system can be increased, but also the maximum resource gain can be reached or even exceeded. At this time, the number of operating nodes is truly increased, which can more effectively reduce the load of the target system and improve the performance of the target system.
[0121] In the case where the control direction is the direction of reducing nodes, the current time is taken as the time end point, and each system operation index determined within the preset second time length is obtained forward; according to the order of the determined time from first to last, it is compared that each system operation index changes from greater than the node control threshold corresponding to the direction of reducing nodes to less than or equal to the node control threshold corresponding to the direction of reducing nodes, and the operation state of the control node when the system operation index is determined most recently is controlled to be disabled. Further, if each system operation index changes from greater than the node control threshold corresponding to the direction of reducing nodes to less than or equal to the node control threshold corresponding to the direction of reducing nodes, it means that the change trend of the system operation index is gradually decreasing. In the process of gradually decreasing, the system operation index is greater than the node control threshold, indicating that if the number of running nodes is reduced, the resource loss of the target system can be reduced, but the minimum resource loss cannot be achieved. When the system operation index gradually decreases to less than or equal to the node control threshold, it means that if the number of running nodes is reduced, not only the resource loss of the target system can be reduced, but also the minimum resource loss can be reached or even exceeded. At this time, truly reducing the number of running nodes can optimize the resource utilization of the target system and avoid the waste of resources of the target system.
[0122] In an embodiment of the present application, when the control direction is to reduce the nodes, after determining that a running node needs to be deactivated, it is also necessary to determine whether the number of running nodes in the target system is 1; if the number of running nodes in the target system is 1, then if the target system reduces one more running node, the target system will not be able to work. Therefore, when the number of running nodes in the target system is 1, even if it is determined that one running node needs to be reduced, it is prohibited to deactivate the running node.
[0123] The present application also provides a node control device. Figure 4 , which is a structural diagram of a node control device according to an embodiment of the present application.
[0124] The node control device comprises:
[0125] The acquisition module 410 is used to acquire node parameters corresponding to the operating nodes in the target system and to acquire node parameters corresponding to the control nodes in the control direction of the target system.
[0126] The determination module 420 is used to determine the system operation index and the expected operation index corresponding to the target system according to the node parameters corresponding to the operation node and the node parameters corresponding to the control node.
[0127] The updating module 430 is used to update the node control threshold corresponding to the control direction according to the system operation index and the expected operation index.
[0128] The control module 440 is used to control the operation state of the control node in the target system according to the system operation index and the node control threshold corresponding to the control direction.
[0129] The functions of the device described in the embodiment of the present application have been described in the above method embodiment. Therefore, for any details not provided in the description of this embodiment, please refer to the relevant descriptions in the above embodiment and will not be repeated here.
[0130] The present application also provides a node control device, such as Figure 5 , which is a structural diagram of a node control device according to an embodiment of the present application.
[0131] The node control device includes: a processor 510 , a communication interface 520 , a memory 530 and a communication bus 540 . The processor 510 , the communication interface 520 , and the memory 530 communicate with each other via the communication bus 540 .
[0132] The memory 530 is used to store computer programs.
[0133] In one embodiment of the present application, the processor 510, when executing the program stored in the memory 530, implements the node control method provided by any one of the aforementioned method embodiments, including: obtaining node parameters corresponding to the running nodes in the target system and obtaining node parameters corresponding to the control nodes of the target system in the control direction; determining the system operation index and the expected operation index corresponding to the target system according to the node parameters corresponding to the running nodes and the node parameters corresponding to the control nodes; updating the node control threshold corresponding to the control direction according to the system operation index and the expected operation index; controlling the operation state of the control node in the target system according to the system operation index and the node control threshold corresponding to the control direction.
[0134] Among them, the obtaining of node parameters corresponding to the control nodes of the target system in the control direction includes: obtaining node parameters corresponding to the control nodes of the target system in different control directions respectively; the types of control directions include increasing node directions and decreasing node directions; or, determining the control direction corresponding to the target system in a future time period, and obtaining node parameters corresponding to the control nodes of the target system in the determined control direction.
[0135] Among them, the obtaining of the node parameters corresponding to the control nodes of the target system in the control direction includes: when the control direction is the direction of increasing nodes, selecting one of the deactivated nodes in the target system as the control node, and obtaining the node parameters corresponding to the control node; when the control direction is the direction of reducing nodes, selecting one of the running nodes in the target system as the control node, and obtaining the node parameters corresponding to the control node.
[0136] Among them, selecting one of the operating nodes in the target system as the control node includes: selecting the operating node that was most recently enabled among the various operating nodes in the target system as the control node; or selecting the operating node with the largest node operation index among the various operating nodes in the target system as the control node.
[0137] Wherein, the node parameters include: multiple remaining resource values and a weight value corresponding to each of the remaining resource values; determining the system operation index and the expected operation index corresponding to the target system according to the node parameters corresponding to the operating node and the node parameters corresponding to the regulating node includes: determining the system operation index corresponding to the target system according to the multiple remaining resource values corresponding to the operating node and the weight value corresponding to each of the remaining resource values; determining the expected operation index corresponding to the target system according to the multiple remaining resource values corresponding to the operating node and the weight value corresponding to each of the remaining resource values and according to the multiple remaining resource values corresponding to the regulating node and the weight value corresponding to each of the remaining resource values.
[0138] Wherein, updating the node control threshold corresponding to the control direction according to the system operation index and the expected operation index includes: determining the control influence coefficient according to the system operation index and the expected operation index; adding a mapping relationship point corresponding to the system operation index and the control influence coefficient in the preset control mapping relationship data; wherein the control mapping relationship data is used to record the system operation index at each historical time in the control direction and the mapping relationship point corresponding to the control influence system; in the control mapping relationship data, determining the extreme value mapping relationship point in the control direction, and using the system operation index corresponding to the extreme value mapping relationship point as the node control threshold corresponding to the control direction.
[0139] Among them, controlling the operating state of the control node in the target system according to the system operating index and the node control threshold corresponding to the control direction includes: when the control direction is the node increase direction, taking the current time as the time end point, forwardly obtaining each system operating index determined within a preset first time length; in the order of determining time from first to last, comparing and obtaining each system operating index from less than the node control threshold corresponding to the node increase direction to greater than or equal to the node control threshold corresponding to the node increase direction, controlling the operating state of the control node when the system operating index was most recently determined to be enabled; when the control direction is the node reduction direction, taking the current time as the time end point, forwardly obtaining each system operating index determined within a preset second time length; in the order of determining time from first to last, comparing and obtaining each system operating index from greater than the node control threshold corresponding to the node reduction direction to less than or equal to the node control threshold corresponding to the node reduction direction, controlling the operating state of the control node when the system operating index was most recently determined to be disabled.
[0140] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the node control method provided in any of the above method embodiments are implemented. Since the node control method has been described in detail above, for any details not detailed in the description of this embodiment, please refer to the relevant description in the above embodiments, and no further description will be given here.
[0141] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0142] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0143] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0144] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A node control method, characterized in that: include: Obtaining node parameters corresponding to operating nodes in a target system and obtaining node parameters corresponding to control nodes in a control direction of the target system; Determining a system operation index and an expected operation index corresponding to the target system according to the node parameters corresponding to the operation node and the node parameters corresponding to the control node; According to the system operation index and the expected operation index, updating the node control threshold corresponding to the control direction; The operation state of the control node in the target system is controlled according to the system operation index and the node control threshold corresponding to the control direction.
2. The method according to claim 1, characterized in that The obtaining of the node parameters corresponding to the control nodes of the target system in the control direction includes: Obtaining node parameters corresponding to the control nodes of the target system in different control directions; the types of control directions include increasing node directions and decreasing node directions; or, Determine the control direction corresponding to the target system in the future time period, and obtain the node parameters corresponding to the control nodes of the target system in the determined control direction.
3. The method according to claim 1, characterized in that The obtaining of the node parameters corresponding to the control nodes of the target system in the control direction includes: In the case where the control direction is a direction of adding nodes, selecting one of the deactivated nodes in the target system as the control node, and obtaining a node parameter corresponding to the control node; In the case where the control direction is a direction of reducing nodes, one of the running nodes is selected in the target system as the control node, and a node parameter corresponding to the control node is obtained.
4. The method according to claim 3, characterized in that The selecting one of the operating nodes in the target system as the regulating node includes: Among the operating nodes of the target system, select the operating node that was activated most recently as the control node; or, Among the operating nodes of the target system, the operating node with the largest node operating index is selected as the control node.
5. The method according to claim 1, characterized in that The node parameters include: a plurality of remaining resource values and a weight value corresponding to each of the remaining resource values; The determining, according to the node parameters corresponding to the operating nodes and the node parameters corresponding to the regulating nodes, the system operating index and the expected operating index corresponding to the target system comprises: Determining a system operation index corresponding to the target system according to a plurality of remaining resource values corresponding to the operating nodes and a weight value corresponding to each of the remaining resource values; The expected operation index corresponding to the target system is determined according to the multiple remaining resource values corresponding to the operation node and the weight value corresponding to each of the remaining resource values and according to the multiple remaining resource values corresponding to the regulation node and the weight value corresponding to each of the remaining resource values.
6. The method according to claim 1, characterized in that The updating of the node control threshold corresponding to the control direction according to the system operation index and the expected operation index includes: Determining a control influence coefficient according to the system operation index and the expected operation index; In the preset control mapping relationship data, a mapping relationship point corresponding to the system operation index and the control influence coefficient is added; wherein the control mapping relationship data is used to record the mapping relationship point corresponding to the system operation index and the control influence system at each historical time in the control direction; In the control mapping relationship data, an extreme value mapping relationship point in the control direction is determined, and a system operation index corresponding to the extreme value mapping relationship point is used as the node control threshold corresponding to the control direction.
7. The method according to claim 1, characterized in that The controlling the operation state of the control node in the target system according to the system operation index and the node control threshold corresponding to the control direction includes: In the case where the control direction is the direction of increasing nodes, taking the current time as the time end point, obtaining each system operation index determined within the preset first time length; in the order of determining the time from first to last, comparing and obtaining each system operation index from less than the node control threshold corresponding to the direction of increasing nodes to greater than or equal to the node control threshold corresponding to the direction of increasing nodes, controlling the operation state of the control node when the system operation index was determined most recently to be enabled; When the control direction is the direction of reducing nodes, take the current time as the time end point, and obtain the system operation indexes determined within the preset second time length forward; in the order of determined time from first to last, compare and get that each system operation index changes from greater than the node control threshold corresponding to the direction of reducing nodes to less than or equal to the node control threshold corresponding to the direction of reducing nodes, then control the operation state of the control node when the system operation index was determined most recently to be disabled.
8. A node control device, characterized in that: include: An acquisition module, used to acquire node parameters corresponding to operating nodes in a target system and to acquire node parameters corresponding to control nodes in a control direction of the target system; A determination module, used to determine a system operation index and an expected operation index corresponding to the target system according to a node parameter corresponding to the operation node and a node parameter corresponding to the control node; An updating module, configured to update a node control threshold corresponding to the control direction according to the system operation index and the expected operation index; A control module is used to control the operating state of the control node in the target system according to the system operation index and the node control threshold corresponding to the control direction.
9. A node control device, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; At least one memory connected to the at least one bus, wherein the processor is configured to: execute a node control program stored in the memory to implement the node control method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed to implement the node control method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Load balancing method, system and device, and storage medium
CN111966453A
Task-based cluster automation control method
CN117112180A
Resource capacity expansion method and device, equipment and storage medium
CN117149424A
Resource scheduling method and device, equipment, storage medium and product
CN118193123A
Application control method and device, electronic equipment and computer readable storage medium
CN118626204A