Intelligent resource allocation method and device, storage medium and computer equipment
By receiving flexible resource threshold configuration requests and intelligent decision processing in the task scheduling system, and creating threshold configuration tables, the problem of uneven resource utilization is solved, and low invasive and efficient resource allocation is achieved, suitable for financial and medical scenarios.
Patent Information
- Application Number
- CN202510329609.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-07-04
AI Technical Summary
The existing task scheduling system has uneven resource utilization in financial and medical scenarios. The existing improvement methods are highly invasive and costly, and have a long development cycle, which is not suitable for the demand for rapid online launch.
The client receives flexible resource threshold configuration requests, creates a threshold configuration table, and combines the multi-dimensional information in the task scheduling request and the system resource situation of the registration center to make intelligent decision processing, obtain a list of available resources, and use the filtered resource list for task allocation to avoid directly obtaining system resources from the registration center.
It effectively solves the problem of uneven resource utilization, reduces the invasiveness of the original task scheduling system, shortens the development cycle, reduces costs, and improves resource allocation efficiency.
Smart Images

Figure CN120256109A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of resource management, in particular to the technical fields of finance and healthcare, and more particularly to an intelligent resource allocation method, apparatus, storage medium, and computer device. Background Art
[0002] Existing task scheduling systems face various challenges, especially in terms of resource utilization and task priority management. In distributed task scheduling systems in financial and healthcare scenarios, task distribution algorithms are mainly used when executing task distribution, such as the round-robin method (all instances execute in order), the weighted method (allocate according to the priority of the instance), the hash method (random rule), etc. However, in actual engineering applications, it is still encountered that when the load of a single machine is at a relatively high level, the scheduling system still allocates tasks, resulting in the phenomenon that the task runs beyond the load limit of the machine.
[0003] In order to improve the uneven resource utilization of the task scheduling system in financial and healthcare scenarios, existing methods improve the task scheduling system by developing a complete set of accurate prediction algorithms. However, this method has a large invasiveness to the existing task scheduling system, and has disadvantages such as high development cost, long development cycle, high labor cost, and slow system online cycle, and is not suitable for the financial and healthcare technology fields that require a fast online cycle. Therefore, there is an urgent need for a resource allocation method that has less invasiveness to the existing task scheduling system in financial and healthcare scenarios and can improve the problem of uneven resource utilization. Summary of the Invention
[0004] In view of this, the present invention provides an intelligent resource allocation method, apparatus, storage medium, and computer device, mainly aiming to solve the problem that when the resource utilization of the scheduling system is uneven, the existing improvement methods have large invasiveness to the scheduling system and high costs and long cycles.
[0005] According to one aspect of the present invention, an intelligent resource allocation method is provided, including:
[0006] Obtain a flexible resource threshold configuration request received by the client, and create a threshold configuration table based on the flexible resource threshold configuration request;
[0007] Receive a task scheduling request for a task to be executed, where the task scheduling request carries multi-dimensional environment-related information and task-related information;
[0008] Obtain the available resources of the system from the registration center, and perform intelligent decision-making processing based on the available resources of the system, the threshold configuration table, the multi-dimensional environment-related information, and the task-related information to obtain a list of available resources;
[0009] Perform resource allocation processing on the to-be-executed task based on the available resource list to obtain a target resource allocation result.
[0010] According to another aspect of the present invention, there is provided an intelligent resource allocation device, including:
[0011] A configuration module, configured to obtain a flexible resource threshold configuration request received by a client, and create a threshold configuration table based on the flexible resource threshold configuration request;
[0012] A scheduling request receiving module, configured to receive a task scheduling request for a to-be-executed task, where the task scheduling request carries multi-dimensional environment-related information and task-related information;
[0013] A decision-making processing module, configured to obtain the system available resource situation from a registration center, and perform intelligent decision-making processing based on the system available resource situation, the threshold configuration table, the multi-dimensional environment-related information, and the task-related information to obtain an available resource list;
[0014] A resource allocation module, configured to perform resource allocation processing on the to-be-executed task based on the available resource list to obtain a target resource allocation result.
[0015] According to still another aspect of the present invention, there is provided a storage medium, in which at least one executable instruction is stored, and the executable instruction causes a processor to perform operations corresponding to the above intelligent resource allocation method.
[0016] According to another aspect of the present invention, there is provided a computer device, including a processor, a memory, a communication interface, and a communication bus, where the processor, the memory, and the communication interface complete communication with each other through the communication bus;
[0017] The memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the above intelligent resource allocation method.
[0018] By means of the above technical solutions, the technical solutions provided by the embodiments of the present invention have at least the following advantages:
[0019] The present invention provides an intelligent resource allocation method, apparatus, storage medium, and computer device. Compared with the prior art, the present invention receives a flexible resource threshold configuration request from a client by the client, and then the server creates a threshold configuration table based on the content carried in the flexible resource threshold configuration request; when the server receives a task scheduling request for a task to be executed, the server obtains the available resources of the system from the registration center. Then, the server performs intelligent decision-making processing based on the multi-dimensional environment-related information and task-related information carried in the task scheduling request, as well as the created threshold configuration table and the available system resources obtained from the registration center, to obtain a list of available resources. The list of available resources obtained by the present invention is screened, which can effectively avoid the problem of uneven utilization of system resources. Finally, the server performs resource allocation processing on the task to be executed based on the list of available resources to obtain a target resource allocation result. The present invention uses the screened list of available resources to replace the available system resources directly obtained by the original scheduling system from the registration center, with less intrusion into the original task scheduling system, without the need to modify the underlying scheduling algorithm and mechanism, and has a short development cycle, low cost, and quick results.
[0020] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the present invention more obvious and understandable, the following specifically describes the embodiments of the present invention. Brief Description of the Drawings
[0021] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention. And throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0022] Figure 1 Shows a schematic diagram of an application environment of the intelligent resource allocation method provided by an embodiment of the present invention;
[0023] Figure 2 Shows a schematic flowchart of an intelligent resource allocation method provided by an embodiment of the present invention;
[0024] Figure 3 Shows a schematic flowchart of creating a threshold configuration table provided by an embodiment of the present invention;
[0025] Figure 4 Shows a schematic flowchart of obtaining the available resources of the system provided by an embodiment of the present invention;
[0026] Figure 5 Shows a schematic flowchart of intelligent decision-making processing provided by an embodiment of the present invention;
[0027] Figure 6 shows a schematic structural diagram of an intelligent resource allocation device provided by an embodiment of the present invention;
[0028] Figure 7 shows a schematic structural diagram of a computer device provided by an embodiment of the present invention. Detailed implementation manners
[0029] Hereinafter, exemplary embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.
[0030] The intelligent resource allocation method provided by the embodiment of the present invention can be applied in an application environment such as Figure 1 . Among them, the server is the main execution entity of the intelligent resource allocation method of the present invention. Among them, the client communicates with the server through the network. The server can receive a flexible resource threshold configuration request sent by the user through the client and create a threshold configuration table based on the flexible resource threshold configuration request; the server can also receive a task scheduling request of a task to be executed through the client, and the task scheduling request carries multi-dimensional environment-related information and task-related information; the server obtains the system available resource situation from the registration center, and performs intelligent decision-making processing based on the system available resource situation, the threshold configuration table, the multi-dimensional environment-related information and the task-related information to obtain an available resource list; finally, the server performs resource allocation processing on the task to be executed based on the available resource list to obtain a target resource allocation result, that is, allocates the task to be executed to Figure 1 the machine instance in
[0031] In the present invention, for complex task scheduling in the financial field and the medical field, the efficiency of resource allocation in this field can be improved and the phenomenon of uneven resource utilization in this field can be solved by combining flexible resource threshold configuration and intelligent decision-making. Among them, the client can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers and portable wearable devices. The server can be implemented by an independent server or a server cluster composed of multiple servers. Hereinafter, the present invention will be described in detail through specific embodiments.
[0032] Please refer to Figure 2 shown in Figure 2 which is a flowchart of an intelligent resource allocation method provided by an embodiment of the present invention, and includes the following steps:
[0033] 101. Obtain the flexible resource threshold configuration request received by the client, and create a threshold configuration table based on the flexible resource threshold configuration request;
[0034] In the embodiments of the present invention, the current execution end receives a flexible resource threshold configuration request through the client. Among them, the flexible resource threshold configuration request is a request submitted by the user to the client according to needs. For example, in the insurance application scenario in the financial technology field, different resource threshold configuration requirements can be submitted according to the type of insurance business; different resource threshold configuration requirements can also be submitted according to the specific functions of each functional module under the insurance business, etc., which are not specifically limited in the embodiments of the present invention. Another example is that in the diagnosis and treatment application scenario in the medical technology field, different resource threshold configuration requirements can be submitted according to different diagnosis and treatment processes; different resource threshold configuration requirements can also be submitted according to the IP of the diagnosis and treatment initiator, etc., which are not specifically limited in the embodiments of the present invention.
[0035] In this embodiment, after the current execution end obtains the flexible resource threshold configuration request, it also creates a threshold configuration table based on the flexible resource threshold configuration request. Among them, the threshold configuration table generally includes configuration item information, configuration item content, configuration type information, and thresholds corresponding to each configuration type. Among them, the configuration item information corresponds to the configuration item content. For example, if the configuration item information includes system, machine instance, server model, affiliated computer room, etc., then the corresponding configuration item content is set to the system name, specified IP, specific server model, affiliated computer room number, etc., which are not specifically limited in the embodiments of the present invention. Since each configuration item information is relatively specific, the resource threshold configuration requirements for the configuration item information in the embodiments of the present invention have the characteristics of personalization and can meet the personalized configuration needs of different users. Among them, rich types are supported in terms of configuration type information. For example, CPU usage, CPU temperature, memory usage, network usage, network response latency, application health check, database link response, etc., which are not specifically limited in the embodiments of the present invention.
[0036] 102. Receive the task scheduling request of the task to be executed, and the task scheduling request carries multi-dimensional environment-related information and task-related information;
[0037] In the embodiments of the present invention, the current execution end receives the task scheduling request of the task to be executed. Among them, the task to be executed represents a task that needs to be executed through resource scheduling. Among them, the task scheduling request carries multi-dimensional environment-related information and task-related information. The multi-dimensional environment-related information generally includes the system name related to the initiation of the task to be executed, the specific machine instance (IP address), the specific server model, the affiliated computer room number, etc., which are not specifically limited in the embodiments of the present invention. The task-related information generally includes the number of CPUs required for the task, the memory capacity required, the task priority, etc., which are not specifically limited in the embodiments of the present invention.
[0038] It should be noted that in the embodiments of the present invention, the task-related information may further include the resource consumption types configured by the user for each task to be executed. The resource consumption types are used to distinguish the resource usage requirements of the tasks to be executed, and are generally divided into high resource consumption types and low resource consumption types. The embodiments of the present invention do not make specific limitations.
[0039] 103. Obtain the system available resources from the registration center, and perform intelligent decision-making processing based on the system available resources, the threshold configuration table, the multi-dimensional environment-related information, and the task-related information to obtain a list of available resources;
[0040] In a task scheduling system, the registration center is a key component for managing and coordinating all aspects of task scheduling. The registration center has a centralized service directory for managing the metadata information of all tasks and executors in the task scheduling system. The registration center plays a role in decoupling the scheduling center and the executor in the task scheduling system.
[0041] In this embodiment, the current execution end obtains the system available resources from the registration center of the task scheduling system, and then performs intelligent decision-making processing based on the obtained system available resources, the multi-dimensional environment-related information of the tasks to be executed obtained in step 102, the task-related information, and the threshold configuration table created in step 101 to obtain a list of available resources. Among them, the intelligent decision-making processing represents the process of intelligent screening of the system available resources. The embodiments of the present invention do not make specific limitations.
[0042] 104. Perform resource allocation processing on the tasks to be executed based on the list of available resources to obtain a target resource allocation result.
[0043] In the embodiments of the present invention, the current execution end performs resource allocation processing on the tasks to be executed based on the list of available resources screened in step 104, that is, performs task assignment. Among them, when performing resource allocation processing, the task allocation algorithms in the original task scheduling system can be used, for example, the round-robin method (all instances are executed in turn), the weighted method (allocated according to the priority of the instances), the hash method (random rule), etc. The embodiments of the present invention do not make specific limitations. Finally, a target resource allocation result is obtained.
[0044] It should be noted that in this embodiment, using the task allocation algorithm of the original task scheduling system has little invasiveness to the original task scheduling system, does not require modification of the underlying scheduling algorithm and mechanism, is relatively convenient, and the system goes online faster and more efficiently.
[0045] Further, as a refinement and extension of the specific implementation of the above embodiments, in order to meet the personalized needs of users, personalized threshold configuration is performed on the task scheduling system, and another intelligent resource allocation method is provided. As Figure 3 shown, the steps create a threshold configuration table based on the flexible resource threshold configuration request, including:
[0046] 201. Obtain the information of the item to be configured and the information of the type to be configured;
[0047] In the embodiment of the present invention, first, the client receives the trigger operation of the user, and determines the information of the item to be configured and the information of the type to be configured triggered by the user according to the trigger operation of the user. Then, the current execution end directly obtains the information of the item to be configured and the information of the type to be configured determined by the user side based on network communication.
[0048] In the insurance application scenario in the financial technology field, different information of the item to be configured can be configured according to the main business of the insurance system. For example, System A is mainly responsible for file processing, and System B is mainly responsible for querying and presenting to customers; thus, the system can be determined as the information of the item to be configured, and the CPU usage and memory usage can be determined as the information of the type to be configured.
[0049] 202. Obtain the content of the configuration item corresponding to the information of the item to be configured; and obtain the threshold corresponding to the information of the type to be configured;
[0050] In the embodiment of the present invention, similar to step 201, first, the client receives the input operation of the user, determines the content of the configuration item corresponding to the information of the item to be configured according to the content information input by the user, and determines the threshold corresponding to the information of the type to be configured. Then, the current execution end directly obtains the content of the configuration item determined by the user side and the threshold corresponding to the information of the type to be configured based on network communication.
[0051] In step 201, different to-be-configured item information is configured for the main businesses of the insurance system. In actual production applications, querying and presenting to customers have a greater impact. Therefore, the stability of this system is often emphasized. Since the system for processing files is not perceptible to customers, some compromises can be made appropriately for processing efficiency and the like. Therefore, when configuring, the user can configure the threshold corresponding to the to-be-configured type information of the machine instances required by system B as: CPU usage rate of 70%, memory usage of 200 mb. That is, when the CPU usage rate of the machine instance exceeds 70% and / or the available memory is less than 200 mb, then this machine instance cannot be used to execute the to-be-executed tasks of system B. However, for system A with high performance requirements, the threshold corresponding to the to-be-configured type information of the required machine instances is: CPU usage rate of 50%, memory usage of 300 mb. That is, when the CPU usage rate of the machine instance exceeds 50% and / or the available memory is less than 300 mb, then this machine instance cannot be used to execute the to-be-executed tasks of system A.
[0052] It should be noted that in step 201 and step 202, when configuring, first select the dimension to be configured, and then select the corresponding configuration type. In addition to the configuration for the system dimension in the above-described insurance application scenario, configurations can also be made for different dimensions such as server models and the affiliated computer rooms. For example, for a specific server model, for a server with better performance, the configured threshold can be that the recommended CPU usage rate is below 70%, and the recommended memory usage is not less than 200 mb, etc.; however, for a server with poor performance, the configured threshold can be that the recommended CPU usage rate is below 50%, and the recommended memory usage is not less than 300 mb, etc. When configuring a large-scale cluster such as a server model or an affiliated computer room, the current execution end will pull the machine resources (IP) owned by the configuration server or computer room from the registration center. When intelligent decision-making is required, this information and its corresponding configuration information will be given to the intelligent decision-making together.
[0053] 203. Create the threshold configuration table based on the to-be-configured item information, the configuration item content, the to-be-configured type information, and the threshold corresponding to the to-be-configured type information.
[0054] In the embodiment of the present invention, the current execution end creates a threshold configuration table based on the to-be-configured item information corresponding to the configuration dimension and the configuration item content, as well as the selected to-be-configured type information and the threshold corresponding to the to-be-configured type information determined by the user through input. Since the personalized requirements of users are different, the threshold configuration table created in the current execution end can include multiple to-be-configured item information and multiple to-be-configured type information, and the embodiment of the present invention does not make specific limitations.
[0055] Further, as a refinement and extension of the specific implementation of the above embodiments, in order to ensure that the scheduled resources are in an available state and avoid serious problems such as system downtime, another intelligent resource allocation method is provided. As Figure 4 shown, the steps are to obtain the system available resource situation from the registration center, including:
[0056] 301. The registration center determines whether each machine instance in the registered machine instance list is available;
[0057] 302. Obtain the resource usage corresponding to each available machine instance, and perform a summary process on the resource usage to obtain the system available resource situation;
[0058] 303. After receiving an available resource query request, the registration center outputs the system available resource situation.
[0059] In the embodiment of the present invention, since the machine instances that have submitted registration applications to the registration center may be in an abnormal working state, it is necessary to first exclude the machine instances in the abnormal working state to obtain the system available resource situation. Specifically, the registration center first judges the working state of each machine instance in the registered machine instance list. When the working state of a machine instance is abnormal, the machine instance is determined as a non-available machine instance. After excluding all non-available machine instances in the system, available machine instances are obtained. Then, the registration center obtains the resource usage corresponding to each available machine instance. Among them, the resource usage includes CPU usage, CPU temperature, memory usage, network usage, network response latency, application health check situation, database link response, etc., which are not specifically limited in the embodiment of the present invention. And after obtaining the resource usage corresponding to all available machine instances, a summary process is performed on the obtained resource usage to obtain the system available resource situation. The current execution end sends an available resource query request to the registration center. When the registration center receives the available resource query request, it feeds back the system available resource situation to the current execution end.
[0060] It should be noted that before the step of obtaining the system available resource situation from the registration center, the method further includes: the registration center receives the registration applications of each machine instance; the registration center performs registration processing on each machine instance based on the registration application to obtain a registered machine instance list. After a machine instance is registered in the registration center, it is also necessary to periodically synchronize its available resource situation to the registration center of the distributed task scheduling, including performance resource elements such as CPU usage, memory RAM usage, network usage, network response latency, application health check situation, database link response, etc., which are not specifically limited in the embodiment of the present invention.
[0061] Further, as a refinement and extension of the specific implementation manner of the above embodiment, in order to further screen and process the system available resource situation fed back by the registry and meet the personalized needs of different users, another intelligent resource allocation method is provided. As Figure 5 shown, the steps perform intelligent decision-making processing based on the system available resource situation, the threshold configuration table, the multi-dimensional environment related information, and / or the task related information to obtain an available resource list, including:
[0062] 401. Match the multi-dimensional environment related information with the configuration item content corresponding to each configuration item information in the threshold configuration table to obtain a configuration item matching result;
[0063] In the embodiment of the present invention, the current execution end first performs matching and screening based on different dimensions. Specifically, before matching the configuration items, the configuration item content corresponding to each configuration item information is obtained from the threshold configuration table created in steps 201 to 203. Then, the multi-dimensional environment related information related to the task to be executed is matched with each configuration item content to obtain a configuration item matching result. For example, if the configuration item content obtained from the threshold configuration table includes the system name of system A, then the multi-dimensional environment related information of the task to be executed is matched with the system name of system A; if the configuration item content obtained from the threshold configuration table includes the model of server C, then the multi-dimensional environment related information of the task to be executed is matched with the model of server C; if the configuration item content obtained from the threshold configuration table includes the number of computer room D, then the multi-dimensional environment related information of the task to be executed is matched with the number of computer room D, etc. The embodiment of the present invention does not make specific limitations.
[0064] It should be noted that for a specific machine instance (specified IP), after the current execution end configures a specific IP instance, the intelligent decision-making processing performs single-machine judgment by combining the entire system available resource situation provided by the registry with the specific IP instance configuration of flexible resource allocation. The configuration dimension has strong pertinence. In addition, for the affiliated computer room, the significance of performance configuration usage will be weakened, but this flexible configuration can be used to achieve the switch of computer room in disguise. For example, if the CPU recommended for computer room A is configured to be 0, then when task allocation is performed, the intelligent decision-making will not provide the machine list of computer room A in the scheduling system, but provide the machine list of non-computer room A. The embodiment of the present invention does not make specific limitations.
[0065] In this embodiment, the configuration item matching result includes the information of the successfully matched configuration items and the information of the unsuccessfully matched configuration items. Among them, the information of the successfully matched configuration items indicates that the user has configured the requirements of the task to be executed from the environmental dimension, and it is necessary to then execute step 402 for the first screening process; the information of the unsuccessfully matched configuration items indicates that the user has not configured the requirements of the task to be executed from the environmental dimension, and it is possible to directly jump to step 403 for the second screening process.
[0066] 402. Perform a first screening process on the system available resource situation based on the configuration item matching result, the configuration type information, and the thresholds corresponding to each configuration type to obtain a first screening result;
[0067] In the embodiment of the present invention, based on the configuration item matching result, if the system name of system A is successfully matched, the current execution end obtains the configuration type information corresponding to the system name of system A, including CPU usage rate and memory usage, as well as the threshold of 50% corresponding to the CPU usage rate, the threshold of 300 mb corresponding to the memory usage, etc., which are not specifically limited in the embodiment of the present invention. When performing the first screening process, the current execution end excludes the machine instances with a CPU usage rate exceeding 50% and / or available memory not less than 300 mb from the system available resource situation to obtain the filtered first screening result, which is not specifically limited in the embodiment of the present invention.
[0068] In this embodiment, system A can be a vehicle insurance system, a health insurance system, an old-age insurance system, etc. in the insurance application scenario in the field of financial technology, which is not specifically limited in the embodiment of the present invention. It can also be a registration system, a consultation system, a medical device procurement system, etc. in the field of medical technology, which is not specifically limited in the embodiment of the present invention.
[0069] 403. Perform a second screening process on the system available resource situation based on the task-related information, the configuration type information, and the thresholds corresponding to each configuration type to obtain a second screening result;
[0070] 404. Obtain the available resource list based on the first screening result and / or the second screening result.
[0071] In the embodiments of the present invention, the current execution end may further perform a second screening process on the system's available resources based on the task-related information carried by the task to be executed. Among them, the task-related information of the task to be executed is determined according to the performance of the task in the test stage. For example, during the task test stage, developers classify tasks into high-resource consumption types and low-resource consumption types according to the resource consumption of the tasks, and then use category labels to label the tasks. Once the labeled task becomes a task to be executed and resource allocation is required, task scheduling can be performed based on the labeled resource consumption type. For example, there is a system A with several tasks to be executed, namely job1, job2, job3... Among them, job1 is a low-resource consumption task, and job2 is a high-resource consumption task. Then the resource threshold configuration for job1 is: CPU usage rate 70%, memory usage 100mb, etc. That is, during the second screening process, machine instances with a CPU usage rate exceeding 70% or available memory less than 200mb are excluded from the system's available resources. Similarly, for the high-resource consumption task of job2, the resource threshold can be configured specifically as: CPU usage rate 40%, memory usage 300mb, etc. That is, during the second screening process, machine instances with a CPU usage rate exceeding 40% or available memory less than 300mb are excluded from the system's available resources, etc. The embodiments of the present invention do not make specific limitations. After the system's available resources have undergone the above-mentioned first screening process and / or second screening process, an available resource list that meets personalized requirements is obtained.
[0072] It should be noted that since the problem of uneven resource allocation has been considered in the personalized configuration stage, the machine instances in the obtained available resource list are machine instances that can be used for resource allocation, which can effectively avoid the problem of excessive load level of a single machine instance.
[0073] Furthermore, as a refinement and extension of the specific implementation manner of the above embodiment, in order to effectively handle the sudden situation of machine instances without available resources and avoid system downtime, another intelligent resource allocation method is provided. The method further includes:
[0074] When the available resource list is empty, a dynamic expansion application is sent to the container management platform;
[0075] Receive the dynamically expanded machine instances fed back by the container management platform; allocate the task to be executed to the dynamically expanded machine instances for execution.
[0076] In the embodiments of the present invention, the current execution end makes a decision through steps 401 to 404 in combination with the machine information and resource threshold configuration provided by the registration center, eliminates the machine instances that do not meet the resource configuration from the system available resources, obtains the final available resource list, and passes the available resource list to the task scheduling system for task assignment. If the final available resource list is empty, an abnormal degradation is performed, the intelligent decision result is rolled back, and all the system available resources provided by the registration center are directly provided to the task scheduling system. At the same time, in this embodiment, the current execution end also needs to enable an emergency mechanism. Specifically, when there is no available resource machine, that is, when the available resource list is empty, the current execution end will trigger an automatic optimization mechanism: send a dynamic expansion application to the container management platform by accessing the container management platform or other means, so as to perform dynamic expansion processing, and receive the dynamically expanded machine instances fed back by the container management platform; assign the tasks to be executed to the dynamically expanded machine instances for execution. Among them, the container management platform can be a container management platform such as kubernetes, and the embodiments of the present invention do not make specific limitations.
[0077] It should be noted that when the available resource list is empty, it can also be reported to the maintenance personnel in the form of email or text message for attention and intervention.
[0078] An example of the automatic optimization mechanism for dynamic expansion is as follows:
[0079] Premise conditions: There is a task scheduling job2 in System A, and there are three machines, m1 (high load), m2 (high load), and m3 (high load). The original distributed scheduling uses the general round-robin allocation method, and m1 has been allocated in the most recent time.
[0080] The current execution end starts the scheduling task decision of job2: First, the registration center discovers that there are three machines, m1, m2, and m3, running online normally. During the intelligent decision-making process, based on the comparison with the resource configuration threshold, it is judged that the real-time resources of m1, m2, and m3 are all in a high-load state, and all are excluded. Then, the above-mentioned automatic optimization mechanism is triggered for dynamic expansion. Abandon the decision of the available instance list, and still send the final available instance list: m1, m2, m3, to the distributed scheduling system; at the same time, perform dynamic expansion through a container management platform such as kubernetes, apply for instance m4, and send emails and text messages to notify the maintenance personnel to intervene.
[0081] After the scheduling system obtains the available instance list, through its inherent allocation mechanism, the round-robin method, it assigns the job2 task to the m2 machine instance for execution; but there will be a newly applied m4 machine instance in the next execution, and the embodiments of the present invention do not make specific limitations.
[0082] An embodiment of the present invention provides an intelligent resource allocation method. Compared with the prior art, in the present invention, the client receives a flexible resource threshold configuration request from the user, and then the server creates a threshold configuration table based on the content carried in the flexible resource threshold configuration request; when the server receives a task scheduling request for a task to be executed, the server obtains the available resources of the system from the registration center. Then, the server performs intelligent decision-making processing based on the multi-dimensional environment-related information and task-related information carried in the task scheduling request, as well as the created threshold configuration table and the available system resources obtained from the registration center, to obtain a list of available resources. The list of available resources obtained in the present invention is screened, which can effectively avoid the problem of uneven utilization of system resources. Finally, the server performs resource allocation processing on the task to be executed based on the list of available resources to obtain a target resource allocation result. The present invention uses the screened list of available resources to replace the available system resources directly obtained by the original scheduling system from the registration center, with less intrusion into the original task scheduling system, without the need to modify the underlying scheduling algorithm and mechanism, and has a short development cycle, low cost, and quick results.
[0083] As an implementation of the method described above Figure 1 An embodiment of the present invention provides an intelligent resource allocation device, as Figure 6 shown, the device includes:
[0084] A configuration module 51, configured to obtain a flexible resource threshold configuration request received by the client, and create a threshold configuration table based on the flexible resource threshold configuration request;
[0085] A scheduling request receiving module 52, configured to receive a task scheduling request for a task to be executed, where the task scheduling request carries multi-dimensional environment-related information and task-related information;
[0086] A decision-making processing module 53, configured to obtain the available resources of the system from the registration center, and perform intelligent decision-making processing based on the available resources of the system, the threshold configuration table, the multi-dimensional environment-related information, and the task-related information to obtain a list of available resources;
[0087] A resource allocation module 54, configured to perform resource allocation processing on the task to be executed based on the list of available resources to obtain a target resource allocation result.
[0088] Further, the configuration module 51 is further configured to:
[0089] Obtain information on items to be configured and information on types of items to be configured;
[0090] Obtain the content of the configuration item corresponding to the information on the item to be configured; and obtain the threshold corresponding to the information on the type of item to be configured;
[0091] Create the threshold configuration table based on the to-be-configured item information, the configured item content, the to-be-configured type information, and the threshold corresponding to the to-be-configured type information.
[0092] Further, the device further includes a registration module for:
[0093] Receive registration applications from each machine instance by the registration center;
[0094] The registration center performs registration processing on each machine instance based on the registration application to obtain a list of registered machine instances.
[0095] Further, the decision processing module 53 includes an available resource judgment unit, and the available resource judgment unit is used for:
[0096] Judge whether each machine instance in the list of registered machine instances is available by the registration center;
[0097] Obtain the resource usage corresponding to each available machine instance, and perform summary processing on the resource usage to obtain the system available resource situation;
[0098] After receiving an available resource query request, the registration center outputs the system available resource situation.
[0099] Further, the decision processing module 53 further includes a resource screening unit, and the resource screening unit is used for:
[0100] Match the multi-dimensional environment related information with the configured item content corresponding to each configured item information in the threshold configuration table to obtain a configured item matching result;
[0101] Perform a first screening process on the system available resource situation based on the configured item matching result, the configuration type information, and the threshold corresponding to each configuration type to obtain a first screening result; and / or
[0102] Perform a second screening process on the system available resource situation based on the task related information, the configuration type information, and the threshold corresponding to each configuration type to obtain a second screening result;
[0103] Obtain the available resource list based on the first screening result and / or the second screening result.
[0104] Further, the device further includes a task related information configuration module, and the task related information configuration module is used for:
[0105] Divide the to-be-executed task into a high resource consumption type or a low resource consumption type based on the performance of the to-be-executed task in the test phase;
[0106] Determine the high resource consumption type or the low resource consumption type as the task-related information.
[0107] Furthermore, the device further includes a dynamic expansion module, and the dynamic expansion module is configured to:
[0108] When the available resource list is empty, send a dynamic expansion application to the container management platform;
[0109] Receive the dynamically expanded machine instance fed back by the container management platform; allocate the to-be-executed task to the dynamically expanded machine instance for execution.
[0110] An embodiment of the present invention provides an intelligent resource allocation device. Compared with the prior art, the present invention receives a flexible resource threshold configuration request from a client through the client, and then the server creates a threshold configuration table based on the content carried in the flexible resource threshold configuration request; when the server receives a task scheduling request for a to-be-executed task, the server obtains the system available resource situation from the registration center. Then, the server performs intelligent decision-making processing based on the multi-dimensional environment-related information and task-related information carried in the task scheduling request, as well as the created threshold configuration table and the system available resource situation obtained from the registration center, to obtain an available resource list. The available resource list obtained by the present invention is obtained through screening, which can effectively avoid the problem of uneven utilization of system resources. Finally, the server performs resource allocation processing on the to-be-executed task based on the available resource list to obtain a target resource allocation result. The present invention uses the screened available resource list to replace the system available resource situation directly obtained from the registration center by the original scheduling system, has less invasiveness to the original task scheduling system, does not need to modify the underlying scheduling algorithm and mechanism, and has a short development cycle, low cost, and quick results.
[0111] According to an embodiment of the present invention, a storage medium is provided. The storage medium stores at least one executable instruction, and the computer executable instruction can execute the intelligent resource allocation method in any of the above method embodiments, including:
[0112] Obtain the flexible resource threshold configuration request received by the client, and create a threshold configuration table based on the flexible resource threshold configuration request;
[0113] Receive a task scheduling request for a to-be-executed task, where the task scheduling request carries multi-dimensional environment-related information and task-related information;
[0114] Obtain the system available resource situation from the registration center, and perform intelligent decision-making processing based on the system available resource situation, the threshold configuration table, the multi-dimensional environment-related information, and the task-related information to obtain an available resource list;
[0115] Perform resource allocation processing on the to-be-executed task based on the available resource list to obtain a target resource allocation result.
[0116] Figure 6 FIG. 4 shows a schematic structural diagram of a computer device according to an embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the computer device.
[0117] As Figure 6 shown, the computer device may include: a processor 602, a communication interface 604, a memory 606, and a communication bus 608.
[0118] Among them: the processor 602, the communication interface 604, and the memory 606 communicate with each other through the communication bus 608.
[0119] The communication interface 604 is used to communicate with network elements of other devices such as clients or other servers.
[0120] The processor 602 is used to execute the program 610, and specifically can execute the relevant steps of the above intelligent resource allocation method.
[0121] Specifically, the program 610 may include program code, and the program code includes computer operation instructions.
[0122] The processor 602 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention. One or more processors included in the computer device may be of the same type of processor, such as one or more CPUs; or may be of different types of processors, such as one or more CPUs and one or more ASICs.
[0123] The memory 606 is used to store the program 610. The memory 606 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.
[0124] The program 610 is specifically used to cause the processor 602 to perform the following operations:
[0125] Obtain a flexible resource threshold configuration request received by the client, and create a threshold configuration table based on the flexible resource threshold configuration request;
[0126] Receive a task scheduling request for a task to be executed, where the task scheduling request carries multi-dimensional environment-related information and task-related information;
[0127] Obtain the system's available resources from the registration center, and perform intelligent decision-making processing based on the system's available resources, the threshold configuration table, the multi-dimensional environment-related information, and the task-related information to obtain a list of available resources;
[0128] Perform resource allocation processing on the task to be executed based on the list of available resources to obtain a target resource allocation result.
[0129] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules respectively, or multiple modules or steps among them can be made into a single integrated circuit module to implement. In this way, the present invention is not limited to any specific combination of hardware and software.
[0130] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An intelligent resource allocation method, characterized in that, Including: Obtain a flexible resource threshold configuration request received by a client, and create a threshold configuration table based on the flexible resource threshold configuration request; Receive a task scheduling request for a task to be executed, where the task scheduling request carries multi-dimensional environment-related information and task-related information; Obtain the system available resource situation from a registration center, and perform intelligent decision-making processing based on the system available resource situation, the threshold configuration table, the multi-dimensional environment-related information, and the task-related information to obtain an available resource list; Perform resource allocation processing on the task to be executed based on the available resource list to obtain a target resource allocation result.
2. The method according to claim 1, characterized in that, The creating the threshold configuration table based on the flexible resource threshold configuration request includes: Obtain information on items to be configured and information on types to be configured; Obtain the content of the configuration item corresponding to the information on the item to be configured; and obtain the threshold corresponding to the information on the type to be configured; Create the threshold configuration table based on the information on the item to be configured, the content of the configuration item, the information on the type to be configured, and the threshold corresponding to the information on the type to be configured.
3. The method according to claim 1, characterized in that, Before obtaining the system available resource situation from the registration center, the method further includes: The registration center receives registration applications from each machine instance; The registration center performs registration processing on each machine instance based on the registration application to obtain a list of registered machine instances.
4. The method according to claim 3, characterized in that, The obtaining the system available resource situation from the registration center includes: The registration center determines whether each machine instance in the list of registered machine instances is available; Obtain the resource usage situation corresponding to each available machine instance, and perform summary processing on the resource usage situation to obtain the system available resource situation; After receiving an available resource query request, the registration center outputs the system available resource situation.
5. The method according to claim 1, wherein The threshold configuration table includes configuration item information, configuration item content, configuration type information, and thresholds corresponding to each configuration type; The performing intelligent decision-making processing based on the system available resource situation, the threshold configuration table, the multi-dimensional environment-related information, and / or the task-related information to obtain an available resource list includes: Match the multi-dimensional environment-related information with the configuration item content corresponding to each configuration item information in the threshold configuration table to obtain a configuration item matching result; Perform a first screening process on the system available resource situation based on the configuration item matching result, the configuration type information, and the thresholds corresponding to each configuration type to obtain a first screening result; and / or Perform a second screening process on the system available resource situation based on the task-related information, the configuration type information, and the thresholds corresponding to each configuration type to obtain a second screening result; Obtain the available resource list based on the first screening result and / or the second screening result.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Classify the task to be executed into a high resource consumption type or a low resource consumption type based on the performance of the task to be executed in the test phase; Determine the high resource consumption type or the low resource consumption type as the task-related information.
7. The method according to claim 6, wherein The method further includes: When the available resource list is empty, send a dynamic expansion application to the container management platform; Receive the dynamically expanded machine instances fed back by the container management platform; assign the tasks to be executed to the dynamically expanded machine instances for execution.
8. An intelligent resource allocation device, characterized in that, Including: A configuration module, configured to obtain a flexible resource threshold configuration request received by the client, and create a threshold configuration table based on the flexible resource threshold configuration request; A scheduling request receiving module, configured to receive a task scheduling request for a task to be executed, where the task scheduling request carries multi-dimensional environment-related information and task-related information; A decision-making processing module, configured to obtain the system available resource situation from the registration center, and perform intelligent decision-making processing based on the system available resource situation, the threshold configuration table, the multi-dimensional environment-related information, and the task-related information to obtain an available resource list; A resource allocation module, configured to perform resource allocation processing on the tasks to be executed based on the available resource list to obtain a target resource allocation result.
9. A storage medium, in which at least one executable instruction is stored, and the executable instruction performs an operation corresponding to the intelligent resource allocation method according to any one of claims 1-7.
10. A computer device, including a processor, a memory, a communication interface, and a communication bus, where the processor, the memory, and the communication interface complete communication with each other through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform an operation corresponding to the intelligent resource allocation method according to any one of claims 1-7.