Service resource scheduling method and device, equipment, storage medium and product
By performing automated service resource scheduling on the main node of the distributed cluster, the problems of low resource scheduling efficiency and unreasonable resource allocation in the existing technology are solved, efficient and reasonable resource allocation is achieved, and the performance of application services is improved.
Patent Information
- Application Number
- CN202411757496.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-11
AI Technical Summary
In the existing service resource scheduling process based on distributed clusters, resource quotas are required to be implemented manually or semi-intervention, resulting in waste of resource redundancy or insufficient resource allocation, affecting the normal use of application services.
By obtaining historical resource usage data of application services under slave nodes on the master node of the resource computing power cluster, predicting future resource usage data, determining the resource data to be allocated, and performing automated service resource scheduling.
It realizes automated scheduling of application service resources, improves resource scheduling efficiency, ensures reasonable allocation of resources, and improves the performance and response speed of application services.
Smart Images

Figure CN119597481A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a service resource scheduling method, device, equipment, storage medium and product. Background Art
[0002] With the digital transformation of the financial industry, artificial intelligence (AI) technology is increasingly being used in the financial field. Financial institutions usually use AI technology for big data analysis, algorithmic trading, risk management, and customer service, and these financial-related application services usually require a large amount of computing resources during actual operation. Therefore, in order to facilitate the mobilization of service resources, financial institutions usually use distributed clusters to support the high computing requirements of the above application services.
[0003] In the existing distributed cluster-based service resource scheduling process, manual or semi-intervention methods are usually required to implement resource quotas. However, there is usually a deviation between manual experience evaluation and actual conditions, which can easily lead to redundant resource waste or insufficient resource allocation, affecting the normal use of application services. Summary of the invention
[0004] The present invention provides a service resource scheduling method, device, equipment, storage medium and product to realize automatic scheduling of application service resources, improve resource scheduling efficiency, and realize reasonable allocation of application service resources.
[0005] According to one aspect of the present invention, a service resource scheduling method is provided, which is applied to a master node of a resource computing power cluster; the resource computing power cluster also includes at least one slave node; each of the slave nodes is deployed with at least one application service, and the method includes:
[0006] For any slave node, when the corresponding application service under the slave node meets the preset resource prediction conditions, the historical resource usage data of the corresponding application service within the preset historical time range is obtained;
[0007] Determine predicted resource usage data of the corresponding application service within a preset future time range based on the historical resource usage data of the corresponding application service;
[0008] Determine the resource data to be allocated for the corresponding application service according to the predicted resource usage data of the corresponding application service;
[0009] Service resources are scheduled for each application service according to the to-be-allocated resource data corresponding to each application service.
[0010] According to another aspect of the present invention, a service resource scheduling device is provided, which is configured in a master node of a resource computing power cluster; the resource computing power cluster also includes at least one slave node; each of the slave nodes is deployed with at least one application service, and the device includes:
[0011] A historical data acquisition module is used to acquire the historical resource usage data of the corresponding application service within a preset historical time range for any slave node when the corresponding application service under the slave node meets the preset resource prediction conditions;
[0012] A resource data prediction module, used to determine predicted resource usage data of a corresponding application service within a preset future time range based on historical resource usage data of the corresponding application service;
[0013] A module for determining resources to be allocated, used to determine the resource data to be allocated for the corresponding application service according to the predicted resource usage data of the corresponding application service;
[0014] The resource scheduling module is used to schedule service resources for each of the application services according to the to-be-allocated resource data corresponding to each of the application services.
[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0016] at least one processor; and
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the service resource scheduling method described in any embodiment of the present invention.
[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the service resource scheduling method described in any embodiment of the present invention when executed.
[0020] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the service resource scheduling method described above is implemented.
[0021] The technical solution of the embodiment of the present invention determines the predicted resource usage data of the corresponding application service within a preset future time range based on the historical resource usage data of the corresponding application service, determines the to-be-allocated resource data of the corresponding application service based on the predicted resource usage data of the corresponding application service, and schedules service resources for each application service based on the to-be-allocated resource data corresponding to each application service, thereby realizing automatic scheduling of application services, and being able to allocate resources on demand during the resource scheduling process without the need for manual resource allocation by relevant technical personnel, thereby realizing reasonable allocation of service resources and improving resource scheduling efficiency. At the same time, through accurate resource prediction and flexible scheduling, it is ensured that application services can obtain sufficient computing resources when needed, thereby improving service performance and response speed.
[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 is a flow chart of a service resource scheduling method provided according to Embodiment 1 of the present invention;
[0025] Figure 2 is a flow chart of a service resource scheduling method provided according to Embodiment 2 of the present invention;
[0026] Figure 3 is a structural diagram of a service resource scheduling device provided according to Embodiment 3 of the present invention;
[0027] Figure 4 It is a structural diagram of an electronic device for implementing the service resource scheduling method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Embodiment 1
[0031] Figure 1 A flow chart of a service resource scheduling method provided in Embodiment 1 of the present invention. This embodiment can be applied to the situation of adaptively scheduling service resources for financial application services in the field of financial technology. The method can be executed by a service resource scheduling device. The service resource scheduling device can be implemented in the form of hardware and / or software. The service resource scheduling device can be configured in an electronic device. Specifically, the electronic device can be the master node of a resource computing power cluster.
[0032] The method can be applied to the master node of a resource computing power cluster, wherein the resource computing power cluster also includes at least one slave node; each slave node is deployed with at least one application service. Figure 1 As shown, the method includes:
[0033] S110. For any slave node, when the corresponding application service under the slave node meets the preset resource prediction condition, obtain the historical resource usage data of the corresponding application service within a preset historical time range.
[0034] S120: Determine predicted resource usage data of the corresponding application service within a preset future time range based on the historical resource usage data of the corresponding application service.
[0035] S130: Determine the to-be-allocated resource data of the corresponding application service according to the predicted resource usage data of the corresponding application service.
[0036] S140: Schedule service resources for each application service according to the to-be-allocated resource data corresponding to each application service.
[0037] The resource computing power cluster can be a pre-built distributed cluster, including a master node and at least one slave node. The master node is used for cluster resource management; the slave node is responsible for providing computing power resources. At least one application service is deployed on each slave node, and the application service can be an application in the field of financial technology. Different applications require different computing power resources due to their different functions.
[0038] Among them, the resource prediction conditions can be pre-set by relevant technical personnel according to actual needs. For example, the resource prediction conditions can be to reach the set prediction time, for example, to perform resource usage prediction for application services at 00:00 every day. This embodiment does not limit this.
[0039] The historical resource usage data of the historical time range can be directly obtained from the database. The historical time range can be predicted according to actual needs, for example, the historical time range can be 7 days.
[0040] Specifically, a daemon task is deployed on the master node, and a dedicated container is created and deployed on each slave node. Each dedicated container is responsible for collecting resource usage data of the slave node and sending it to the master node. When the cluster is expanded or reduced, the dedicated container of the slave node will be created or destroyed synchronously with the expansion or reduction of the cluster. The master node stores the resource usage data corresponding to each application service under each slave node in the time series database.
[0041] Among them, resource usage data may include computing resource utilization, video memory occupancy, memory occupancy and CPU (Central Processing Unit) utilization, etc.
[0042] Specifically, the resource usage data of each application service under each node can be sampled regularly, and the sampling frequency can be pre-set by relevant technical personnel, for example, it can be 1 minute. The resource usage data of the application services under each node are stored in the database in a time series format, that is, the resource usage data corresponding to each minute. If the historical time range is 7 days, the master node obtains the historical resource usage data of the corresponding application service under the slave node within the historical 7 days.
[0043] Based on the historical resource usage data of the corresponding application service, the resource usage of the corresponding application service within a preset future time range is predicted to obtain the predicted resource usage data of the corresponding application service. The future time range can be preset by relevant technical personnel, for example, the future time range can be 7 days.
[0044] The prediction method for predicting the resource usage data of the application service may be to use a pre-trained resource data prediction model for prediction. The resource data prediction model is pre-trained by relevant technical personnel.
[0045] Specifically, a large amount of resource usage data of different application services in a historical time period is used to train a preset time series model, and the time series model continuously optimizes its own model parameters based on the model's prediction results and the standard results of the resource usage data in the corresponding time period until the model iteration end condition is reached to obtain a resource data prediction model. The time series model can be, for example, an LSTM model (Long Short-Term Memory).
[0046] The historical resource usage data of the corresponding application service is input into the trained resource data prediction model to obtain the predicted resource usage data of the corresponding application service within a preset future time range output by the model. The predicted resource usage data includes the change trend of the computing resource utilization rate, video memory occupancy rate, memory occupancy rate and CPU utilization rate of the corresponding application service within the future time range.
[0047] According to the predicted resource usage data of the corresponding application service, the resource data to be allocated for the application service is determined, wherein the resource data to be allocated may be the AI computing power and video memory space to be allocated.
[0048] In an optional embodiment, determining the to-be-allocated resource data of the corresponding application service according to the predicted resource usage data of the corresponding application service includes:
[0049] Step a1: Select the maximum resource usage data under each prediction indicator from the predicted resource usage data of the corresponding application service.
[0050] Among them, the prediction indicators may include computing resource utilization, video memory occupancy, memory occupancy and CPU utilization.
[0051] Specifically, if the future time period is 7 days, the predicted resource usage data includes the resource usage trends of computing power resource utilization, video memory occupancy, memory occupancy, and CPU utilization in the next 7 days. The peak value of each prediction indicator is selected from the resource usage trends of different prediction indicators. For example, the maximum computing power resource utilization, video memory occupancy, memory occupancy, and CPU utilization in the next 7 days are selected as the maximum resource usage data.
[0052] Step a2: According to the preset demand allocation ratio and based on the maximum resource usage data under each prediction indicator, the target resource usage data is determined.
[0053] The demand allocation ratio can be set by relevant technical personnel according to actual needs. To ensure the normal operation of the service, the demand allocation ratio can be set to 120%.
[0054] Specifically, the maximum resource usage data under each prediction indicator is multiplied by the demand allocation ratio to obtain the target resource usage data.
[0055] Step a3: Determine the resource data to be allocated for the corresponding application service according to the target resource usage data.
[0056] Based on the target resource usage data, determine the resource data to be allocated for the application service. For example, if the graphics memory usage of the target resource usage data is 100MB, then the resource data to be allocated is 100MB of graphics memory space allocated for the application service. It should be noted that the resource data to be allocated for the application service is determined by comprehensive analysis based on the target resource usage data of multiple dimensional indicators. Specifically, it is also necessary to combine factors such as CPU usage and computing power resource utilization to determine the resources to be allocated.
[0057] Since financial application services have extremely high requirements for continuity and cannot tolerate abnormal application services, the above technical solution selects the maximum resource usage data under each prediction indicator from the predicted resource usage data of the corresponding application service, and determines the target resource usage data based on the maximum resource usage data under each prediction indicator according to the preset demand allocation ratio, and then determines the resource data to be allocated for the corresponding application service based on the target resource data. In the process of determining the allocated resources, the configuration of redundant resources is taken into consideration to ensure the continuity of the application service, thereby ensuring the normal operation of the application service and avoiding the bad experience for the application service users due to application service failures.
[0058] The master node performs adaptive dynamic service resource scheduling for each application service under each slave node according to the resource data to be allocated for each application service.
[0059] The technical solution of the embodiment of the present invention determines the predicted resource usage data of the corresponding application service within a preset future time range based on the historical resource usage data of the corresponding application service, determines the to-be-allocated resource data of the corresponding application service based on the predicted resource usage data of the corresponding application service, and schedules service resources for each application service based on the to-be-allocated resource data corresponding to each application service, thereby realizing automatic scheduling of application services, and being able to allocate resources on demand during the resource scheduling process without the need for manual resource allocation by relevant technical personnel, thereby realizing reasonable allocation of service resources and improving resource scheduling efficiency. At the same time, through accurate resource prediction and flexible scheduling, it is ensured that application services can obtain sufficient computing resources when needed, thereby improving service performance and response speed.
[0060] It should be noted that, in order to further improve the accuracy of determining the predicted resource usage data of the application service, the resource usage of the application service may also be predicted based on a variety of prediction methods.
[0061] In an optional embodiment, determining predicted resource usage data of the corresponding application service within a preset future time range based on historical resource usage data of the corresponding application service includes:
[0062] Step b11: Use the pre-trained first resource prediction model to predict resource usage for the corresponding application service based on historical resource usage data to obtain first predicted resource data within a future time range.
[0063] The first resource prediction model can be obtained by pre-training by relevant technical personnel, specifically, the resource usage data of each application service in the historical time period can be used as a sample training set, and the preset first network model can be trained to obtain the first resource prediction model. The first network model can be an LSTM model.
[0064] Specifically, the historical resource usage data of the corresponding application service is input into the trained first resource prediction model to obtain the first predicted resource data within the future time range output by the model.
[0065] Step b12: Use the pre-trained second resource prediction model to predict resource usage for the corresponding application service based on the historical resource usage data to obtain second predicted resource data within a future time range.
[0066] The second resource prediction model can be pre-trained by relevant technical personnel, specifically, the resource usage data of each application service in the historical time period can be used as a sample training set, and the preset second network model can be trained to obtain the first resource prediction model. The second network model can be an ARIMA (AutoRegressiveIntegrated Moving Average) model.
[0067] Specifically, the historical resource usage data of the corresponding application service is input into the trained second resource prediction model to obtain the second predicted resource data within the future time range output by the model.
[0068] Step b2: Determine predicted resource usage data of the corresponding application service within a future time range based on the first predicted resource data and the second predicted resource data.
[0069] Exemplarily, the average or weighted average between the first predicted resource data and the second predicted resource data may be used as the predicted resource usage data of the corresponding application service within a future time range.
[0070] The above technical solution adopts the first resource prediction model and the second resource prediction model to predict the resource usage of the corresponding application services in the future time period respectively, so that the predicted resource data is more accurate, thereby avoiding the situation where the model training accuracy is insufficient or the model is overfitted when a single model prediction method is used, resulting in low prediction result accuracy.
[0071] It is understandable that, in the process of predicting resource usage data, the historical time range of the historical resource usage data input into the resource prediction model is a fixed time range value set by relevant technical personnel. In order to ensure the prediction efficiency of the model, the historical time range is usually set to 7 days. However, it should be noted that the model may have poor prediction results in the process of predicting based on 7 days of historical resource usage data. Therefore, in the process of predicting resource usage data, this embodiment can dynamically adjust the historical time range of the input historical resource usage data, thereby ensuring the prediction efficiency while ensuring the accuracy of the model prediction.
[0072] In an optional embodiment, determining predicted resource usage data of a corresponding application service within a future time range according to the first predicted resource data and the second predicted resource data includes:
[0073] Step c1: Determine predicted resource difference data corresponding to each prediction index between the first predicted resource data and the second predicted resource data.
[0074] Specifically, for each prediction indicator, such as computing power resource utilization, video memory occupancy, memory occupancy and CPU utilization, the predicted resource difference data between the first predicted resource data and the second resource data under each prediction indicator is determined respectively.
[0075] Step c2: Determine target resource difference data based on each predicted resource difference data.
[0076] The mean of the resource difference data under each prediction indicator is taken as the target resource difference data.
[0077] Specifically, if the predicted resource difference data between the resource utilization in the first resource prediction data and the computing power resource utilization in the second resource prediction data is 10%; the predicted resource difference data between the resource utilization in the first resource prediction data and the graphics memory occupancy in the second resource prediction data is 15%; the predicted resource difference data between the resource utilization in the first resource prediction data and the CPU utilization in the second resource prediction data is 5%, then the target resource difference data is 10%.
[0078] Step c3: If the target resource difference data meets the preset difference threshold judgment condition, the predicted resource usage data of the corresponding financial service within the future time range is determined based on the first predicted resource data and the second predicted resource data.
[0079] The difference threshold judgment condition may be preset by relevant technical personnel. For example, the difference threshold judgment condition may specifically be whether the target resource difference data is less than a preset difference threshold. The difference threshold may be set according to actual needs, for example, the difference threshold may be set to 10%.
[0080] If the target resource difference data is large, it means that the result deviation between the first resource prediction data and the second resource prediction data is large; if the target resource difference data is small, it means that the result deviation between the first resource prediction data and the second resource prediction data is small.
[0081] Specifically, if the target resource difference data meets the preset difference threshold judgment condition, it means that the result deviation between the first resource prediction data and the second resource prediction data is small, and it can be considered that the prediction results of the two models are similar and the prediction results are highly reliable. The first predicted resource data and the second predicted resource data can be used to determine the predicted resource usage data of the corresponding financial service within the future time range.
[0082] If the target resource difference data does not meet the preset difference threshold judgment condition, it means that the result deviation between the first resource prediction data and the second resource prediction data is large. It can be considered that the difference between the prediction results of the two models is increasing and the reliability of the prediction results is low.
[0083] The above technical solution determines the predicted resource difference data corresponding to each prediction indicator between the first predicted resource data and the second predicted resource data, and determines whether the predicted resource usage data of the corresponding financial service in the future time range can be determined based on the first predicted resource data and the second predicted resource data according to each predicted resource difference data. In this way, it can further ensure that when the results of the two predicted resource data are reliable, the resource usage data in the future time range is predicted based on the two predicted resource results, thereby ensuring the reliability and accuracy of the predicted resource usage data.
[0084] Optionally, after determining the target resource difference data based on each predicted resource difference data, if the target resource difference data does not meet the preset difference threshold judgment condition, the historical time range is adjusted based on the preset time adjustment rule, and the target resource difference data is determined based on the historical resource usage data within the adjusted historical time range, until the target resource difference data meets the preset difference threshold judgment condition.
[0085] The preset time adjustment rule may be pre-set by relevant technical personnel. For example, the preset time adjustment rule may be to add a preset time period based on the previous historical time range, for example, the preset time period is 7 days. For example, if the previous historical time range is set to 7 days, the historical time range adjusted based on the preset time adjustment rule is 14 days.
[0086] Obtain historical resource usage data of the corresponding application service within the adjusted historical time range, and use the first resource prediction model to predict resource usage for the corresponding application service based on the historical resource usage data within the adjusted historical time range, and obtain first predicted resource data within the future time range; and use the second resource prediction model to predict resource usage for the corresponding application service based on the historical resource usage data within the adjusted historical time range, and obtain second predicted resource data within the future time range; determine the predicted resource difference data corresponding to each prediction indicator between the first predicted resource data and the second predicted resource data, and determine the target resource difference data according to each predicted resource difference data, until the target resource difference data meets the preset difference threshold judgment condition.
[0087] The above technical solution adjusts the historical time range based on the time adjustment rule when it is determined that the target resource difference data does not meet the preset difference threshold judgment condition, and determines the target resource difference data based on the historical resource usage data within the adjusted historical time range until the preset difference threshold judgment condition is met. By adaptively adjusting the historical time range, the historical resource usage data input to the model is dynamically changed, thereby ensuring the model prediction efficiency while improving the model's prediction accuracy for resource usage in future time periods.
[0088] It is understandable that, since one or more application services are deployed under different slave nodes, the computing resource utilization, CPU utilization, and memory usage among the slave nodes are not balanced. It is possible that some slave nodes have higher resource utilization, while some slave nodes have lower resource utilization. Therefore, based on the resource utilization and other indicator factors of each slave node, the application services under each slave node can be dynamically adjusted to ensure balanced resource utilization among the slave nodes.
[0089] In an optional embodiment, the node resource utilization rate of each slave node within a preset reference time period is obtained; based on the node resource utilization rate of each slave node, it is determined whether there are slave nodes to be adjusted and adjustable slave nodes; if so, the application services to be adjusted are determined based on the reference resource utilization rate of each application service in the slave node to be adjusted within the reference time period; and the application services to be adjusted are adjusted from the slave nodes to be adjusted to the adjustable slave nodes.
[0090] The reference time period may be preset by relevant technical personnel, for example, the reference time period may be 3 months. The node resource utilization rate of the slave node may include the computing resource utilization rate, CPU utilization rate, and memory occupancy rate of the slave node.
[0091] Among them, the slave node to be adjusted can be a slave node whose node resource utilization rate is greater than the first preset utilization rate threshold; the adjustable slave node can be a slave node whose node resource utilization rate is less than the second preset utilization rate threshold. For example, the first preset utilization rate threshold can be set to 80%, and the second preset utilization rate threshold can be set to 50%. Optionally, two slave nodes whose node resource utilization rates differ by more than the third preset utilization rate threshold can also be considered as slave nodes to be adjusted and adjustable slave nodes, wherein the node resource utilization rate of the slave node to be adjusted is greater than the node resource utilization rate of the adjustable slave node. For example, the third threshold utilization rate threshold can be set to 40%.
[0092] If there are slave nodes to be adjusted and adjustable slave nodes, the application services to be adjusted are determined according to the reference resource usage rates of the application services in the slave nodes to be adjusted within the reference time period, and the application services to be adjusted are adjusted from the slave nodes to be adjusted to the adjustable slave nodes. Specifically, the application services to be adjusted may be application services whose reference resource usage rates are sufficient to balance the node resource usage rates of the adjustable slave nodes and the nodes to be adjusted.
[0093] For example, if the slave node to be adjusted includes application server A, application service B and application service C, wherein the reference resource usage rate of application service A is 20%, the reference resource usage rate of application service B is 30%, and the reference resource usage rate of application service C is 40%. The node resource usage rate of the slave node to be adjusted is 90%. If the node resource usage rate of the adjustable slave node is 50%, then the application service A in the slave node to be adjusted is adjusted from the slave node to be adjusted to the adjustable slave node, so that the node resource usage rate of the slave node to be adjusted is reduced to 70%, and the node resource usage rate of the adjustable slave node is increased to 70%, so that the resource usage between the slave node to be adjusted and the adjustable slave node is balanced.
[0094] The above technical solution automatically and dynamically schedules or adjusts application services between slave nodes according to the node resource utilization rate of each slave node, thereby ensuring balanced resource utilization among the slave nodes and further improving the processing efficiency of application services under each slave node.
[0095] Embodiment 2
[0096] Figure 2 A flow chart of a service resource scheduling method provided for the second embodiment of the present invention. This embodiment provides a preferred example based on the above embodiment. This embodiment takes the financial institution scenario as an example and uses the existing cluster framework to build an AI computing power cluster, which consists of a master node and at least one node. The master node is responsible for cluster resource management, and the node node is responsible for providing AI computing power resources. By issuing daemon tasks under the master node, a dedicated container is created and deployed on each node node. Each container is responsible for collecting the resource utilization of the node node and sending it up. At least one financial AI service is deployed under each node node.
[0097] like Figure 2 As shown, the method comprises the following specific steps:
[0098] S21. The master node monitors the resource usage data of the slave node.
[0099] (1) Monitoring deployment: Deploy a daemonset on the master node of the AI computing cluster. The AI computing cluster can automatically distribute to each node and create containers. When the cluster is expanded or reduced in capacity, the containers of the node will be created or destroyed synchronously with the expansion or reduction of the cluster.
[0100] (2) Data selection: For the nodes deployed by the financial AI service, collect the AI computing power utilization (percentage), video memory usage (MB), memory usage (MB), and CPU utilization (percentage) of each node.
[0101] (3) Data sampling: The resource usage of each node is sampled regularly, with a sampling rate of once every minute.
[0102] (4) Data upload: The monitoring container of each node uploads the monitoring data (resource usage data) obtained in real time to the time series database.
[0103] S22. The master node analyzes the resource usage data sent by each slave node and predicts the resource usage data in the future time period.
[0104] (1) Data acquisition: Obtain time series resource usage data from the time series database.
[0105] (2) Data selection: Based on the data of the past N days (N ranges from 7 to 28 days), predict the resource demand for the next 7 days.
[0106] (3) Data analysis: Use the LSTM algorithm and ARIMA algorithm to analyze the collected past resource usage data and predict the resource usage data in the future time period.
[0107] S23. The master node allocates resources according to the predicted resource usage data of each node.
[0108] (1) Resource demand assessment process: Based on the resource usage data of the past N days, predict the resource demand for the next M days. Based on the predicted demand for the next 7 days, select the peak data of various indicators (CPU usage, AI computing power usage, memory usage, and current usage).
[0109] The value range of the past N days is 7 to 28 days, with 7 days as a unit, 0 to 7 days as T1, 0 to 14 days as T2, 0 to 21 days as T3, and 0 to 28 days as T4. During the resource evaluation process, the monitoring data of the T1 period is given priority, and the LSTM and ARIMA algorithms are used as a hybrid model to accept the monitoring input data of the T1 period to estimate the trend of the next 7 days. The arithmetic average of the output results of the two algorithms is taken as the final result of the prediction model. If the resource change trend of the next 7 days predicted by T1 differs from the actual change trend of the past 7 days by more than 10%, the monitoring period is further expanded to T2. If the change range still exceeds 10%, it is further expanded until T4. The average of all output results is taken as the final estimated resource demand value.
[0110] (2) Resource allocation process: Since financial AI services also have extremely high requirements for continuity and cannot tolerate abnormal AI services, it is necessary to appropriately configure redundant resources to ensure the continuity of AI services. Based on the peak data for the next 7 days predicted by the model, 120% of the demand is allocated to ensure the normal operation of AI services. Use docker container tools and AI computing resource virtualization tools to virtualize and divide resources for each node where AI services are deployed, and allocate computing resources to each AI service on demand.
[0111] This embodiment provides an efficient AI computing cluster resource management solution for financial institutions through real-time monitoring, accurate prediction, and flexible scheduling, which helps to improve overall business efficiency. The specific effects are as follows:
[0112] (1) Improve resource utilization: By real-time monitoring and predicting the resource usage of AI services, the present invention can achieve on-demand resource allocation, thereby significantly improving the resource utilization of the computing power cluster of financial institutions, making more efficient use of existing computing resources and reducing resource waste.
[0113] (2) Reduce costs: Efficient resource management reduces unnecessary resource idleness and over-allocation, thereby reducing the operating costs of financial institutions, including hardware costs and maintenance costs.
[0114] (3) Improving AI service performance: Through accurate resource prediction and flexible scheduling, we ensure that financial AI services can obtain sufficient computing resources when needed, thereby improving service performance and response speed. This is especially important for applications such as high-frequency trading and risk management in the financial field.
[0115] (5) Enhance the flexibility and scalability of cluster systems: Through computing power virtualization and automated resource scheduling, cluster systems can quickly adapt to the ever-changing needs of financial AI services, enhance the flexibility and scalability of cluster systems, and ensure that financial institutions can more easily cope with business growth and changes.
[0116] Embodiment 3
[0117] Figure 3 A schematic diagram of the structure of a service resource scheduling device provided in the third embodiment of the present invention. A service resource scheduling device provided in the embodiment of the present invention can be applied to the case of adaptively scheduling service resources for financial application services in the field of financial technology. The service resource scheduling device can be implemented in the form of hardware and / or software, such as Figure 3 As shown, the device specifically includes: a historical data acquisition module 301, a resource data prediction module 302, a to-be-allocated resource determination module 303 and a resource scheduling module 304.
[0118] The historical data acquisition module 301 is used to acquire the historical resource usage data of the corresponding application service within a preset historical time range for any slave node when the corresponding application service under the slave node meets the preset resource prediction condition;
[0119] The resource data prediction module 302 is used to determine the predicted resource usage data of the corresponding application service within a preset future time range based on the historical resource usage data of the corresponding application service;
[0120] The resource to be allocated determining module 303 is used to determine the resource data to be allocated for the corresponding application service according to the predicted resource usage data of the corresponding application service;
[0121] The resource scheduling module 304 is used to schedule service resources for each of the application services according to the to-be-allocated resource data corresponding to each of the application services.
[0122] The technical solution of the embodiment of the present invention determines the predicted resource usage data of the corresponding application service within a preset future time range based on the historical resource usage data of the corresponding application service, determines the to-be-allocated resource data of the corresponding application service based on the predicted resource usage data of the corresponding application service, and schedules service resources for each application service based on the to-be-allocated resource data corresponding to each application service, thereby realizing automatic scheduling of application services, and being able to allocate resources on demand during the resource scheduling process without the need for manual resource allocation by relevant technical personnel, thereby realizing reasonable allocation of service resources and improving resource scheduling efficiency. At the same time, through accurate resource prediction and flexible scheduling, it is ensured that application services can obtain sufficient computing resources when needed, thereby improving service performance and response speed.
[0123] Optionally, the resource data prediction module 302 includes:
[0124] A first resource prediction unit is configured to use a pre-trained first resource prediction model to predict resource usage for a corresponding application service based on the historical resource usage data, and obtain first predicted resource data within a future time range; and
[0125] A second resource prediction unit, configured to use a pre-trained second resource prediction model to predict resource usage for a corresponding application service based on the historical resource usage data, and obtain second predicted resource data within a future time range;
[0126] The predicted resource data determining unit is used to determine the predicted resource usage data of the corresponding application service within the future time range according to the first predicted resource data and the second predicted resource data.
[0127] Optionally, the predicted resource data determination unit includes:
[0128] a difference data determination subunit, configured to determine predicted resource difference data corresponding to each prediction indicator between the first predicted resource data and the second predicted resource data;
[0129] A target difference determination subunit, used to determine target resource difference data according to each of the predicted resource difference data;
[0130] The first resource prediction subunit is used to determine the predicted resource usage data of the corresponding financial service within the future time range based on the first predicted resource data and the second predicted resource data if the target resource difference data meets a preset difference threshold judgment condition.
[0131] Optionally, the predicted resource data determination unit further includes:
[0132] A second resource prediction sub-unit is used to, after determining the target resource difference data based on each of the predicted resource difference data, if the target resource difference data does not meet the preset difference threshold judgment condition, adjust the historical time range based on a preset time adjustment rule, and determine the target resource difference data based on the historical resource usage data within the adjusted historical time range, until the target resource difference data meets the preset difference threshold judgment condition.
[0133] Optionally, the resource to be allocated determining module 303 is specifically configured to:
[0134] Select the maximum resource usage data under each prediction indicator from the predicted resource usage data of the corresponding application service;
[0135] According to the preset demand allocation ratio, based on the maximum resource usage data under each of the forecast indicators, determine the target resource usage data;
[0136] The resource data to be allocated for the corresponding application service is determined according to the target resource usage data.
[0137] Optionally, the device further comprises:
[0138] A node utilization rate acquisition module, used to acquire the node resource utilization rate of each slave node within a preset reference time period;
[0139] A module for determining nodes to be adjusted, used for judging whether there are slave nodes to be adjusted and adjustable slave nodes according to the node resource utilization rate of each slave node;
[0140] A module for determining services to be adjusted, configured to determine the application services to be adjusted according to the reference resource usage rate of each application service in the slave node to be adjusted within the reference time period if there are slave nodes to be adjusted and adjustable slave nodes;
[0141] The application service adjustment module is used to adjust the application service to be adjusted from the slave node to be adjusted to the adjustable slave node.
[0142] The service resource scheduling device provided in the embodiment of the present invention can execute the service resource scheduling method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0143] Embodiment 4
[0144] Figure 4A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0145] like Figure 4 As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0146] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0147] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as a service resource scheduling method.
[0148] In some embodiments, the service resource scheduling method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the service resource scheduling method described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to execute the service resource scheduling method in any other appropriate manner (e.g., by means of firmware).
[0149] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0150] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0151] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0152] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0153] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0154] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0155] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0156] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A service resource scheduling method, characterized in that: A master node applied to a resource computing power cluster; the resource computing power cluster further comprises at least one slave node; at least one application service is deployed in each of the slave nodes, and the method comprises: For any slave node, when the corresponding application service under the slave node meets the preset resource prediction conditions, the historical resource usage data of the corresponding application service within the preset historical time range is obtained; Determine predicted resource usage data of the corresponding application service within a preset future time range based on the historical resource usage data of the corresponding application service; Determine the resource data to be allocated for the corresponding application service according to the predicted resource usage data of the corresponding application service; Service resources are scheduled for each application service according to the to-be-allocated resource data corresponding to each application service.
2. The method according to claim 1, characterized in that Determining predicted resource usage data of the corresponding application service within a preset future time range according to the historical resource usage data of the corresponding application service includes: Using a pre-trained first resource prediction model to predict resource usage for a corresponding application service based on the historical resource usage data, to obtain first predicted resource data within a future time range; and Using a pre-trained second resource prediction model to predict resource usage for a corresponding application service based on the historical resource usage data, to obtain second predicted resource data within a future time range; Determine predicted resource usage data of a corresponding application service within the future time range according to the first predicted resource data and the second predicted resource data.
3. The method according to claim 2, characterized in that The determining, according to the first predicted resource data and the second predicted resource data, predicted resource usage data of the corresponding application service within the future time range includes: Determine predicted resource difference data corresponding to each prediction indicator between the first predicted resource data and the second predicted resource data; Determining target resource difference data according to each of the predicted resource difference data; If the target resource difference data meets the preset difference threshold judgment condition, the predicted resource usage data of the corresponding financial service within the future time range is determined based on the first predicted resource data and the second predicted resource data.
4. The method according to claim 3, characterized in that: After determining the target resource difference data according to each of the predicted resource difference data, the method further includes: If the target resource difference data does not meet the preset difference threshold judgment condition, the historical time range is adjusted based on the preset time adjustment rule, and the target resource difference data is determined based on the historical resource usage data within the adjusted historical time range, until the target resource difference data meets the preset difference threshold judgment condition.
5. The method according to claim 1, characterized in that The step of determining the to-be-allocated resource data of the corresponding application service according to the predicted resource usage data of the corresponding application service comprises: Select the maximum resource usage data under each prediction indicator from the predicted resource usage data of the corresponding application service; According to the preset demand allocation ratio, based on the maximum resource usage data under each of the forecast indicators, determine the target resource usage data; The resource data to be allocated for the corresponding application service is determined according to the target resource usage data.
6. The method according to claim 1, characterized in that The method further comprises: Obtaining the node resource utilization rate of each of the slave nodes within a preset reference time period; According to the node resource utilization rate of each of the slave nodes, determining whether there are slave nodes to be adjusted and slave nodes that can be adjusted; If yes, determining the application service to be adjusted according to the reference resource usage rate of each application service in the slave node to be adjusted within the reference time period; The application service to be adjusted is adjusted from the slave node to be adjusted to the adjustable slave node.
7. A service resource scheduling device, characterized in that: A master node configured in a resource computing power cluster; the resource computing power cluster further comprises at least one slave node; at least one application service is deployed in each of the slave nodes, and the device comprises: A historical data acquisition module is used to acquire the historical resource usage data of the corresponding application service within a preset historical time range for any slave node when the corresponding application service under the slave node meets the preset resource prediction conditions; A resource data prediction module, used to determine predicted resource usage data of a corresponding application service within a preset future time range based on historical resource usage data of the corresponding application service; A module for determining resources to be allocated, used to determine the resource data to be allocated for the corresponding application service according to the predicted resource usage data of the corresponding application service; The resource scheduling module is used to schedule service resources for each of the application services according to the to-be-allocated resource data corresponding to each of the application services.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the service resource scheduling method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the service resource scheduling method according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the service resource scheduling method according to any one of claims 1 to 6.
Citation Information
Cited By
Server data supervision method and electronic equipment
CN120849222A
Resource data processing method and device, storage medium and electronic equipment
CN121563159A