Node control method, apparatus, device, and storage medium
By acquiring and calculating node parameters in a distributed system and dynamically updating node control thresholds, the system instability caused by static configuration is resolved, enabling flexible adjustment of the number of nodes and optimized resource utilization, thereby improving system stability and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GREE ELECTRIC APPLIANCE INC OF ZHUHAI
- Filing Date
- 2024-11-25
- Publication Date
- 2026-07-14
AI Technical Summary
In existing technologies, statically configured load balancing methods are prone to instability when dealing with dynamically changing distributed systems due to inappropriate adjustments to the number of nodes, which may lead to resource waste or system crashes.
By acquiring the node parameters of the running nodes and control nodes in the target system, the system operation index and expected operation index are calculated, the node control threshold is dynamically updated, and the operating status of the nodes in the system is controlled to adapt to resource changes and avoid instability caused by fixed thresholds.
It enables dynamic adjustment of the number of nodes based on resource changes, avoiding system instability and improving the stability and resource utilization efficiency of the distributed system.
Smart Images

Figure CN119544531B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a node control method, apparatus, device, and storage medium. Background Technology
[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 across multiple nodes for execution, thereby improving the processing power and reliability of distributed systems. However, this also brings challenges such as complex resource management, difficulty in load balancing, and the need for dynamic expansion.
[0003] In existing technologies, distributed systems primarily manage resources in advance through static configuration, use load balancers for load balancing, and utilize 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 requirements. Currently, distributed systems need to pre-configure fixed thresholds through static configuration. When performing load balancing tasks, the operating metrics of the distributed system are checked. If the operating metrics exceed the pre-configured fixed thresholds, adjustments are made to the distributed system, such as adjusting the number of nodes using operation and maintenance tools.
[0004] However, statically configured load balancing methods are prone to instability in increasingly complex distributed system scenarios due to inappropriate adjustments to the number of nodes. For example, if the distributed system's performance metrics exceed a fixed threshold, the number of nodes will be increased. However, if the fixed threshold is small, frequent increases in the number of nodes will not only waste system resources but also cause system instability due to frequent resource configuration. If the fixed threshold is large, the number of nodes cannot be increased in a timely manner, which will lead to system overload and even system crashes. Summary of the Invention
[0005] This application provides a node control method, apparatus, device, and storage medium to solve the problem that the existing load balancing method based on static configuration is prone to causing instability in the operation of the distributed system due to inappropriate adjustment of the number of nodes.
[0006] To address the aforementioned technical problems, the technical solution of this application is provided through the following embodiments:
[0007] This application provides a node control method, comprising: acquiring node parameters corresponding to running nodes in a target system and acquiring node parameters corresponding to control nodes in the target system in a control direction; determining a system operation index and an expected operation index corresponding to the target system based on the node parameters corresponding to the running nodes and the node parameters corresponding to the control nodes; updating a node control threshold corresponding to the control direction based on the system operation index and the expected operation index; and controlling the operating state of the control nodes in the target system based on the system operation index and the node control threshold corresponding to the control direction.
[0008] The step of obtaining the node parameters corresponding to the control nodes of the target system in the control direction includes: obtaining the node parameters corresponding to the control nodes of the target system in different control directions; the types of control directions include increasing node direction and decreasing node direction; or, determining the control direction of the target system in a future time period, and obtaining the node parameters corresponding to the control nodes of the target system in the determined control direction.
[0009] The step of obtaining the node parameters corresponding to the control node in the control direction of the target system 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 decreasing 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] The step of selecting one of the running nodes in the target system as the control node includes: selecting the most recently activated running node from among the running nodes in the target system as the control node; or selecting the running node with the largest node running index from among the running nodes in the target system as the control node.
[0011] The node parameters include: multiple remaining resource values and a weight value corresponding to each remaining resource value; determining the system operation index and expected operation index of the target system based on the node parameters corresponding to the running node and the node parameters corresponding to the control node includes: determining the system operation index of the target system based on the multiple remaining resource values corresponding to the running node and the weight value corresponding to each remaining resource value; and determining the expected operation index of the target system based on the multiple remaining resource values corresponding to the running node and the weight value corresponding to each remaining resource value, and based on the multiple remaining resource values corresponding to the control node and the weight value corresponding to each remaining resource value.
[0012] The step of updating the node control threshold corresponding to the control direction based on the system operation index and the expected operation index includes: determining the control influence coefficient based on the system operation index and the expected operation index; adding mapping relationship points 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 and the mapping relationship points corresponding to the control influence system at each historical time in the control direction; determining the extreme value mapping relationship points in the control direction in the control mapping relationship data, and using the system operation index corresponding to the extreme value mapping relationship points as the node control threshold corresponding to the control direction.
[0013] The step of controlling the operating state of the control node in the target system based on 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 end point, obtaining each system operating index determined within a preset first time length; comparing each system operating index in the order of the determined time from first to last, and finding that each system operating index changes from being less than the node control threshold corresponding to the node increase direction to being greater than or equal to the node control threshold corresponding to the node increase direction, controlling the operating state of the control node at the time when the system operating index was most recently determined to be enabled; when the control direction is the node decrease direction, taking the current time as the end point, obtaining each system operating index in the order of the determined time from first to last, and comparing each system operating index in the order of the determined time from being greater than the node control threshold corresponding to the node decrease direction to being less than or equal to the node control threshold corresponding to the node decrease direction, controlling the operating state of the control node at the time when the system operating index was most recently determined to be disabled.
[0014] This application provides a node control device, comprising: an acquisition module, configured to acquire node parameters corresponding to running nodes in a target system and node parameters corresponding to control nodes in the control direction of the target system; a determination module, configured to determine a system operation index and an expected operation index corresponding to the target system based on the node parameters corresponding to the running nodes and the node parameters corresponding to the control nodes; an update module, configured to update a node control threshold corresponding to the control direction based on the system operation index and the expected operation index; and a control module, configured to control the operating state of the control nodes in the target system based on the system operation index and the node control threshold corresponding to the control direction.
[0015] This application also provides a node control device, including: 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 the node control method described above.
[0016] This application also provides a computer-readable storage medium storing computer-executable instructions, which are executed to implement the node control method described in any of the preceding claims.
[0017] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application can obtain the node parameters corresponding to the running nodes in the target system and the node parameters corresponding to the control nodes in the control direction of the target system; determine the system operation index and expected operation index of the target system based on the node parameters corresponding to the running nodes and the node parameters corresponding to the control nodes; update the node control threshold corresponding to the control direction based on the system operation index and the expected operation index; and control the operating state of the control nodes in the target system based on the system operation index and the node control threshold corresponding to the control direction. This application can determine the system operation index of the target system and predict the expected operation index after the number of control nodes in the target system is predicted based on the node parameters of the running nodes and the node parameters of the control nodes in the control direction. 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. The node control threshold is updated based on these resource changes. Thus, in the process of continuously adjusting the number of nodes, the node control threshold can be adjusted according to resource changes, avoiding the problem of system instability caused by the inability to adjust the number of nodes in a timely manner when using a fixed threshold. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0021] Figure 1 This is a flowchart of a node control method according to an embodiment of this application;
[0022] Figure 2 This is a flowchart illustrating the steps for determining the system operating index and the expected operating index according to an embodiment of this application;
[0023] Figure 3 This is a flowchart illustrating the steps of updating the node control threshold according to an embodiment of this application;
[0024] Figure 4 This is a structural diagram of a node control device according to an embodiment of this application;
[0025] Figure 5 This is a structural diagram of a node control device according to an embodiment of the present application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0027] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0028] This application provides a node control method. For example... Figure 1 The diagram shown is a flowchart of a node control method according to an embodiment of this application.
[0029] Step S110: Obtain the node parameters corresponding to the running nodes in the target system and obtain the node parameters corresponding to the control nodes in the control direction of the target system.
[0030] The types of target systems include, but are not limited to: distributed systems.
[0031] A running node refers to a node that is currently running within the target system. The types of nodes include, but are not limited to, virtual nodes and physical nodes. Virtual nodes can be virtual machines, such as a microservice system running on a server. Physical nodes can be servers themselves.
[0032] The control direction refers to the direction in which nodes are added or removed from the target system. There are two types of control directions: adding nodes and removing nodes. Adding nodes means increasing the number of running nodes in the target system. Removing nodes means decreasing the number of running nodes in the target system.
[0033] Control nodes refer to nodes in the target system that need to be added or removed.
[0034] Node parameters refer to the remaining resource data of a node. Remaining resource data is the unused resource status of a node, reflecting the operational capacity that the node can still provide.
[0035] In this embodiment, the control direction and the control nodes within that direction can be actively set using operation and maintenance tools or automatically set using control strategies. The method of setting the control direction and control nodes through control strategies will be described later and will not be elaborated upon here.
[0036] Step S120: Determine the system operation index and expected operation index corresponding to the target system based on the node parameters corresponding to the running node and the node parameters corresponding to the control node.
[0037] The system performance index measures the current operational performance of a target system. It reflects the system's health. A higher index indicates more available resources and better performance. Conversely, a lower index indicates fewer available resources and poorer performance.
[0038] The Expected Performance Index (EPI) measures the performance of a target system after adjusting the number of nodes (increasing or decreasing the number of running nodes). The EPI reflects the system's health after adjusting the number of nodes. A higher EPI indicates more available resources and better system performance. Conversely, a lower EPI indicates fewer available resources and poorer system performance.
[0039] In this embodiment, there is a correspondence between the expected operating index and the control direction. Based on the node parameters corresponding to the operating node and the node parameters corresponding to the control node in that control direction, the system operating index corresponding to the target system and the expected operating index corresponding to that control direction are determined.
[0040] Step S130: Update the node control threshold corresponding to the control direction based on 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 number control conditions.
[0042] In this embodiment, there is a correspondence between the control direction and the node control threshold; increasing and decreasing the node direction correspond to different node control thresholds. The node control threshold corresponding to the control direction is updated based on the system operating index of the target system and the expected operating index of the target system in that control direction.
[0043] Step S140: 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.
[0044] In this embodiment, every preset update time interval, the node parameters corresponding to the running node in the target system and the node parameters corresponding to the control node in the control direction of the target system are acquired once. Based on the node parameters corresponding to the running node and the control node acquired this time, the system operation index and expected operation index corresponding to the target system are determined. Furthermore, based on the system operation index and the expected operation index, the node control threshold corresponding to the control direction is updated. Taking the current time as the time end point, each system operation index determined within a preset time length is acquired. Based on the change in the magnitude of each system operation index relative 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 through experiments. The system operation index has been determined at least three times within the preset time length. This includes the most recent (current) system operation index among the at least three determined system operation indices. Of course, the preset time lengths corresponding to different control directions can be different. For example, adding nodes corresponds to the first time length, and reducing nodes corresponds to the second time length; the first and second time lengths may be the same or different.
[0046] Furthermore, each time the node parameters corresponding to the control node in the control direction of the target system are obtained, the control node may be the same or different. This embodiment controls the operating state of the control node in this application.
[0047] Furthermore, when the control direction is the direction of adding nodes, taking the current time as the end point, the system operation indices determined within a preset first time length are obtained backwards. Following the order of the determined times, each system operation index is compared, and if it changes from being less than the node control threshold corresponding to the direction of adding nodes to being greater than or equal to the node control threshold corresponding to the direction of adding nodes, the operating state of the control node at the time of the most recent (current) determination of the system operation index is controlled to be enabled. In other cases, the number of operating nodes in the target system remains unchanged. Here, the determination time refers to the time when the system operation index is determined. Enabling means switching the control node to an operating node, i.e., a node used to process business traffic.
[0048] Furthermore, when the control direction is to reduce the number of nodes, taking the current time as the end point, the system operation indices determined within a preset second time length are obtained backwards. Following the order of the determined times, the system operation indices are compared. If each system operation index changes from being greater than the node control threshold corresponding to the node reduction direction to being less than or equal to the node control threshold corresponding to the node reduction direction, the operating state of the control node at the time of the most recent (current) determination of the system operation index is controlled to be disabled. In other cases, the number of operating nodes in the target system remains unchanged. Disabling means switching the control node to a disabled node, i.e., a node that does not handle business traffic.
[0049] In this embodiment, node parameters corresponding to the running nodes in the target system and node parameters corresponding to the control nodes in the control direction of the target system are obtained. Based on the node parameters corresponding to the running nodes and the control nodes, the system operation index and expected operation index of the target system are determined. Based on the system operation index and the expected operation index, the node control threshold corresponding to the control direction is updated. Based on the system operation index and the node control threshold corresponding to the control direction, the operating state of the control nodes in the target system is controlled. This embodiment determines the system operation index of the target system and predicts the expected operation index after the number of control nodes in the target system is increased based on the node parameters of the running nodes and the control nodes in the control direction. The system operation index and the expected operation index reflect the resource changes that the number of control nodes can bring to the target system. The node control threshold is updated based on these resource changes. Thus, during the continuous adjustment of the number of nodes, the node control threshold can be adjusted according to resource changes, avoiding the system instability caused by using a fixed threshold that cannot adjust the number of nodes in a timely manner.
[0050] To make the embodiments of this application easier to understand, the node control method of the embodiments of this application will be further described below.
[0051] The following section further describes how to obtain the node parameters corresponding to the running node and the node parameters corresponding to the control node.
[0052] The node parameters include: multiple 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 value and weight value corresponding to each of the multiple resource types.
[0053] Resource types include, but are not limited to: memory, CPU (Central Processing Unit), and disk.
[0054] Furthermore, there can be multiple running nodes and only one control node. For each running node (or control node), the following steps can be performed: Query the resource usage values corresponding to multiple resource types for that running node, such as the node's current memory usage, CPU utilization, and disk utilization; calculate the remaining resource value for each resource type using its corresponding resource limit, thus obtaining multiple remaining resource values for that running node. The resource limit is the maximum value that can be used. For example, if the current memory usage is 0.5 and the memory limit is 1, then the remaining memory value is 0.5. Alternatively, the remaining memory value can be directly expressed as 1 - 0.5 (i.e., 1 minus 0.5). A weight value is pre-set for each resource type. When obtaining the remaining resource value for each resource type of the running node (or control node), the weight value for each resource type can be obtained, thus yielding the remaining resource value and weight value for multiple resource types.
[0055] Since the control node is related to the control direction, the following section will further describe how to determine the control direction and control node of the target system, as well as the process of obtaining the node parameters corresponding to the control node in the control direction of the target system.
[0056] In this embodiment, 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; first, we will describe how to determine the control direction and how to obtain the node parameters corresponding to the control node in the control direction.
[0057] Specifically, one approach can be adopted: obtaining the 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, another approach can be adopted: determining the control direction of the target system in a future time period, and obtaining the node parameters corresponding to the control nodes of the target system in the determined control direction.
[0058] Regarding method one, both control directions can be taken into account. The node parameters corresponding to the control nodes in the direction of increasing nodes of the target system can be obtained, and the node parameters corresponding to the control nodes in the direction of decreasing nodes of the target system can also be obtained.
[0059] Furthermore, using Method 1 eliminates the need to determine which specific control direction is being followed. Node control can be executed separately for both the direction of adding and removing nodes, as shown in the following steps:
[0060] Step S1: Obtain the node parameters corresponding to the running nodes in the target system, as well as the node parameters corresponding to the control nodes in the direction of increasing nodes and decreasing nodes in the target system.
[0061] Step S2: Determine the system operation index corresponding to the target system based on the node parameters corresponding to the running node.
[0062] Steps S3 and S4 are parallel steps.
[0063] Step S3: Determine the expected operating index of the target system in the direction of the added node based on the node parameters corresponding to the running node and the node parameters corresponding to the control node in the direction of the added node; update the node control threshold in the direction of the added node based on the system operating index and the expected operating index in the direction of the added node; control the operating state of the control node in the direction of the added node in the target system based on the system operating index and the node control threshold in the direction of the added node.
[0064] Step S4: Determine the expected operating index of the target system in the direction of reducing nodes based on the node parameters corresponding to the running nodes and the node parameters corresponding to the control nodes in the direction of reducing nodes; update the node control threshold in the direction of reducing nodes based on the system operating index and the expected operating index in the direction of reducing nodes; control the operating state of the control nodes in the direction of reducing nodes in the target system based on the system operating index and the node control threshold in the direction of reducing nodes.
[0065] Since the system operating index of the target system is the same at the same time point, but the node control thresholds corresponding to the direction of increasing nodes and the direction of decreasing nodes are different, there will be no problem of both increasing the number of nodes and decreasing the number of nodes in the target system at the same time point. Therefore, there will be no conflict in taking into account the two control directions.
[0066] For method two, the control direction of the target system in the future time period can be received and determined, which is either the direction of adding nodes or the direction of reducing nodes; based on the control direction of the target system in the future time period, the node parameters corresponding to the control nodes in the target system can be obtained.
[0067] The starting point for a future time period can be the present time or some other future time.
[0068] For example, if a traffic peak is anticipated in the near future, an early warning notification can be issued, including the control direction and the control period (future time period). After receiving the early warning notification, the control direction for the target system in the future time period can be determined.
[0069] Regarding method two, the expected traffic data of the target system in a preset future time period can be predicted based on the historical traffic data of the target system; by comparing the current traffic data of the target system with the expected traffic data, the control direction of the target system in the future time period can be determined, which is either the direction of adding nodes or the direction of reducing nodes; based on the control direction of the target system in the future time period, the node parameters corresponding to the control nodes in the target system can be obtained.
[0070] Historical traffic data refers to traffic data over a historical period. The specific type of traffic data can be determined based on requirements. For example, historical traffic data might be the number of visits. The endpoint of the historical time period can be the current time or a time prior to the current time.
[0071] Projected traffic data refers to traffic data for a future time period.
[0072] Current traffic data refers to traffic data at the current point in time.
[0073] When the projected traffic volume is less than the current traffic volume, the control direction for the corresponding future time period is determined to be reducing the number of nodes. When the projected traffic volume is greater than or equal to the current traffic volume, the control direction for the corresponding future time period is determined to be increasing the number of nodes.
[0074] Furthermore, a traffic prediction model can be pre-trained, enabling it to predict expected traffic data for future time periods. After the traffic prediction model is trained, historical traffic volumes are input into the model to obtain the expected traffic data output by the model.
[0075] In the embodiments of this application, the methods for determining the control node differ depending on the control direction.
[0076] When the control direction is to increase the number of nodes, one of the disabled nodes in the target system is selected as the control node, and the node parameters corresponding to the control node are obtained. Here, a disabled node refers to a node that is not currently in use 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. Alternatively, a disabled node with matching remaining resource data can be selected as the control node based on the projected traffic data for a future time period to cope with future traffic. For example, if future traffic surges, a disabled node with a larger amount of remaining resources can be selected as the control node.
[0077] When the control direction is to reduce the number of nodes, one of the running nodes in the target system is selected as the control node, and the node parameters corresponding to the control node are obtained.
[0078] Further, selecting one of the operating nodes in the target system as the control node includes: selecting the most recently activated operating node among all the operating nodes in the target system as the control node; or, selecting the operating node with the largest node operation index among all the operating nodes in the target system as the control node.
[0079] In this context, since the earlier activated nodes have already handled a significant amount of traffic, while the most recently activated nodes have just begun handling traffic, deactivating the most recently activated node will have a relatively small impact on the target system. Therefore, the most recently activated node can be selected as the control node. The system operation index reflects the available resources of a node. A higher system operation index indicates more remaining resources, meaning the node is handling less traffic. Therefore, even deactivating the node with the highest system operation index will have a relatively small impact on the target system.
[0080] In this embodiment of the application, after obtaining the node parameters corresponding to the running node and the node parameters corresponding to the control node, the system operation index and expected operation index corresponding to the target system can be determined.
[0081] The process of determining the system operating index and the expected operating index is described below.
[0082] like Figure 2 The diagram shown is a flowchart illustrating the steps for determining the system operating index and the expected operating index according to an embodiment of this application.
[0083] Step S210: Determine the system operation index corresponding to the target system based on the multiple remaining resource values corresponding to the running node and the weight value corresponding to each remaining resource value.
[0084] In the target system, there can be multiple running nodes. For each running node, the node running index is determined based on the multiple remaining resource values corresponding to that running node and the weight value corresponding to each remaining resource value. Based on the node running indices corresponding to the multiple running nodes, the system running index corresponding to the target system is determined.
[0085] The node performance index measures a node's operational performance. It reflects the node's system health. A higher node performance index indicates more available resources and better performance. Conversely, a lower index indicates fewer available resources and poorer performance.
[0086] Furthermore, the node operation index corresponding to the running node can be determined using 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 The node running index corresponds to the i-th running node; 'a' represents the weight value corresponding to the first resource type; 1-α i This represents the remaining resource value corresponding to the first resource type of the i-th running node, where 1 indicates that the resource ceiling value corresponding to the first resource type is 1; b represents the weight value corresponding to the second resource type; 1-β i This represents the remaining resource value corresponding to the second resource type of the i-th running node, where 1 indicates that the resource ceiling value corresponding to the second resource type is 1; v-γ i This represents the remaining resource value corresponding to the third resource type of the i-th running node, where v represents the upper limit of the resource corresponding to the third resource type. The weight of the third resource type is 1. For example, the first resource type corresponds to CPU utilization, the second resource type corresponds to memory usage, and the third resource type corresponds to disk access speed.
[0089] Furthermore, the sum of the node operating indices corresponding to multiple operating nodes can be calculated, and this sum can be determined as the system operating index corresponding to the target system. For example, the system operating index corresponding to the target system can be determined using the following formula:
[0090]
[0091] Where 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: Determine the expected operating index of the target system based on the multiple remaining resource values corresponding to the running node and the weight value corresponding to each remaining resource value, and based on the multiple remaining resource values corresponding to the control node and the weight value corresponding to each remaining resource value.
[0093] The above steps can be used as a reference to calculate the node operation index corresponding to the control node based on the multiple remaining resource values corresponding to the control node and the weight value corresponding to each remaining resource value; and to calculate the expected operation index corresponding to the target system based on 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 number of nodes, the sum of the node operating indices corresponding to multiple operating nodes and the node operating indices corresponding to the control node can be calculated, and this sum can be used as the expected operating index of the target system. For example, considering the control node as an operating node, the system operating index corresponding to the target system can be determined using the following formula:
[0095]
[0096] Where f(k+1) represents the expected operating index of the target system, and k+1 is the number of operating nodes (including the number of control nodes and sampled in the same way as the operating nodes to calculate the node operating index of the control nodes).
[0097] Furthermore, when the control direction is to reduce the number of nodes, the sum of the node operating indices corresponding to the multiple operating nodes after reducing the control nodes can be calculated, and this sum can be used as the expected operating index of the target system. For example, the system operating index corresponding to the target system can be determined using the following formula:
[0098]
[0099] Where f(k-1) represents the expected operating index of the target system, and k-1 is the number of operating nodes after reducing the number of control nodes (the control nodes are the nodes selected from the operating nodes).
[0100] After determining the system operating index and the expected operating index, the node control threshold corresponding to the control direction can be updated based on the system operating index and the expected operating index. The process of updating the node control threshold is described below. If this embodiment of the application performs node control only for one control direction, the following steps can be performed directly. If this embodiment of the application performs node control for two control directions respectively, the following steps need to be performed for each control direction separately.
[0101] like Figure 3 The diagram shown is a flowchart of the steps for adjusting the threshold of the updated node according to an embodiment of this application.
[0102] Step S310: Determine the control impact coefficient based on the system operation index and the expected operation index.
[0103] The regulation impact coefficient is used to measure the impact of the number of regulation nodes on the target system.
[0104] Furthermore, the difference between the system operating index and the expected operating 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 operating node and the resource loss brought to the target system by reducing an operating node.
[0105] When the control direction is to increase the number of nodes, the control impact coefficient can reflect the degree of load reduction (resource gain) of the target system after increasing the number of running nodes. The larger the control impact coefficient, the greater the load reduction of the target system after increasing the number of running nodes; the smaller the control impact coefficient, the smaller the load reduction of the target system after increasing the number of running nodes.
[0106] When the control direction is to reduce the number of nodes, the control effect on the system can reflect the degree of load increase (resource loss) of the target system after reducing the number of running nodes. The larger the control effect coefficient, the greater the increase in load of the target system after reducing the number of running nodes; the smaller the control effect coefficient, the smaller the increase in load of the target system after reducing the number of running nodes.
[0107] Step S320: In the preset control mapping relationship data, add mapping relationship points corresponding to the system operation index and the control influence coefficient; wherein, the control mapping relationship data is used to record the system operation index and the mapping relationship points corresponding to the control influence system at each historical time in the control direction.
[0108] The regulation mapping relationship data can be two-dimensional coordinate data. The mapping relationship point is a discrete point in the two-dimensional coordinate data. The horizontal axis represents the system operation index corresponding to the mapping relationship point, and the vertical axis represents the regulation 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 running node in the target system and the node parameters corresponding to the control node in the control direction of the target system can be obtained every preset recording time period. Based on the node parameters corresponding to the running node and the node parameters corresponding to the control node, the system operation index and expected operation index of the target system are determined. Furthermore, based on the system operation index and the expected operation index, the control influence coefficient is determined. In this way, every preset recording time period, a new mapping relationship point with the system operation index on the horizontal axis and the control influence coefficient on the vertical axis can be added to the control mapping relationship data corresponding to the control direction. The time interval between two adjacent historical times is the length of the recording time period. The length of the recording time period can be equal to the length of the update time period.
[0110] Step S330: In the control mapping relationship data, determine the extreme value mapping relationship point in the control direction, and use the system operation index corresponding to the extreme value mapping relationship point as the node control threshold corresponding to the control direction.
[0111] Extreme value mapping relationship points refer to the peak mapping relationship point with the largest vertical coordinate (largest regulatory influence coefficient) and the valley mapping relationship point with the smallest vertical coordinate value (smallest regulatory influence coefficient) in the regulatory mapping relationship data.
[0112] When the control direction is the direction of increasing nodes, the slope value corresponding to each mapping point is determined in the control mapping relationship data, and the peak mapping relationship point in the control direction is determined based on 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 can be the tangent slope value of the mapping relationship point.
[0114] Furthermore, following the order of system operating indices from largest to smallest, the mapping points are connected, simulating each mapping point as a curve, and the slope value corresponding to each mapping point is determined based on this curve. After determining the slope value for each mapping point, the mapping point where the slope value changes from positive to negative is identified, and this mapping point is designated as the peak mapping point. If there are multiple mapping points where the slope value changes from positive to negative, the mapping point with the largest regulatory influence coefficient is selected as the peak mapping point.
[0115] The peak mapping point is the point where adding more running nodes to the target system yields the maximum resource gain. In other words, adding a running node at this peak mapping point maximizes the load reduction and performance improvement of the target system. Using this point as a reference, adding running nodes to the target system ensures optimal performance and avoids the problem of blindly adding nodes without reducing the load. Because of this property of the peak mapping point, the system operating index corresponding to the peak mapping point can be used as the node control threshold for the direction of node addition.
[0116] When the control direction is to reduce the number of nodes, the slope value corresponding to each mapping point is determined in the control mapping relationship data, and the valley mapping relationship point in the control direction is determined based on 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 reduction of nodes direction.
[0117] Furthermore, following the ascending order of the system operating index, the mapping points are connected, simulating each mapping point as a curve, and the slope value corresponding to each mapping point is determined based on this curve. After determining the slope value for each mapping point, the mapping point where the slope value changes from negative to positive is identified, and this mapping point is designated as the valley value mapping point. If there are multiple mapping points where the slope value changes from negative to positive, the mapping point with the smallest regulatory influence coefficient is designated as the valley value mapping point.
[0118] The valley value mapping point represents the point where reducing the number of running nodes in the target system results in the minimum resource loss. In other words, removing one running node at this valley value mapping point minimizes the increase in load and the performance degradation of the target system. Using this point as a reference, reducing running nodes in the target system can ensure relatively stable performance, avoiding resource shortages and overload problems caused by blindly reducing the number of running nodes. Because of this property of the valley value mapping point, the system operating index corresponding to the valley value mapping point can be used as the node control threshold corresponding to the direction of node reduction.
[0119] After determining the node control threshold corresponding to the control direction, the operating state of the control node in the target system can be controlled based on the system operating index and the node control threshold corresponding to the control direction. The process of controlling the operating state of the control node is described below.
[0120] When the control direction is the increase of nodes, taking the current time as the end point, the system operation indices determined within a preset first time length are obtained backwards. Following the order of the determined times, the system operation indices are compared. If each system operation index changes from being less than the node control threshold corresponding to the increase of nodes to being greater than or equal to the node control threshold corresponding to the increase of nodes, the operating state of the control node at the time the system operation index was most recently determined is enabled. Further, if each system operation index changes from being less than the node control threshold corresponding to the increase of nodes to being greater than or equal to the node control threshold corresponding to the increase of nodes, it indicates that the trend of each system operation index is gradually increasing. During this gradual increase, if the system operation index is less than the node control threshold, it means that increasing the number of operating nodes can increase the resource gain of the target system, but fails to reach the maximum resource gain. When the system operation index gradually increases to be greater than or equal to the node control threshold, it means that increasing the number of operating nodes can not only increase the resource gain of the target system, but also reach or even exceed the maximum resource gain. At this point, truly increasing the number of operating nodes can more effectively reduce the load on the target system and improve its performance.
[0121] When the control direction is to reduce the number of nodes, taking the current time as the end point, the system operation indices determined within a preset second time length are obtained backward. Following the order of the determined times, the system operation indices are compared. If each system operation index changes from being greater than the node control threshold corresponding to the reduction direction to being less than or equal to the node control threshold corresponding to the reduction direction, the operating state of the control node at the time the system operation index was most recently determined is controlled to be disabled. Further, if each system operation index changes from being greater than the node control threshold corresponding to the reduction direction to being less than or equal to the node control threshold corresponding to the reduction direction, it indicates that the system operation index is gradually decreasing. During this gradual decrease, if the system operation index is greater than the node control threshold, it means that reducing the number of operating nodes can reduce the resource loss of the target system, but fails to reach the minimum resource loss. When the system operation index gradually decreases to less than or equal to the node control threshold, it means that reducing the number of operating nodes can not only reduce the resource loss of the target system, but also reach or even exceed the minimum resource loss. At this point, truly reducing the number of operating nodes can optimize the resource utilization of the target system and avoid resource waste.
[0122] In this embodiment of the application, when the control direction is to reduce the number of nodes, after determining that a running node needs to be disabled, 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 another 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 a running node needs to be reduced, it is prohibited to disable the running node.
[0123] This application also provides a node control device. For example... Figure 4 The diagram shown is a structural diagram of a node control device according to an embodiment of this application.
[0124] The node control device includes:
[0125] The acquisition module 410 is used to acquire the node parameters corresponding to the running nodes in the target system and the 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 expected operation index of the target system based on the node parameters corresponding to the running node and the node parameters corresponding to the control node.
[0127] The update module 430 is used to update the node control threshold corresponding to the control direction based on the system operation index and the expected operation index.
[0128] The control module 440 is used to control 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.
[0129] The functions of the apparatus described in this application embodiment have been described in the above method embodiments. Therefore, for any parts not detailed in the description of this embodiment, please refer to the relevant descriptions in the foregoing embodiments, which will not be repeated here.
[0130] This application also provides a node control device, such as... Figure 5 The diagram shown is a structural diagram of a node control device according to an embodiment of this 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, communication interface 520, and memory 530 communicate with each other via the communication bus 540.
[0132] Memory 530 is used to store computer programs.
[0133] In one embodiment of this application, when the processor 510 executes a program stored in the memory 530, it implements the node control method provided in any of the foregoing method embodiments, including: obtaining node parameters corresponding to running nodes in the target system and obtaining node parameters corresponding to control nodes in the control direction of the target system; determining a system operating index and an expected operating index corresponding to the target system based on the node parameters corresponding to the running nodes and the node parameters corresponding to the control nodes; updating a node control threshold corresponding to the control direction based on the system operating index and the expected operating index; and controlling the operating state of the control node in the target system based on the system operating index and the node control threshold corresponding to the control direction.
[0134] The step of obtaining the node parameters corresponding to the control nodes of the target system in the control direction includes: obtaining the node parameters corresponding to the control nodes of the target system in different control directions; the types of control directions include increasing node direction and decreasing node direction; or, determining the control direction of the target system in a future time period, and obtaining the node parameters corresponding to the control nodes of the target system in the determined control direction.
[0135] The step of obtaining the node parameters corresponding to the control node in the control direction of the target system 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 decreasing 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] The step of selecting one of the running nodes in the target system as the control node includes: selecting the most recently activated running node from among the running nodes in the target system as the control node; or selecting the running node with the largest node running index from among the running nodes in the target system as the control node.
[0137] The node parameters include: multiple remaining resource values and a weight value corresponding to each remaining resource value; determining the system operation index and expected operation index of the target system based on the node parameters corresponding to the running node and the node parameters corresponding to the control node includes: determining the system operation index of the target system based on the multiple remaining resource values corresponding to the running node and the weight value corresponding to each remaining resource value; and determining the expected operation index of the target system based on the multiple remaining resource values corresponding to the running node and the weight value corresponding to each remaining resource value, and based on the multiple remaining resource values corresponding to the control node and the weight value corresponding to each remaining resource value.
[0138] The step of updating the node control threshold corresponding to the control direction based on the system operation index and the expected operation index includes: determining the control influence coefficient based on the system operation index and the expected operation index; adding mapping relationship points 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 and the mapping relationship points corresponding to the control influence system at each historical time in the control direction; determining the extreme value mapping relationship points in the control direction in the control mapping relationship data, and using the system operation index corresponding to the extreme value mapping relationship points as the node control threshold corresponding to the control direction.
[0139] The step of controlling the operating state of the control node in the target system based on 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 end point, obtaining each system operating index determined within a preset first time length; comparing each system operating index in the order of the determined time from first to last, and finding that each system operating index changes from being less than the node control threshold corresponding to the node increase direction to being greater than or equal to the node control threshold corresponding to the node increase direction, controlling the operating state of the control node at the time when the system operating index was most recently determined to be enabled; when the control direction is the node decrease direction, taking the current time as the end point, obtaining each system operating index in the order of the determined time from first to last, and comparing each system operating index in the order of the determined time from being greater than the node control threshold corresponding to the node decrease direction to being less than or equal to the node control threshold corresponding to the node decrease direction, controlling the operating state of the control node at the time when the system operating index was most recently determined to be disabled.
[0140] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the node control method provided in any of the foregoing method embodiments. Since the node control method has already been described in detail above, any omissions in this embodiment's description can be found in the relevant descriptions in the foregoing embodiments, and will not be repeated here.
[0141] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0142] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0143] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0144] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A node control method, characterized in that, include: Obtain the node parameters corresponding to the running nodes in the target system and obtain the node parameters corresponding to the control nodes in the control direction of the target system; Based on the node parameters corresponding to the running 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; wherein, the system operation index is used to measure the current operating performance of the target system; the expected operation index is used to measure the operating performance of the target system after the number of control nodes is increased; The node control threshold corresponding to the control direction is updated based on the system operation index and the expected operation index; wherein, the node control threshold is used to measure whether the target system meets the node number control condition; the step of updating the node control threshold corresponding to the control direction based on the system operation index and the expected operation index includes: determining the control influence coefficient based on 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 and the mapping relationship point corresponding to the control influence system at each historical time in the control direction; 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; The operating state of the control node in the target system is controlled based on 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 step of obtaining the node parameters corresponding to the control node in the control direction of the target system includes: Obtain the 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 of the target system in a 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 step of obtaining the node parameters corresponding to the control node in the control direction of the target system includes: When the control direction is to increase the number of nodes, one of the deactivated nodes in the target system is selected as the control node, and the node parameters corresponding to the control node are obtained. When the control direction is to reduce the number of nodes, one of the running nodes in the target system is selected as the control node, and the node parameters corresponding to the control node are obtained.
4. The method according to claim 3, characterized in that, Selecting one of the running nodes in the target system as the control node includes: Among the various operating nodes of the target system, the operating node that was most recently enabled is selected as the control node; or... Among the various 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: multiple remaining resource values and a weight value corresponding to each remaining resource value; The step of determining the system operation index and expected operation index corresponding to the target system based on the node parameters corresponding to the running node and the node parameters corresponding to the control node includes: The system operation index corresponding to the target system is determined based on the multiple remaining resource values corresponding to the running node and the weight value corresponding to each remaining resource value; Based on the multiple remaining resource values corresponding to the running nodes and the weight value corresponding to each of the remaining resource values, and based on the multiple remaining resource values corresponding to the control nodes and the weight value corresponding to each of the remaining resource values, the expected operating index corresponding to the target system is determined.
6. The method according to claim 1, characterized in that, The step of controlling the operating state of the control node in the target system based on the system operating index and the node control threshold corresponding to the control direction includes: When the control direction is the direction of adding nodes, with the current time as the end point, obtain the system operation indexes determined within a preset first time length; according to the order of the determined time from first to last, compare and find that when each system operation index changes from less than the node control threshold corresponding to the direction of adding nodes to greater than or equal to the node control threshold corresponding to the direction of adding nodes, control the operation state of the control node at the time when the system operation index was most recently determined to be enabled. When the control direction is the direction of reducing nodes, with the current time as the end point, obtain the system operation indices determined within a preset second time length. According to the order of the determined times, compare and find that when each system operation index changes from being greater than the node control threshold corresponding to the direction of reducing nodes to being less than or equal to the node control threshold corresponding to the direction of reducing nodes, control the operation state of the control node at the time when the system operation index was most recently determined to be disabled.
7. A node control device, characterized in that, include: The acquisition module is used to acquire the node parameters corresponding to the running nodes in the target system and the node parameters corresponding to the control nodes in the control direction of the target system. The determination module is used to determine the system operation index and expected operation index of the target system based on the node parameters corresponding to the running node and the node parameters corresponding to the control node; wherein, the system operation index is used to measure the current operating performance of the target system; and the expected operation index is used to measure the operating performance of the target system after the number of control nodes is increased. An update module is used to update the node control threshold corresponding to the control direction based on the system operating index and the expected operating index; wherein, the node control threshold is used to measure whether the target system meets the node number control condition; the step of updating the node control threshold corresponding to the control direction based on the system operating index and the expected operating index includes: determining the control influence coefficient based on the system operating index and the expected operating index; adding a mapping relationship point corresponding to the system operating 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 operating index and the mapping relationship point corresponding to the control-affected system at each historical time in the control direction; determining the extreme value mapping relationship point in the control direction in the control mapping relationship data, and using the system operating index corresponding to the extreme value mapping relationship point as the node control threshold corresponding to the control direction; The control module is used to control the operating status of the control node in the target system based on the system operation index and the node control threshold corresponding to the control direction.
8. 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 of any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which are executed to implement the node control method according to any one of claims 1-6.