Task scheduling method, information processing method, device, equipment and storage medium
By receiving and querying the request information of the network service component and determining the target proxy process component, the resource utilization problem of the cloud computing load balancer after the proxy process component is down is solved, and the high availability and resource optimization of the load balancer are achieved.
Patent Information
- Application Number
- CN202110127451.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-29
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-01-29
AI Technical Summary
After the agent process component of the existing cloud computing load balancer deployment solution is down, the load balancer cannot perform addition, deletion, and modification operations, resulting in unbalanced or low utilization of system resources.
By receiving the request information from the network service component, querying the working status and evaluation value of the agent process component, and determining the target agent process component, it ensures the high availability and resource utilization of the load balancer.
It realizes the rapid allocation of appropriate agent process components when the agent process component goes down, ensures the high availability of the load balancer, and optimizes the utilization of server resources.
Smart Images

Figure CN114816724B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing, and in particular to a task scheduling method, an information processing method, a device, a equipment and a storage medium. Background Art
[0002] Currently, elastic load balancers based on cloud computing services are favored by the majority of users and are widely used because of their flexible and scalable deployment mode and large-traffic distribution functional characteristics.
[0003] However, in the existing deployment scheme, once the proxy process component goes down, the existing load balancer of the server to which the proxy process component belongs will not be able to be added, deleted, or modified for a certain period of time, that is, the server loses the right to operate these load balancers. Even if an available proxy process component is randomly assigned, there is still the problem of uneven or low utilization of system resources due to uneven deployment and scheduling of the load balancer. Summary of the invention
[0004] Embodiments of the present invention are intended to provide a task scheduling method, an information processing method, an apparatus, a device, and a storage medium.
[0005] The technical solution of the present invention is achieved in this way:
[0006] A first aspect of an embodiment of the present invention provides a task scheduling method, the method comprising: receiving request information sent by a network service component for creating a load balancer or for updating the configuration of a first load balancer;
[0007] Based on the request information, query the pre-collected information to obtain the query result; the pre-collected information includes the working status of at least one proxy process component and the evaluation value of the server corresponding to each proxy process component; the evaluation value represents the comprehensive utilization rate of multiple types of resources of the server where the proxy process component is located;
[0008] Based on the query result, determining a target agent process component from the at least one agent process component;
[0009] Based on the target proxy process component, a load balancer is created or the configuration of the first load balancer is updated.
[0010] Optionally, when the request information is used to create a load balancer, querying the pre-collected information based on the request information includes:
[0011] Based on the request information, the working state information and identification information of the agent process component of each server in at least one server and the evaluation value corresponding to each of the agent process components are queried.
[0012] Optionally, when the request information is used to update the configuration of the first load balancer, querying the pre-collected information based on the request information includes:
[0013] Querying the working status of the first proxy process component to which the first load balancer belongs based on the request information;
[0014] If the working state of the first agent process component is in an abnormal state, query the working states and identification information of other agent process components except the first agent process component, and the evaluation values corresponding to the other agent process components.
[0015] Optionally, determining a target proxy process component from the at least one proxy process component based on the query result includes:
[0016] From the proxy process components whose working status is in a normal state, determine the proxy process component with the highest evaluation value as the target proxy process component.
[0017] Optionally, determining a target proxy process component from the at least one proxy process component based on the query result includes:
[0018] If the working state of the first proxy process component to which the first load balancer belongs is normal, determining the first proxy process component as the target proxy process component;
[0019] If the working state of the first agent process component is in an abnormal state, the agent process component with the highest evaluation value is determined from other agent process components in normal working states and is determined as the target agent process component.
[0020] Optionally, creating a load balancer based on the target proxy process component includes:
[0021] A first instruction for creating a load balancer is sent to the target proxy process component, where the first instruction is used by the target proxy process component to create a load balancer.
[0022] Optionally, when the working state of the first proxy process component is in an abnormal state, updating the configuration of the first load balancer based on the target proxy process component includes:
[0023] A second instruction for updating the configuration of the first load balancer is sent to the target proxy process component, where the second instruction is used by the target proxy process component to remotely execute the configuration update of the first load balancer belonging to the first proxy process component based on pre-configured information.
[0024] A second aspect of an embodiment of the present invention provides an information processing method, which is applied to an agent process component, wherein the agent process component is deployed in a server, and the method includes:
[0025] Obtaining usage information of multiple types of resources of the server;
[0026] Determine the evaluation value of the server based on the usage information of each type of resource and the weight corresponding to each type of resource; the evaluation value represents the comprehensive utilization rate of multiple types of resources of the server;
[0027] The rating value is sent to the load balancing component.
[0028] Optionally, determining the evaluation value of the server based on the usage information of each type of resources and the weight corresponding to each type of resources includes:
[0029] Obtain multiple sets of resource usage information of the server, and determine average usage information of each type of resource based on the multiple sets of resource usage information; each set of resource usage information includes multiple of the following resource types: central processing unit CPU usage, memory usage, disk usage, network card traffic, and the number of load balancers created in the server;
[0030] According to the preset data interval corresponding to each type of resource, determine the score corresponding to the average usage information of each type of resource;
[0031] Based on the corresponding score of each type of resource and the corresponding weight of each type of resource, the evaluation value of the server is determined.
[0032] A third aspect of an embodiment of the present invention provides a task scheduling device, the device comprising a receiving module, a query module, a first determining module and a processing module, wherein:
[0033] The receiving module is used to receive request information sent by the network service component for creating a load balancer or for updating the configuration of the first load balancer;
[0034] The query module is used to query the pre-collected information based on the request information to obtain the query result; the pre-collected information includes the working status of at least one proxy process component and the evaluation value of the server corresponding to each proxy process component; the evaluation value represents the comprehensive utilization rate of multiple types of resources of the server where the proxy process component is located;
[0035] The first determining module is used to determine a target proxy process component from the at least one proxy process component based on the query result;
[0036] The processing module is used to create a load balancer or update the configuration of the first load balancer based on the target proxy process component.
[0037] Optionally, the query module is specifically used to:
[0038] Based on the request information, the working state information and identification information of the agent process component of each server in at least one server and the evaluation value corresponding to each of the agent process components are queried.
[0039] Optionally, the query module is further used to:
[0040] Querying the working status of the first proxy process component to which the first load balancer belongs based on the request information;
[0041] If the working state of the first agent process component is in an abnormal state, query the working states and identification information of other agent process components except the first agent process component, and the evaluation values corresponding to the other agent process components.
[0042] Optionally, the first determining module is specifically configured to:
[0043] From the proxy process components whose working status is in a normal state, determine the proxy process component with the highest evaluation value as the target proxy process component.
[0044] Optionally, the first determining module is further configured to:
[0045] If the working state of the first proxy process component is normal, determining the first proxy process component as a target proxy process component;
[0046] If the working state of the first agent process component is in an abnormal state, the agent process component with the highest evaluation value is determined from the other agent process components whose working states are in normal states and is determined as the target agent process component.
[0047] Optionally, the processing module is specifically used for:
[0048] A first instruction for creating a load balancer is sent to the target proxy process component, where the first instruction is used by the target proxy process component to create a load balancer.
[0049] Optionally, the processing module is also specifically used to: send a second instruction for updating the configuration of the first load balancer to the target proxy process component, and the second instruction is used by the target proxy process component to remotely execute the configuration update of the first load balancer belonging to the first proxy process component based on pre-configured information.
[0050] A fourth aspect of an embodiment of the present invention provides an information processing device, which is applied to an agent process component, wherein the agent process component is deployed in a server, and the device includes an acquisition module, a second determination module, and a sending module, wherein:
[0051] The acquisition module is used to acquire usage information of multiple types of resources of the server;
[0052] The second determination module is used to determine the evaluation value of the server based on the usage information of each type of resources and the weight corresponding to each type of resources; the evaluation value represents the comprehensive utilization rate of multiple types of resources of the server;
[0053] The sending module is used to send the evaluation value to the load balancing component.
[0054] Optionally, the second determining module is specifically configured to:
[0055] Obtain multiple sets of resource usage information of the server, and determine average usage information of each type of resource based on the multiple sets of resource usage information; each set of resource usage information includes multiple of the following resource types: central processing unit CPU usage, memory usage, disk usage, network card traffic, and the number of load balancers created in the server;
[0056] According to the preset data interval corresponding to each type of resource, determine the score corresponding to the average usage information of each type of resource;
[0057] Based on the corresponding score of each type of resource and the corresponding weight of each type of resource, the evaluation value of the server is determined.
[0058] A fifth aspect of an embodiment of the present invention provides a task scheduling device, the task scheduling device comprising a memory and a processor, wherein the memory stores instructions;
[0059] The processor is used to execute instructions stored in the memory, and when the instructions are executed by the processor, the steps of any one of the methods described in the first aspect are implemented.
[0060] A sixth aspect of an embodiment of the present invention provides an information processing device, the information device comprising a memory and a processor, wherein the memory stores instructions;
[0061] The processor is used to execute instructions stored in the memory, and when the instructions are executed by the processor, the steps of any one of the methods described in the second aspect are implemented.
[0062] A seventh aspect of an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method described in any one of the first aspects are implemented; or, when the computer program is executed by a processor, the steps of the method described in any one of the second aspects are implemented.
[0063] The embodiment of the present invention provides a task scheduling method, information processing method, device, equipment and storage medium. The task scheduling method performs task scheduling and processing based on determining the working status of the proxy process component and the resource usage of the corresponding server. When a proxy process component is down, another suitable proxy process component can be quickly allocated to execute the task, thereby ensuring the high availability of the load balancing open source solution and greatly optimizing the resource utilization of the server. The information processing method obtains the usage information of multiple types of resources of the server, and determines the evaluation value of the server based on the usage information of each type of resource and the weight corresponding to each type of resource. The evaluation value represents the comprehensive utilization rate of multiple types of resources of the server, and sends the evaluation value to the load balancing component, providing an accurate basis for task scheduling and processing, and ensuring the normal progress of task scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 A flowchart of a task scheduling method provided by an embodiment of the present invention;
[0065] Figure 2 A system flow chart for creating a load balancer provided in an embodiment of the present invention;
[0066] Figure 3 A system flow chart for updating a load balancer provided in an embodiment of the present invention;
[0067] Figure 4 A schematic diagram of a flow chart of an information processing method provided by an embodiment of the present invention;
[0068] Figure 5 A schematic diagram of the structure of a task scheduling device provided by an embodiment of the present invention;
[0069] Figure 6 A schematic diagram of the structure of an information processing device provided by an embodiment of the present invention;
[0070] Figure 7 A diagram of the system architecture for executing task scheduling provided by an embodiment of the present invention;
[0071] Figure 8 A schematic diagram of CPU resource utilization and score ranges provided in an embodiment of the present invention;
[0072] Fig. 9 A schematic diagram of weight setting provided by an embodiment of the present invention;
[0073] Fig.10 A schematic diagram of the evaluation value and the utilization rate of each type of resource provided by an embodiment of the present invention
[0074] Fig.11 A schematic diagram of the structure of a task scheduling device provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0075] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0076] In the current load balancer deployment scheme, once the proxy process component goes down, the existing load balancer of the server to which the proxy process component belongs will not be able to perform addition, deletion, or modification operations within a certain period of time, that is, the server loses the right to operate these load balancers. Even if an available proxy process component is randomly assigned, there is still the problem of uneven or low utilization of system resources due to uneven deployment and scheduling of the load balancer. Based on this, the following embodiments of the present invention are proposed.
[0077] See also Figure 1 , Figure 1 The following is a flow chart of a task scheduling method provided by an embodiment of the present invention. The task scheduling method provided by an embodiment of the present invention includes:
[0078] S101, receiving request information for creating a load balancer or for updating the configuration of a first load balancer sent by a network service component.
[0079] S102: Based on the request information, query the pre-collected information to obtain a query result.
[0080] S103: Determine a target agent process component from the at least one agent process component based on the query result.
[0081] S104: Create a load balancer or update the configuration of the first load balancer based on the target proxy process component.
[0082] In one embodiment, the task scheduling method can be applied to a load balancing plug-in, and the request information sent by the network service component can be to create a new load balancer or to update an existing first load balancer. The pre-collected information includes the working status of at least one proxy process component, the evaluation value of the server corresponding to each proxy process component, and the identification information of the proxy process component. The evaluation value represents the comprehensive utilization rate of multiple types of resources of the server where the proxy process component is located.
[0083] It should be noted that the load balancing service architecture involved in this application includes but is not limited to a load balancing plug-in, a network service component, a proxy process component, a database and a message queue. Among them, the network service component provides an application program interface to the outside world for accepting the configuration issued by the user, and can call the load balancing plug-in to process the request. The load balancing plug-in selects an available proxy process component to process the request based on the request sent by the network service component. The database stores relevant working information of each component, such as the downtime information of the proxy process component. The message queue serves as a channel between the network service component, the load balancing plug-in and the proxy process component.
[0084] In an example, take creating a new load balancer as an example, Figure 2 As shown, Figure 2 The system flow chart for creating a load balancer. After the load balancing plug-in receives the request for creating a load balancer issued by the network service component, it can determine one or more proxy process components that are currently in normal working state by querying the database. The heartbeat information of the proxy process components is stored in the database, and the working state of the corresponding proxy process can be determined by the update time of the heartbeat information. When there is only one proxy process component in normal working state, the proxy process component can be directly selected to create a new load balancer. When there are multiple proxy process components in normal working state, it is necessary to determine it according to the evaluation value of the server to which the proxy process component belongs. Among them, the proxy process component periodically collects the resource information of the server to which it belongs, determines the evaluation value used to characterize the usage of the server resources, and transmits the collected information to the database through the message queue. Thus, the load balancing plug-in can obtain the evaluation value of the server to which the proxy process component belongs by querying the database. When a proxy process component does not transmit the collected information to the database within a predetermined time interval, it can be determined that the proxy process component is in a downtime state.
[0085] In another example, taking updating the configuration of the first load balancer as an example, Figure 3 As shown, Figure 3The system flow chart for updating the load balancer. The load balancing plug-in receives a request for updating the first load balancer issued by the network service component. The first load balancer may be one or more load balancers, such as load balancer 1 and / or load balancer 3. By querying the heartbeat information of the proxy process component 1 stored in the database, it can be determined whether the working state of the proxy process component 1 to which the first load balancer belongs is normal. If the working state of the proxy process component 1 corresponding to the first load balancer is normal, the first load balancer can be updated directly through the proxy process component 1. If the working state of the proxy process component 1 is abnormal, the working state and identification information of other proxy process components other than the proxy process component 1 and the corresponding evaluation values of other proxy process components are queried, and the target proxy process component is determined from other proxy process components to complete the update of the configuration of the first load balancer. For example, if the proxy process component 2 is determined to be the target proxy process component, the proxy process component 2 obtains the corresponding user login information of the server where the proxy process component 1 is located through the system configuration, remotely executes the configuration update request of the first load balancer on the server where the proxy process component 1 is located, and updates the configuration of the first load balancer across machines.
[0086] In this embodiment, the query result includes determining whether the corresponding identification information and working state of the proxy process component are normal, and the evaluation value of the server corresponding to the proxy process component in the normal working state. After determining the identification information corresponding to each proxy process component, the working state of each proxy process component is judged, and then the evaluation value of the server corresponding to the proxy process component in the normal working state is determined, and then the target proxy process component is determined.
[0087] This embodiment ensures high availability of the load balancing open source solution and optimizes server resource utilization by performing task scheduling and processing based on determining the working status of the proxy process component and the resource usage of the corresponding server.
[0088] In some optional embodiments, for step S102, the pre-collected information is queried based on the request information, and the query process may be different depending on the request information.
[0089] In one embodiment, if the request information is to create a new load balancer, the working status information and identification information of the proxy process component of each server in at least one server, as well as the evaluation value corresponding to each proxy process component, are queried based on the request information. Among them, the working status represents whether the proxy process component is available, the identification information is used to record and distinguish different proxy process components, and the evaluation value represents the comprehensive utilization rate of multiple types of resources of the server where the proxy process component is located. The higher the evaluation value, the lower the comprehensive utilization rate of multiple types of resources of the corresponding server. It can be understood that when the comprehensive utilization rate of multiple types of resources of a server is very high, if the proxy process component corresponding to the server is used as the target proxy process component at this time, it will intensify the degree of competition for system resources, making resource utilization further unbalanced.
[0090] In another embodiment, if the request information is to update the configuration of the first load balancer, the working status of the first proxy process component to which the first load balancer belongs is queried based on the request information.
[0091] If the working state of the first agent process component is in an abnormal state, the working states and identification information of other agent process components except the first agent process component and the corresponding evaluation values of other agent process components are queried.
[0092] In this embodiment, different proxy process components have different priorities. Among them, the priority of the first proxy process component to which the pre-updated first load balancer belongs is the highest. When a request information for updating the configuration of the first load balancer is received, the working status of the first proxy process component to which the first load balancer belongs is first queried. Only when the working status of the queried first proxy process component is abnormal, the working status and identification information of other proxy process components other than the first proxy process component and the corresponding evaluation values of other proxy process components are queried, and the target proxy process component is selected from the proxy process components with normal working status according to the evaluation value.
[0093] In some optional embodiments, for step S103, based on the query results, a target proxy process component is determined from at least one proxy process component, taking into account both the working status of the proxy process component and the comprehensive utilization rate of multiple types of resources of the server where the proxy process component is located.
[0094] In one embodiment, when creating a new load balancer, the proxy process component with the highest evaluation value is determined as the target proxy process component from the proxy process components in normal working status.
[0095] The higher the rating, the lower the comprehensive utilization rate of multiple types of resources on the server where the proxy process component is located. Therefore, the proxy process component with normal working status and the highest rating is selected as the target proxy process component. Of course, the proxy process components can also be sorted by rating first, and then filtered by working status.
[0096] In another embodiment, for updating the configuration of the first load balancer, if the working state of the first proxy process component to which the first load balancer belongs is in a normal state, the first proxy process component is determined as the target proxy process component.
[0097] If the working state of the first agent process component is in an abnormal state, the agent process component with the highest evaluation value is determined from other agent process components in normal working states and is determined as the target agent process component.
[0098] Specifically, the first proxy process component to which the first load balancer belongs has the highest priority. When the working state of the first proxy process component is normal, the first proxy process component is preferentially selected as the target proxy process component, without considering the working state and evaluation value of other proxy process components. If the working state of the first proxy process component is abnormal, the proxy process component with normal working state and the highest evaluation value is selected from other proxy process components as the target proxy process component.
[0099] In one embodiment, creating a load balancer based on a target proxy process component includes: sending a first instruction for creating a load balancer to the target proxy process component, wherein the first instruction is used by the target proxy process component to create a load balancer.
[0100] In this embodiment, the target proxy process component is a proxy process component with a normal working state and the highest evaluation value. After determining the target proxy process component, the load balancing plug-in sends a first instruction for creating a load balancer to the target proxy process component, and the target proxy process component creates a load balancer according to the first instruction.
[0101] In one embodiment, when the working state of the first proxy process component is in an abnormal state, updating the configuration of the first load balancer based on the target proxy process component includes:
[0102] A second instruction for updating the configuration of the first load balancer is sent to the target proxy process component, where the second instruction is used for the target proxy process component to remotely execute the configuration update of the first load balancer belonging to the first proxy process component based on pre-configured information.
[0103] In this embodiment, after the load balancing plug-in receives the request for updating the first load balancer from the network service component, it queries the database to obtain the working status information of the first proxy process component to which the first load balancer belongs. When the working status of the first proxy process component is abnormal, the target proxy process component is selected from other proxy process components except the first proxy process component. The load balancing plug-in sends a second instruction for updating the first load balancer to the target proxy process component, and the target proxy process component updates the first load balancer according to the second instruction. Obviously, the content carried by the second instruction is different from the content carried by the first instruction in the above embodiment, wherein the first instruction is used to create a new load balancer, while the second instruction is used to update a specific first load balancer. Figure 4 The flowchart of the information processing method provided by the embodiment of the present invention is shown in FIG. The information processing method is applied to the proxy process component, and the proxy process component is deployed in the server. Specifically, the information processing method provided by the embodiment of the present invention includes:
[0104] S201, obtaining usage information of multiple types of resources of a server.
[0105] S202, determining an evaluation value of the server based on usage information of each type of resource and a weight corresponding to each type of resource; the evaluation value represents a comprehensive utilization rate of multiple types of resources of the server.
[0106] S203, sending the evaluation value to the load balancing component.
[0107] In this embodiment, the usage information of multiple types of resources of the server reflects the utilization rate of the overall resources of the server and the utilization rate of each type of resource. The utilization rate can be evaluated by a score, and the lower the utilization rate, the higher the corresponding score.
[0108] For example, if the memory usage rates of two servers are 0.25 and 0.65 respectively, the score of each server can be determined based on the preset mapping relationship. The mapping relationship can be that the memory usage rate is between 0 and 0.2, and the corresponding score is 90; the memory usage rate is between 0.2 and 0.4, and the corresponding score is 70; the memory usage rate is between 0.4 and 0.6, and the corresponding score is 50; the memory usage rate is between 0.6 and 0.8, and the corresponding score is 30; the memory usage rate is between 0.8 and 1.0, and the corresponding score is 10. In this way, the score of the server with a memory usage rate of 0.25 can be determined as 70, and the score of the server with a memory usage rate of 0.65 can be determined as 30. The scoring rules for the usage information of other types of resources are similar to the scoring rules for memory usage, and will not be repeated here.
[0109] The usage information of multiple types of resources of the server may include the CPU usage rate, memory usage rate, disk usage rate, network card traffic, and the number of load balancers created in the server. The weights corresponding to the usage information of each type of resource may be partially different or completely different. Based on the score obtained from the usage information of each type of resource and the weight corresponding to each type of resource, an evaluation value reflecting the overall resource usage of the server can be determined, and then the evaluation value is sent to the load balancing component.
[0110] In this embodiment, by obtaining the usage information of multiple types of resources of the server, a corresponding score is obtained based on the usage information of each type of resource, and the evaluation value of the server is determined in combination with the weight corresponding to each type of resource. The evaluation value represents the comprehensive utilization rate of the multiple types of resources of the server, and the evaluation value is sent to the load balancing component, which provides an accurate basis for task scheduling and processing, and ensures the normal progress of task scheduling.
[0111] In one embodiment, for step S202, based on the usage information of each type of resource and the weight corresponding to each type of resource, determining the evaluation value of the server includes:
[0112] A plurality of sets of resource usage information of the server is obtained, and average usage information of each type of resource is determined based on the plurality of sets of resource usage information.
[0113] According to the preset data interval corresponding to each type of resource, the score corresponding to the average usage information of each type of resource is determined.
[0114] The evaluation value of the server is determined based on the corresponding score of each type of resource and the corresponding weight of each type of resource.
[0115] In this embodiment, multiple sets of resource usage information of the server are obtained periodically, for example, a set of resource usage information is obtained every 1 second. It can be understood that during the working process, the usage information of each type of resource of the server is not static. When a process ends or starts, one or more types of resource information will change. Therefore, by obtaining multiple sets of resource usage information of the server and averaging the multiple sets of resource usage information, and then determining the score corresponding to the average usage information of each type of resource, the accuracy of the score corresponding to the usage information of each type of resource is guaranteed.
[0116] Based on the above examples, please refer to Figure 5 , Figure 5 The structure diagram of the task scheduling device provided by the embodiment of the present invention. The task scheduling device includes a receiving module 301, a query module 302, a first determination module 303 and a processing module 304, wherein:
[0117] The receiving module 301 is used to receive request information sent by a network service component for creating a load balancer or for updating the configuration of a first load balancer.
[0118] The query module 302 is used to query the pre-collected information based on the request information to obtain the query result.
[0119] The first determining module 303 is configured to determine a target agent process component from at least one agent process component based on the query result.
[0120] The processing module 304 is used to create a load balancer or update the configuration of the first load balancer based on the target proxy process component.
[0121] In one embodiment, the task scheduling device may be part of a load balancing plug-in, and the request information sent by the network service component may be to create a new load balancer or to update an existing first load balancer. The pre-collected information includes the working status of at least one proxy process component, the evaluation value of the server corresponding to each proxy process component, and may also include identification information of the proxy process component. The evaluation value represents the comprehensive utilization rate of multiple types of resources of the server where the proxy process component is located.
[0122] In one example, taking the creation of a new load balancer as an example, by querying the database, one or more proxy process components that are currently in normal working state can be determined. The database stores the heartbeat information of the proxy process components, and the working state of the corresponding proxy process can be determined by the update time of the heartbeat information. When there is only one proxy process component in normal working state, the proxy process component can be directly selected to create a new load balancer. When there are multiple proxy process components in normal working state, it is necessary to determine it according to the evaluation value of the server to which the proxy process component belongs. Among them, the proxy process component periodically collects the resource information of the server to which it belongs, determines the evaluation value used to characterize the usage of server resources, and transmits the collected information to the database through the message queue, so that the load balancing plug-in can obtain the evaluation value of the server to which the proxy process component belongs by querying the database. When a proxy process component does not transmit the collected information to the database within a predetermined time interval, it can be determined that the proxy process component is in a downtime state.
[0123] In another example, taking updating the configuration of the first load balancer as an example, the first load balancer may be one or more load balancers, such as load balancer 1 and / or load balancer 3. By querying the heartbeat information of the proxy process component stored in the database, it can be determined whether the working status of the proxy process component 1 to which the first load balancer belongs is normal. If the working status of the proxy process component 1 corresponding to the first load balancer is normal, the first load balancer can be updated directly through the proxy process component 1. If the working status of the proxy process component 1 is abnormal, the working status and identification information of other proxy process components other than the proxy process component 1 and the evaluation values corresponding to the other proxy process components are queried, and the target proxy process component is determined from the other proxy process components to complete the update of the configuration of the first load balancer. For example, if the proxy process component 2 is determined to be the target proxy process component, the proxy process component 2 obtains the corresponding user login information of the server where the proxy process component 1 is located through the system configuration, remotely executes the configuration update request of the first load balancer on the server where the proxy process component 1 is located, and updates the configuration of the first load balancer across machines.
[0124] In this embodiment, the query result includes determining whether the corresponding identification information and working state of the proxy process component are normal, and the evaluation value of the server corresponding to the proxy process component in the normal working state. After determining the identification information corresponding to each proxy process component, the working state of each proxy process component is judged, and then the evaluation value of the server corresponding to the proxy process component in the normal working state is determined, and then the target proxy process component is determined.
[0125] This embodiment ensures high availability of the load balancing open source solution and optimizes server resource utilization by performing task scheduling and processing based on determining the working status of the proxy process component and the resource usage of the corresponding server.
[0126] In one embodiment, if the request information is to create a new load balancer, the query module 302 is used to query the working status information and identification information of the proxy process component of each server in at least one server based on the request information, as well as the evaluation value corresponding to each proxy process component. Among them, the working status represents whether the proxy process component is available, the identification information is used to record and distinguish different proxy process components, and the evaluation value represents the comprehensive utilization rate of multiple types of resources of the server where the proxy process component is located. The higher the evaluation value, the lower the comprehensive utilization rate of multiple types of resources of the corresponding server. It can be understood that when the comprehensive utilization rate of multiple types of resources of a server is very high, if the proxy process component corresponding to the server is used as the target proxy process component at this time, it will intensify the competition for system resources, making resource utilization further unbalanced.
[0127] In another embodiment, if the request information is to update the configuration of the first load balancer, the query module 302 is used to query the working status of the first proxy process component to which the first load balancer belongs based on the request information.
[0128] If the working state of the first agent process component is in an abnormal state, the working states and identification information of other agent process components except the first agent process component and the corresponding evaluation values of other agent process components are queried.
[0129] In this embodiment, different proxy process components have different priorities. Among them, the priority of the first proxy process component to which the pre-updated first load balancer belongs is the highest. When a request information for updating the configuration of the first load balancer is received, the working status of the first proxy process component to which the first load balancer belongs is first queried. Only when the working status of the queried first proxy process component is abnormal, the working status and identification information of other proxy process components other than the first proxy process component and the corresponding evaluation values of other proxy process components are queried, and the target proxy process component is selected from the proxy process components with normal working status according to the evaluation value.
[0130] In some optional embodiments, based on the query results, a target proxy process component is determined from at least one proxy process component, taking into account both the working status of the proxy process component and the comprehensive utilization rate of multiple types of resources of the server where the proxy process component is located.
[0131] In one embodiment, for creating a new load balancer, the first determining module 303 is used to determine the agent process component with the highest evaluation value from the agent process components in normal working status as the target agent process component.
[0132] The higher the rating, the lower the comprehensive utilization rate of multiple types of resources on the server where the proxy process component is located. Therefore, the proxy process component with normal working status and the highest rating is selected as the target proxy process component. Of course, the proxy process components can also be sorted by rating first, and then filtered by working status.
[0133] In another embodiment, for updating the configuration of the first load balancer, the first determining module 303 is used to determine the first proxy process component as the target proxy process component if the working state of the first proxy process component to which the first load balancer belongs is in a normal state.
[0134] If the working state of the first agent process component is in an abnormal state, the agent process component with the highest evaluation value is determined from other agent process components in normal working states and is determined as the target agent process component.
[0135] Specifically, the first proxy process component to which the first load balancer belongs has the highest priority. When the working state of the first proxy process component is normal, the first proxy process component is preferentially selected as the target proxy process component, without considering the working state and evaluation value of other proxy process components. If the working state of the first proxy process component is abnormal, the proxy process component with normal working state and the highest evaluation value is selected from other proxy process components as the target proxy process component.
[0136] In one embodiment, the processing module 304 is used to send a first instruction for creating a load balancer to the target proxy process component, where the first instruction is used for the target proxy process component to create a load balancer.
[0137] In this embodiment, the target proxy process component is a proxy process component with a normal working state and the highest evaluation value. After determining the target proxy process component, the load balancing plug-in sends a first instruction for creating a load balancer to the target proxy process component, and the target proxy process component creates a load balancer according to the first instruction.
[0138] In one embodiment, the processing module 304 is used to update the configuration of the first load balancer based on the target proxy process component when the working state of the first proxy process component is in an abnormal state, including:
[0139] A second instruction for updating the configuration of the first load balancer is sent to the target proxy process component, where the second instruction is used for the target proxy process component to remotely execute the configuration update of the first load balancer belonging to the first proxy process component based on pre-configured information.
[0140] In this embodiment, after the load balancing plug-in receives the request for updating the first load balancer from the network service component, it queries the database to obtain the working status information of the first proxy process component to which the first load balancer belongs. When the working status of the first proxy process component is abnormal, the target proxy process component is selected from other proxy process components except the first proxy process component. The load balancing plug-in sends a second instruction for updating the first load balancer to the target proxy process component, and the target proxy process component updates the first load balancer according to the second instruction. Obviously, the content carried by the second instruction is different from the content carried by the first instruction in the above embodiment, wherein the first instruction is used to create a new load balancer, while the second instruction is used to update a specific first load balancer.
[0141] Based on the above examples, please refer to Figure 6 , Figure 6 The schematic diagram of the structure of the information processing device provided by the embodiment of the present invention. The information processing device comprises an acquisition module 401, a second determination module 402 and a sending module 403, wherein:
[0142] The acquisition module 401 is used to acquire usage information of multiple types of resources of the server.
[0143] The second determination module 402 is used to determine the evaluation value of the server based on the usage information of each type of resources and the weight corresponding to each type of resources; the evaluation value represents the comprehensive usage rate of multiple types of resources of the server.
[0144] The sending module 403 is used to send the evaluation value to the load balancing component.
[0145] In this embodiment, the usage information of multiple types of resources of the server reflects the utilization rate of the overall resources of the server and the utilization rate of each type of resource. The utilization rate can be evaluated by a score, and the lower the utilization rate, the higher the corresponding score. The specific examples are described in the above information processing method embodiment, and will not be repeated here one by one.
[0146] The usage information of multiple types of resources of the server may include the CPU usage rate, memory usage rate, disk usage rate, network card traffic, and the number of load balancers created in the server. The weights corresponding to the usage information of each type of resource may be partially different or completely different. Based on the score obtained from the usage information of each type of resource and the weight corresponding to each type of resource, an evaluation value reflecting the overall resource usage of the server can be determined, and then the evaluation value is sent to the load balancing component.
[0147] In this embodiment, by obtaining the usage information of multiple types of resources of the server, a corresponding score is obtained based on the usage information of each type of resource, and the evaluation value of the server is determined in combination with the weight corresponding to each type of resource. The evaluation value represents the comprehensive utilization rate of the multiple types of resources of the server, and the evaluation value is sent to the load balancing component, which provides an accurate basis for task scheduling and processing, and ensures the normal progress of task scheduling.
[0148] In one embodiment, the second determining module 402 is specifically configured to:
[0149] A plurality of sets of resource usage information of the server is obtained, and average usage information of each type of resource is determined based on the plurality of sets of resource usage information.
[0150] According to the preset data interval corresponding to each type of resource, the score corresponding to the average usage information of each type of resource is determined.
[0151] The evaluation value of the server is determined based on the corresponding score of each type of resource and the corresponding weight of each type of resource.
[0152] In this embodiment, multiple sets of resource usage information of the server are obtained periodically, for example, a set of resource usage information is obtained every 1 second. It can be understood that during the working process, the usage information of each type of resource of the server is not static. When a process ends or starts, one or more types of resource information will change. Therefore, by obtaining multiple sets of resource usage information of the server and averaging the multiple sets of resource usage information, and then determining the score corresponding to the average usage information of each type of resource, the accuracy of the score corresponding to the usage information of each type of resource is guaranteed.
[0153] The task scheduling method and information processing method of the embodiment of the present invention are described below with reference to a specific example. Figure 7 As shown, Figure 7 The system architecture diagram for executing task scheduling provided by an embodiment of the present invention. Among them:
[0154] Each server may include one or more agent process components. By setting up scheduled tasks, the server information processing component can be used to periodically collect various resource usage information of the server. After determining the evaluation value, the selection component determines the target agent process component.
[0155] Specifically, when the load balancing plug-in receives a request to create a load balancer, the load balancing plug-in can determine one or more proxy process components that are currently in normal working state by querying the database. The database stores the heartbeat information of the proxy process components, and the working state of the corresponding proxy process can be determined by the update time of the heartbeat information. When there is only one proxy process component in normal working state, the proxy process component can be directly selected to create a new load balancer. When there are multiple proxy process components in normal working state, it is necessary to determine it according to the evaluation value of the server to which the proxy process component belongs.
[0156] For example, Figure 8 As shown, Figure 8 This is a diagram of CPU resource usage and score ranges. Through this list, the mapping relationship between CPU resource usage and score can be determined. For example, when the CPU resource usage is 0.45, it falls within the interval 0.4-0.5, then the corresponding score of the server can be determined to be 50. The scoring rules for the usage information of other types of resources are similar to the scoring rules for CPU resource usage, and will not be repeated here.
[0157] The usage information of each type of resource corresponds to its own weight, such as Fig. 9 As shown, Fig. 9This is a diagram of weight settings, where the weight corresponding to the CPU is 10%, the weight corresponding to the memory is 30%, the weight corresponding to the hard disk is 10%, the weight corresponding to the network card traffic is 40%, and the weight corresponding to the number of LBs (Load Balancers) is 10%. Based on the usage information of each type of resource and their corresponding weights, the score can be obtained. It should be noted that the weight setting is not fixed. When the usage rate of one resource changes greatly within a certain period of time, its corresponding weight can be adjusted accordingly.
[0158] In order to ensure the reliability of the data, it is necessary to periodically collect multiple sets of resource usage information of the server, and average the multiple sets of resource usage information, and then determine the score corresponding to the average usage information of each type of resource to obtain the evaluation value of the server.
[0159] like Fig.10 As shown, Fig.10 This is a schematic diagram of the evaluation value and the utilization rate of each type of resource. Three sample information is collected for each type of resource, and the sample information is averaged. Figure 6 and Figure 7 The corresponding relationship shown can be used to obtain the evaluation value of each server.
[0160] Different from the above, when receiving the request information for updating the first load balancer, it is necessary to first query the working status of the first proxy process component to which the first load balancer belongs. Only when the working status of the queried first proxy process component is abnormal, the working status and identification information of other proxy process components other than the first proxy process component and the corresponding evaluation values of other proxy process components are queried, and the target proxy process component is selected from the proxy process components with normal working status according to the evaluation value, that is, the above evaluation value determination scheme.
[0161] The present invention also provides a task scheduling device, such as Fig.11 As shown, the task scheduling device includes a memory and a processor, wherein the memory stores instructions; the processor is used to execute the instructions stored in the memory, and when the instructions are executed by the processor, the steps applied to the task scheduling method can be implemented.
[0162] Optionally, the various components in the task scheduling device can be coupled together through a bus system. It can be understood that the bus system is used to achieve connection and communication between these components. In addition to the data bus, the bus system also includes a power bus, a control bus and a status signal bus.
[0163] Alternatively, the memory may be implemented by any type of volatile or non-volatile storage device, or a combination thereof.
[0164] Optionally, the processor may be an integrated circuit chip having signal processing capabilities. In the implementation process, each step of the above method may be completed by instructions in the form of software, or may be completed by an integrated logic circuit of hardware. The above processor may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0165] The present invention also provides an information processing device, which includes a memory and a processor, wherein the memory stores instructions; the processor is used to execute the instructions stored in the memory, and when the instructions are executed by the processor, the steps applied to the information processing method can be implemented.
[0166] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any step in the above-mentioned task scheduling method can be completed; or when the computer program is executed by a processor, any step in the above-mentioned information processing method can be completed.
[0167] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0168] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0169] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0170] In the several embodiments provided in the present application, it should be understood that the disclosed methods, devices and storage media can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as: multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or module can be electrical, mechanical or other forms.
[0171] The modules described above as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network modules; some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0172] In addition, all functional modules in the embodiments of the present invention may be integrated into one processing module, or each module may be a separate module, or two or more modules may be integrated into one module; the above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0173] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, etc. Various media that can store program codes.
[0174] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A task scheduling method, characterized in that: The method comprises: Receiving request information sent by the network service component for creating a load balancer or for updating the configuration of the first load balancer; Based on the request information, query the pre-collected information to obtain the query result; the pre-collected information includes the working status of at least one proxy process component and the evaluation value of the server corresponding to each proxy process component; the evaluation value represents the comprehensive utilization rate of multiple types of resources of the server where the proxy process component is located; In a case where the request information is used to create a load balancer, or in a case where the request information is used to update the configuration of a first load balancer and the working state of a first proxy process component to which the first load balancer belongs is in an abnormal state, determining a proxy process component with the highest evaluation value from proxy process components in normal working states as a target proxy process component; When the request information is used to update the configuration of the first load balancer and the working state of the first proxy process component is normal, determining the first proxy process component as the target proxy process component; Based on the target proxy process component, a load balancer is created or the configuration of the first load balancer is updated.
2. An information processing method, applied to an agent process component, wherein the agent process component is deployed in a server, characterized in that: The method comprises: Obtaining usage information of multiple types of resources of the server; Determine the evaluation value of the server based on the usage information of each type of resource and the weight corresponding to each type of resource; the evaluation value represents the comprehensive utilization rate of multiple types of resources of the server; The evaluation value is sent to the load balancing component; the evaluation value is used by the load balancing component to determine the proxy process component with the highest evaluation value from the proxy process components in normal working status as the target proxy process component when the request information sent by the network service component is used to create a load balancer, or when the request information is used to update the configuration of the first load balancer and the working status of the first proxy process component to which the first load balancer belongs is in an abnormal state, and when the request information is used to update the configuration of the first load balancer and the working status of the first proxy process component is in a normal state, determine the first proxy process component as the target proxy process component; the target proxy process component is used to create a load balancer or update the configuration of the first load balancer.
3. The information processing method according to claim 2, characterized in that: The determining the evaluation value of the server based on the usage information of each type of resource and the weight corresponding to each type of resource includes: Obtain multiple sets of resource usage information of the server, and determine average usage information of each type of resource based on the multiple sets of resource usage information; each set of resource usage information includes multiple of the following resource types: central processing unit CPU usage, memory usage, disk usage, network card traffic, and the number of load balancers created in the server; According to the preset data interval corresponding to each type of resource, determine the score corresponding to the average usage information of each type of resource; Based on the corresponding score of each type of resource and the corresponding weight of each type of resource, the evaluation value of the server is determined.
4. A task scheduling device, characterized in that: The device comprises a receiving module, a query module, a first determining module and a processing module, wherein: The receiving module is used to receive request information sent by the network service component for creating a load balancer or for updating the configuration of the first load balancer; The query module is used to query the pre-collected information based on the request information to obtain the query result; the pre-collected information includes the working status of at least one proxy process component and the evaluation value of the server corresponding to each proxy process component; the evaluation value represents the comprehensive utilization rate of multiple types of resources of the server where the proxy process component is located; The first determination module is used to determine, when the request information is used to create a load balancer, or when the request information is used to update the configuration of the first load balancer and the working state of the first proxy process component to which the first load balancer belongs is in an abnormal state, the proxy process component with the highest evaluation value from the proxy process components in a normal working state as the target proxy process component; when the request information is used to update the configuration of the first load balancer and the working state of the first proxy process component is in a normal state, determine the first proxy process component as the target proxy process component; The processing module is used to create a load balancer or update the configuration of the first load balancer based on the target proxy process component.
5. An information processing device, applied to an agent process component, wherein the agent process component is deployed in a server, characterized in that: The device comprises an acquisition module, a second determination module, and a sending module, wherein: The acquisition module is used to acquire usage information of multiple types of resources of the server; The second determination module is used to determine the evaluation value of the server based on the usage information of each type of resources and the weight corresponding to each type of resources; the evaluation value represents the comprehensive utilization rate of multiple types of resources of the server; The sending module is used to send the evaluation value to the load balancing component; the evaluation value is used by the load balancing component to determine the proxy process component with the highest evaluation value from the proxy process components in normal working status as the target proxy process component when the request information sent by the network service component is used to create a load balancer, or when the request information is used to update the configuration of the first load balancer and the working status of the first proxy process component to which the first load balancer belongs is in an abnormal state, and when the request information is used to update the configuration of the first load balancer and the working status of the first proxy process component is in a normal state, determine the first proxy process component as the target proxy process component; the target proxy process component is used to create a load balancer or update the configuration of the first load balancer.
6. A task scheduling device, characterized in that: The task scheduling device includes a memory and a processor, wherein instructions are stored in the memory; The processor is used to execute instructions stored in the memory, and when the instructions are executed by the processor, the steps of the method according to claim 1 are implemented.
7. An information processing device, characterized in that: The information device includes a memory and a processor, wherein instructions are stored in the memory; The processor is used to execute instructions stored in the memory, and when the instructions are executed by the processor, the steps of the method according to any one of claims 2 to 3 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method described in claim 1 are implemented; or, when the computer program is executed by a processor, the steps of the method described in any one of claims 2 to 3 are implemented.
