A cluster resource scheduling method, system, device and storage medium
By using a cluster resource scheduling method that distinguishes between fixed and variable intervals and optimizes resource scheduling strategies, the problem of uneven resource allocation in automotive controller software test bench clusters is solved, improving resource utilization and management efficiency while reducing costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- UNITED AUTOMOTIVE ELECTRONICS SYST
- Filing Date
- 2024-12-27
- Publication Date
- 2026-06-30
AI Technical Summary
Existing automotive controller software test bench clusters suffer from inefficiency, error-proneness, and uneven resource allocation in resource reservation and scheduling, leading to wasted test resources and project delays.
A cluster resource scheduling method is adopted. By obtaining the task queue and the scheduled time period, the fixed interval and the variable interval are distinguished. The pre-set scheduling strategy is used to optimize resource allocation, including the fixed interval scheduling strategy and the variable interval scheduling strategy. The rationality of the scheduled application is verified, and the task queue management and resource utilization are optimized.
This improved the utilization rate of node resources, reduced investment and personnel costs, ensured the timely completion of test projects, and enhanced the efficiency and accuracy of resource management.
Smart Images

Figure CN122309556A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer software technology, specifically to a cluster resource scheduling method, system, device, and storage medium. Background Technology
[0002] In the development and testing process of automotive controller software, test bench clusters play a crucial role. These clusters typically consist of multiple test benches, each equipped with auxiliary servers, bus systems, board resources, and corresponding control servers, collectively supporting complex testing requirements. As the complexity of automotive controller software continues to increase, the testing workload also becomes increasingly heavy, placing higher demands on the resource scheduling and management of test bench clusters. In practical applications, automotive controller software test bench clusters often need to support multiple types of test projects simultaneously, which may be based on different testing requirements and technical approaches. User needs are also diverse, including both manual script debugging and test execution, as well as triggering continuous integration / continuous deployment (CICD) pipelines based on automated test engineering. This diverse use case makes resource scheduling particularly complex.
[0003] However, most current automotive controller software test benches or test bench clusters have significant shortcomings in resource reservation and scheduling. Many systems still use traditional form-filling methods for resource reservation, which is not only inefficient but also prone to errors. Furthermore, during peak reservation periods, the lack of effective resource coordination and allocation strategies often leads to a shortage of test resources. This not only wastes valuable test resources but may also cause test projects to fail to complete on time due to uneven resource allocation, thus affecting the progress and quality of the entire software development process. Summary of the Invention
[0004] In view of the shortcomings of the above-mentioned related technologies, this application provides a cluster resource scheduling method, system, device and storage medium to solve the technical problem of unreasonable allocation of test resources.
[0005] This application provides a cluster resource scheduling method, which includes: acquiring multiple task queues of node resources, each task queue including multiple scheduled tasks and corresponding scheduled time periods; determining queue intervals for the multiple scheduled tasks based on the scheduled time periods, the queue intervals including fixed intervals and variable intervals; if a scheduled task is in the fixed interval, executing the scheduled task in the fixed interval of each task queue based on a pre-set fixed interval scheduling strategy; if a scheduled task is in the variable interval, executing the scheduled task in the variable interval of each task queue based on a pre-set variable interval scheduling strategy.
[0006] In one embodiment of this application, before acquiring the task queue of multiple node resources, the method further includes: if a reservation request is received, performing a reasonableness check on the reservation request based on the reservation item, wherein the reservation request includes at least a reservation time period, a reservation item, and the task priority; if the reasonableness check passes, determining at least one node resource as a target node resource based on the reservation item; if the reservation time period of the reservation request is not reserved in the task queue of the target node resource, adding the reservation request as a reservation task to the task queue of the target node resource. If the reasonableness check fails, or the reservation time period of the reservation request is already reserved in the task queue of the target node resource, rejecting the reservation request and returning a rejection reason.
[0007] In one embodiment of this application, if the scheduled task is within the fixed interval, executing the scheduled task within the fixed interval in each task queue based on a pre-set fixed interval scheduling strategy includes: if the current time is later than or equal to the start time of the current task in the task queue, and the previous task in the task queue has been completed or interrupted, then the current task is started, and the scheduled time period includes the start time and the end time; if the current time is earlier than or equal to the end time of the current task in the task queue, and the current task has been completed, then the next task is started when the current time is equal to the start time of the next task in the task queue; if the current time is later than the end time of the current task in the task queue, and the current task has not been completed, then the current task is interrupted, and the next task is started when the current time is equal to the start time of the next task in the task queue.
[0008] In one embodiment of this application, if the scheduled task is within the variable interval, executing the scheduled task in the variable interval of each task queue based on the variable interval scheduling strategy includes: if the previous task in the task queue has been completed, and the time difference between the termination time of the previous task and the start time of the current task exceeds a preset difference threshold, then the scheduled time period of the current task is updated based on the current time and the current task is started; the subsequent scheduled tasks in the task queue are moved forward one by one for execution, and the scheduled time period of the subsequent scheduled tasks is updated.
[0009] In one embodiment of this application, if the reservation task is within the variable interval, executing the reservation tasks in the variable interval of each task queue based on the variable interval scheduling strategy further includes: if the previous task in the task queue times out and there is a higher-level reservation task among the subsequent reservation tasks, and the current time is equal to or later than the start time of the higher-level reservation task, then the previous task is interrupted, and the subsequent reservation tasks are reordered based on the task priority and reservation time period of the subsequent reservation tasks, wherein the higher-level reservation task is a reservation task among the subsequent reservation tasks with a higher task priority than the previous task; if the previous task in the task queue times out and there is a reservation task of the same level among the subsequent reservation tasks, and the current time is equal to or later than the start time of the reservation task of the same level, then a timeout timer is started, and the previous task is interrupted when the timeout timer ends, and the subsequent reservation tasks are reordered based on the task priority and reservation time period of the subsequent reservation tasks; if the previous task in the task queue times out and there is no higher-level reservation task or the same-level reservation task among the subsequent reservation tasks, then the previous task continues to be executed, and the subsequent reservation tasks are moved to the next available time.
[0010] In one embodiment of this application, if the reservation task is within the variable interval, executing the reservation tasks in the variable interval of each task queue based on the variable interval scheduling strategy further includes: if the previous task in the task queue times out and there is a higher-level reservation task or a same-level reservation task among the subsequent reservation tasks, and the current time is equal to the start time of the higher-level reservation task or the same-level reservation task, before interrupting the previous task, the method further includes: sending an interruption confirmation request to the reservation user of the previous task; if the interruption confirmation feedback returned by the reservation user is confirmation of interruption or no response after timeout, then the previous task is interrupted and the subsequent reservation tasks are reordered based on the task priority and reservation time period of the subsequent reservation tasks; if the interruption confirmation feedback returned by the reservation user is confirmation of no interruption, then the previous task continues to be executed, and after waiting for a preset buffer time, an interruption notification is sent to the reservation user, and the previous task is interrupted.
[0011] In one embodiment of this application, after obtaining the task queue of multiple node resources, the method further includes: monitoring the task queue of the multiple node resources; if the task type of the current task in the task queue is resource reservation, and the reservation user of the current task has not logged into the node resource corresponding to the reservation task, then the task status of the current task is updated to task waiting; if the task type of the current task in the task queue is resource reservation, and the reservation user of the current task has logged into the node resource corresponding to the reservation task, then the task status of the current task is updated to task running; if the task type of the current task in the task queue is test reservation, and the test process of the current task has not been executed, then the task status of the current task is updated to task waiting; if the task type of the current task in the task queue is test reservation, and the test process of the current task has been executed, then the task status of the current task is updated to task running; if the current task has ended, then the task status of the current task is updated to task ended; if the current task has been interrupted, then the task status of the current task is updated to task interrupted; and the task status of the current task is visualized.
[0012] Embodiments of this application also provide a cluster resource scheduling system, which includes a cluster resource central control server and multiple node resources. The cluster resource central control server includes at least a resource monitoring module and a resource scheduling algorithm module. The resource monitoring module is used to monitor the usage status of the multiple node resources, monitor the task queues corresponding to the multiple node resources, receive reservation requests, and send the reservation requests to the resource scheduling algorithm module. The resource scheduling algorithm module includes a resource request scheduling unit, a queue change scheduling unit, and a scheduling management unit. The resource request scheduling unit is used to perform a rationality check on the received reservation requests and add reservation requests that pass the rationality check as reservation tasks to the task queues of the node resources. The queue change scheduling unit is used to schedule the advance or postponement of reservation tasks in the task queues of the multiple node resources. The scheduling management unit is used to manage the usage permissions of the multiple node resources based on the task queues of the multiple nodes.
[0013] Embodiments of this application also provide a cluster resource scheduling device, the cluster scheduling device comprising: a queue input module, configured to acquire task queues of multiple node resources, each task queue including multiple scheduled tasks and corresponding scheduled time periods; an interval determination module, configured to determine queue intervals of multiple scheduled tasks based on the scheduled time periods, the queue intervals including fixed intervals and variable intervals; a fixed scheduling module, configured to execute scheduled tasks in the fixed interval of each task queue based on a pre-set fixed interval scheduling strategy if the scheduled task is in the fixed interval; and a variable scheduling module, configured to execute scheduled tasks in the variable interval of each task queue based on a variable interval scheduling strategy if the scheduled task is in the variable interval.
[0014] Embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer's processor, causes the computer to perform a cluster resource scheduling method as described in any of the above embodiments.
[0015] The beneficial effects of this application are as follows: Embodiments of this application provide a cluster resource scheduling method, system, apparatus, and storage medium. The method includes acquiring task queues for multiple node resources. Each task queue includes multiple scheduled tasks and scheduled time periods corresponding to the multiple scheduled tasks. The queue intervals for the multiple scheduled tasks are determined based on the scheduled time periods. The queue intervals include fixed intervals and variable intervals. If a scheduled task is in a fixed interval, the scheduled task in the fixed interval of each task queue is executed based on a pre-set fixed interval scheduling strategy. If a scheduled task is in a variable interval, the scheduled task in the variable interval of each task queue is executed based on a pre-set variable interval scheduling strategy. The fixed interval scheduling strategy can clearly define the real-time scheduling status of each node resource, while the variable interval scheduling strategy can maximize the utilization of the idle time of each node resource, thereby improving the utilization rate of node resources and reducing the investment cost and personnel cost of node resources.
[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0017] Figure 1 This is a schematic diagram illustrating the implementation environment of a cluster resource scheduling method according to an exemplary embodiment of this application;
[0018] Figure 2 This is a flowchart illustrating a cluster resource scheduling method in an exemplary embodiment of this application;
[0019] Figure 3 This is a schematic diagram of a cluster resource central control server architecture, as illustrated in an exemplary embodiment of this application.
[0020] Figure 4 This is a schematic diagram of state monitoring shown in an exemplary embodiment of this application;
[0021] Figure 5 This is a schematic diagram illustrating task forwarding as an exemplary embodiment of this application;
[0022] Figure 6 This is a schematic diagram illustrating task delay as shown in an exemplary embodiment of this application;
[0023] Figure 7 This is a schematic diagram illustrating a variable interval scheduling strategy, as shown in an exemplary embodiment of this application.
[0024] Figure 8 This is an exemplary embodiment of the present application illustrating an interrupt task flowchart;
[0025] Figure 9 This is a block diagram illustrating a cluster resource scheduling device in an exemplary embodiment of this application;
[0026] Figure 10 This is a schematic diagram illustrating the structure of an electronic device as shown in an exemplary embodiment of this application. Detailed Implementation
[0027] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0028] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0029] It should be noted that in this application, terms such as "first" and "second" are merely for distinguishing similar objects, and do not limit the order or sequence of similar objects. The variations of "including" and "having" indicate that the scope covered by the subject of the word is not exclusive, except for the examples shown by the word.
[0030] It is understood that the various numerical designations, step numbers, and other identifiers recorded in this application are for descriptive convenience and are not intended to limit the scope of this application. The size of the identifiers in this application does not imply the order of execution; the execution order of each process should be determined by its function and internal logic.
[0031] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the present application.
[0032] The embodiments of this application respectively propose a cluster resource scheduling method, a cluster resource scheduling device, a cluster resource scheduling system, an electronic device, a computer-readable storage medium, and a computer program product. These embodiments will be described in detail below.
[0033] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating the implementation environment of a cluster resource scheduling method, as shown in an exemplary embodiment of this application.
[0034] like Figure 1 As shown, the implementation environment may include a central control server for test benches and multiple node resources (bench 1, bench 2, ... bench 3) connected to the central control server. Each node resource includes a bench monitoring program and pre-set automated test tasks, such as the CX Pipeline task for automated test execution. In this embodiment, a resource scheduling system is deployed in the central control server for managing the task queues of each bench (node resource) based on a pre-set scheduling strategy. The system also visualizes the usage status of each bench and the running status of each scheduled task, improving the level of information interaction between the test benches and testers, while simultaneously enhancing the overall utilization and efficiency of cluster resources.
[0035] In one embodiment of this application, the cluster resource scheduling system includes a cluster resource central control server and multiple node resources. The cluster resource central control server includes at least a resource monitoring module and a resource scheduling algorithm module. The resource monitoring module is used to monitor the usage status of multiple node resources, monitor the task queues corresponding to multiple node resources, receive reservation requests, and send the reservation requests to the resource scheduling algorithm module. The resource scheduling algorithm module includes a resource request scheduling unit, a queue change scheduling unit, and a scheduling management unit. The resource request scheduling unit is used to perform reasonableness verification on the received reservation requests and add reservation requests that pass the reasonableness verification as reservation tasks to the task queues of the node resources. The queue change scheduling unit is used to schedule the advance or postponement of reservation tasks in the task queues of multiple node resources. The scheduling management unit is used to manage the usage permissions of multiple node resources based on the task queues of multiple nodes.
[0036] In one embodiment of this application, the cluster resource central control server further includes a task queue management module, a resource status management module, and an exception handling module. The task queue management module manages task queues corresponding to multiple node resources. Each scheduled task in the task queue includes at least a task name, task number, task priority, scheduled time period, and scheduled user. The resource status management module receives the usage status of multiple node resources and manages the status of multiple nodes based on their usage status. The usage status includes idle status, waiting status, busy status, unknown status, and fault status. The module sends the node resource information with a fault status to the exception handling module. The exception handling module monitors and handles task queue exceptions and node resource exceptions.
[0037] Please see Figure 3 , Figure 3 This is a schematic diagram of a cluster resource central control server architecture shown in an exemplary embodiment of this application. In one embodiment of this application, as shown... Figure 3 As shown, the cluster resource control server includes a resource monitoring module, a resource scheduling algorithm module, a task queue management module, a resource status management module, a resource allocation module, and an exception handling module.
[0038] In one embodiment of this application, the resource monitoring module includes three main functions: user request monitoring, rack status monitoring, and queue task monitoring. The rack status monitoring function includes monitoring the usage status of the rack (node resource), which in this embodiment includes monitoring the status of the host computer, monitoring internal resources of the rack, and monitoring some of the downstream programmable control systems of the rack. Please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic diagram of state monitoring shown in an exemplary embodiment of this application, such as... Figure 4As shown, the rack status monitoring function triggers resource status monitoring of the rack based on status query requests from the rack monitoring program on the rack host computer, returns query result responses for each rack, and updates the status data based on the query result responses. The user request monitoring function interfaces with reservation applications from front-end users, or modifies or deletes existing reservation applications. When a user makes a reservation, the user request monitoring function performs a preliminary check on the reservation application, mainly checking its completeness, such as whether required fields are complete. Reservation applications that pass the preliminary check are then passed to the resource scheduling algorithm module for calculation. After the reservation application is completed (i.e., added to the task queue as a reservation task), the complete reservation task information is returned to the user. The queue task monitoring function monitors the task status of all reservation tasks in the task queue. These reservation tasks include those that have been reserved but not yet executed, as well as those that have been reserved and are currently being executed. It can obtain the real-time status of executing reservation tasks through interaction with the rack monitoring program on the rack host computer and provide feedback to the front-end user.
[0039] In one embodiment of this application, the resource scheduling algorithm module mainly includes three scheduling functions: resource request scheduling function, queue change scheduling function, and scheduling management function, which are implemented by corresponding resource request scheduling units, queue change scheduling units, and scheduling management units, respectively. The resource request scheduling function receives user reservation requests, verifies the validity of the reservation requests, and adds reservation requests that pass the validity verification to the task queue.
[0040] In one embodiment of this application, the task queue management module manages the task queues corresponding to all nodes. Each scheduled task in the task queue includes at least the following task information: task number, task name, task status, rack resource ID, scheduled time period, scheduled user, task priority, associated project, task type, and resource exception flag. The task number is a unique identifier assigned to the scheduled task by the task queue management module based on sequence or based on the scheduled date and sequence number. The task name is the task summary information entered by the user when scheduling the task. The task status identifies the current status of the scheduled task, which includes at least waiting, executing, completed, canceled, interrupted, or abnormal. Waiting indicates that the scheduled task has not yet reached its execution time and is in a waiting state; executing indicates that the scheduled time period has arrived and the task is in progress; completed indicates that the scheduled task has been completed; canceled indicates that the user canceled the reservation; and interrupted or abnormal indicates that an exception occurred during the scheduled task and the task was interrupted.
[0041] In one embodiment of this application, if a scheduled task in the queue times out within a predetermined time period and exceeds the estimated maximum execution time, the task in the CX Pipeline may have encountered an anomaly (such as an anomaly in the tested software or an environmental anomaly). However, if the CX Pipeline is still alive, the system will automatically perform process cleanup to ensure the orderly execution of subsequent queues. When the actual execution time of a scheduled task conflicts with the scheduled time of a subsequent scheduled task, the queue management module will handle the situation effectively: when a high-priority task conflicts with a low-priority task, if the high-priority task times out and the subsequent task in the queue is a low-priority task, the high-priority task continues to run while the low-priority task waits; when a high-priority task conflicts with a low-priority task, if the low-priority task times out and the subsequent task in the queue is a high-priority task, the low-priority task is interrupted and the high-priority task begins; when tasks of equal priority conflict, the subsequent task waits while the current task continues to execute, and a timeout timer is started for the task, terminating the preceding task when the timeout timer expires.
[0042] In one embodiment of this application, the resource status management module is used to manage the resource status information of multiple node resources and implement status management marking based on the current usage status of the node resources. In this embodiment, the rack resources (node resources) include at least five states, including idle state, waiting state, busy state, unknown state, and fault state. The idle state indicates that the rack resource is neither booked nor used; the waiting state indicates that the rack resource is booked at the current time but is not actually used (the booked user has not logged into the rack resource or the booked automated test task has not been executed); the busy state indicates that the rack resource is booked at the current time and is already in use; the unknown state indicates that the rack resource cannot be detected by the system during the current time period, possibly due to rack network connection problems or other faults preventing communication with the system; and the fault state indicates that the rack resource does not have a network connection problem but cannot be used normally. The resource status management module manages multiple rack resources based on the above five resource statuses. The usage status of all rack resources is associated with and stored in the task queue information to ensure stable status switching. This includes, but is not limited to, the following application scenarios: for example, when a rack resource malfunctions and recovers, the entire system can switch the rack resource's usage status based on the current task queue information; or when all devices in the system lose power, recovery can be performed based on the stored usage status.
[0043] In one embodiment of this application, the exception handling module is used to handle specific exception processes when abnormal situations occur in the system. The exceptions in this embodiment include, but are not limited to, appointment application exceptions, appointment task exceptions, rack resource exceptions, and CX Pipeline exceptions. When appointment applications are frequent or parameters are abnormal, the exception handling module will intercept and report the corresponding exception information at the beginning of the resource scheduling module. If parameters are missing when executing a task in the task queue, the exception handling module will record the corresponding error reason and store it in the task record, report the error reason to the front end, and skip this task to ensure the normal execution of subsequent tasks. When a rack resource exception occurs, the exception handling module will report the exception information to the front end and notify the corresponding user and administrator, while marking the corresponding rack resource as unbookable. When an CX Pipeline exception occurs, the system will attempt to repeat the request. If, after a certain number of attempts, the CX Pipeline is paused and the queue task user and administrator are notified, the exception will continue until the problem is resolved.
[0044] In one embodiment of this application, the resource allocation module is used to allocate test resources and resource permissions for specific reservation tasks. These test resources include bus channel resources, host computer rack resources, downstream programmable resources, and necessary license resources. The resource allocation module processes the current reservation tasks of each resource node and distributes the required test resources to the specific rack according to the reservation task. The CX Pipeline within the rack will execute the corresponding task based on the distributed parameters. The distributed parameter information includes, but is not limited to, rack resource ID, project ID, CAN protocol setting, ETH protocol setting, LIN protocol setting, etc. Furthermore, after a reservation task is triggered, the system allocates rack resources and permissions for that time period based on the reservation user corresponding to the current reservation task: the reservation user for the current reservation task has login permissions for that rack resource; reservation users not for the current reservation task do not have login permissions for that rack resource; administrators have the highest permission level.
[0045] Please see Figure 2 , Figure 2 This is a flowchart illustrating a cluster resource scheduling method in an exemplary embodiment of this application. This method can be applied to... Figure 1 The implementation environment shown can also be applied to other exemplary implementation environments and specifically executed by devices in other implementation environments. This embodiment does not limit the implementation environment to which the method is applicable.
[0046] like Figure 2 As shown, in an exemplary embodiment, the cluster resource scheduling method includes at least steps S210 to S240, which are described in detail below:
[0047] Step S210: Obtain task queues for multiple node resources. Each task queue includes multiple reservation tasks and their corresponding reservation time periods.
[0048] In one embodiment of this application, the reservation task includes at least two reservation types: resource reservation and test reservation. Resource reservation is the scheduling of a user's login permission for node resources. A user's request to log in and use node resources during the reservation period constitutes a resource reservation. Test reservation is the reservation of automated test execution tasks. A user's request to have node resources execute pre-set automated test tasks during the reservation period, such as the automated test execution pipeline task CX Pipeline.
[0049] In one embodiment of this application, before acquiring the task queue of multiple node resources, the method further includes: if a reservation request is received, performing a reasonableness check on the reservation request based on the reservation item, wherein the reservation request includes at least a reservation time period, a reservation item, and a task priority; if the reasonableness check passes, determining at least one node resource as the target node resource based on the reservation item; if the reservation time period of the reservation request is not reserved in the task queue of the target node resource, adding the reservation request as a reservation task to the task queue of the target node resource. If the reasonableness check fails, or the reservation time period of the reservation request is already reserved in the task queue of the target node resource, rejecting the reservation request and returning a rejection reason.
[0050] In one embodiment of this application, the rationality verification of a reservation application based on the reservation item includes: rationality verification includes priority rationality verification and item rationality verification. Priority rationality verification includes verifying the rationality of the task priority of the reservation application based on the reservation item. In this embodiment, the task priority of a reservation item for regression testing is pre-set to high, the task priority of a reservation item for sample testing is pre-set to medium, and the task priority of a reservation item for verification testing is pre-set to low. The priority rationality verification fails if the task priority of the reservation item in the reservation application differs from the pre-set priority; otherwise, it passes. In this embodiment, each test item generally follows a default task priority, but the right to adjust the priority of specific tasks is reserved. However, all reservation applications with adjusted priorities are managed within the queue management module, and the priority change only takes effect upon confirmation from the platform administrator.
[0051] In one embodiment of this application, the project rationality verification includes: reviewing the necessary information input by the user, including but not limited to the account information of the user making the reservation, the task name, the node resource ID, the reservation project, the software version of the reservation project, the reservation time period, the task priority, and various detailed settings of the CX task item. If the reservation project or the software version of the reservation project does not meet the requirements of all node resources (i.e., the reservation project of the reservation application cannot be executed in all node resources or the software version of the reservation project is not loaded), then the project rationality fails.
[0052] In one embodiment of this application, if the rationality verification passes, at least one node resource is determined as the target node resource based on the reservation project. The target node resource is a node resource capable of executing the reservation project and has the software version of the reservation project loaded on it. If the reservation time period of the reservation application is not reserved in the task queue of the target node resource, the reservation application is added as a reservation task to the task queue of the target node resource.
[0053] In one embodiment of this application, if the appointment request fails the reasonableness check or the appointment time slot conflicts, the appointment request is rejected and a reason for rejection is returned. The reasons for rejection include unreasonable appointment request or appointment time conflict.
[0054] Step S220: Determine the queue intervals for multiple scheduled tasks based on the scheduled time period. The queue intervals include fixed intervals and variable intervals.
[0055] In one embodiment of this application, the queue interval is divided into a fixed interval and a variable interval. Based on a 24-hour time span, the 24 hours are divided into two queue intervals: a fixed interval and a variable interval. The time span of the queue intervals can be flexibly adjusted according to needs. For example, in this embodiment, 8:00 AM to 6:00 PM (working hours) is designated as the fixed interval, and other times (off-get off work hours) are designated as the variable interval. Reservation tasks are allocated to the fixed interval and the variable interval according to the reservation time period of each task. In this embodiment, setting the fixed interval to working hours allows each user to accurately control the time period during which they use node resources, while setting the variable interval to off-get off work hours maximizes the utilization of node resources to execute each reservation task, thus improving the utilization rate of node resources.
[0056] Step S230: If the reservation task is in a fixed interval, then the reservation task in the fixed interval in each task queue is executed based on the pre-set fixed interval scheduling strategy.
[0057] In one embodiment of this application, if the scheduled task is within a fixed interval, executing the scheduled task within the fixed interval in each task queue based on a pre-set fixed interval scheduling strategy includes: if the current time is later than or equal to the start time of the current task in the task queue, and the previous task in the task queue has been completed or interrupted, then the current task is started, and the scheduled time period includes the start and end times; if the current time is earlier than or equal to the end time of the current task in the task queue, and the current task has been completed, then the next task is started when the current time equals the start time of the next task in the task queue; if the current time is later than the end time of the current task in the task queue, and the current task has not been completed, then the current task is interrupted, and the next task is started when the current time equals the start time of the next task in the task queue.
[0058] In one embodiment of this application, a buffer time is allocated between each scheduled task within a fixed interval. If a task within a fixed interval is not completed by its end time, the task can continue during the buffer time. However, if the start time of the next task is reached, the current task is interrupted, and the next task begins execution. In this embodiment, the buffer time can be set based on the scheduled time period, for example, the buffer time can be set to 10% of the scheduled time period.
[0059] Step S240: If the reservation task is in a variable interval, then the reservation task in the variable interval of each task queue is executed based on the pre-set variable interval strategy.
[0060] In one embodiment of this application, if the scheduled task is in a variable interval, executing the scheduled task in the variable interval of each task queue based on the variable interval scheduling strategy includes: if the previous task in the task queue has been completed, and the time difference between the termination time of the previous task and the start time of the current task exceeds a preset difference threshold, then the scheduled time period of the current task is updated based on the current time and the current task is started; the subsequent scheduled tasks in the task queue are moved forward one by one for execution, and the scheduled time period of the subsequent scheduled tasks is updated.
[0061] In one embodiment of this application, Figure 5 This is a schematic diagram illustrating task forwarding as an exemplary embodiment of this application, such as... Figure 5 If queue task 4 is completed ahead of schedule (i.e., the actual completion time of queue task 4 is earlier than the end time of the scheduled time period), then there is a blank time (no queue task) between queue task 5 and queue task 4. In this case, queue task 5 (and subsequent scheduled tasks) can be moved forward, thereby improving the utilization rate of node resources.
[0062] In one embodiment of this application, if the previous task in the task queue times out and there is a higher-level scheduled task among the subsequent scheduled tasks, and the current time is equal to or later than the start time of the higher-level scheduled task, then the previous task is interrupted, and the subsequent scheduled tasks are reordered based on the task priority and scheduled time period of the subsequent scheduled tasks, where the higher-level scheduled task is the scheduled task with a higher priority than the previous task; if the previous task in the task queue times out and there is a scheduled task of the same level among the subsequent scheduled tasks, and the current time is equal to or later than the start time of the scheduled task of the same level, then a timeout timer is started, and the previous task is interrupted when the timeout timer expires, and the subsequent scheduled tasks are reordered based on the task priority and scheduled time period of the subsequent scheduled tasks; if the previous task in the task queue times out and there is no higher-level or same-level scheduled task among the subsequent scheduled tasks, then the previous task continues to be executed, and the subsequent scheduled tasks are moved to the next available time.
[0063] In one embodiment of this application, when there are higher-level or same-level reservation tasks in subsequent reservation tasks, the previous task is interrupted, and the subsequent reservation tasks are reordered based on the task priority and reservation time period of the subsequent reservation tasks. This includes: moving the higher-level reservation task with the reservation time period closest to the previous task to the front and starting it as the current task for execution, and moving the reservation tasks that are submerged by the execution time of the previous task as submerged tasks (i.e., tasks between the previous task and the current task in the original task queue) to the back.
[0064] In one embodiment of this application, the process of shifting submerged tasks due to the execution time of the previous task includes: comparing the task priority of each submerged task with the task priority of subsequent scheduled tasks according to the original scheduled time periods, and then inserting it into the subsequent scheduled tasks. If a subsequent scheduled task has a lower task priority than a submerged task, the submerged task is inserted before that subsequent scheduled task. For example, if a submerged task is of medium priority, it is inserted before the lowest priority task with the earliest scheduled time period in the subsequent scheduled tasks. Alternatively, the low-priority tasks in the submerged tasks are sequentially shifted to the end of the subsequent scheduled tasks according to the original scheduled time periods.
[0065] In one embodiment of this application, task priorities include high priority, medium priority, and low priority. When a task is shifted, the execution of high-priority tasks is guaranteed first. For example, if a medium-priority task times out, the second subsequent task is low priority, and the third subsequent task is high priority, and the duration of the low-priority task is overwhelmed by the duration of the preceding medium-priority task, then the high-priority task following the low-priority task will execute first after the medium-priority task is forcibly terminated, and the low-priority task that was just overwhelmed but not yet executed will be executed after the high-priority task. However, if the next task following a high-priority task is also a high-priority task, then the process continues to be postponed until the next task is a low-priority task.
[0066] In one embodiment of this application, Figure 6 This is a schematic diagram illustrating task delay in an exemplary embodiment of this application, as shown below. Figure 6 As shown, if the execution time of the previous task (queue task 4) is later than the start time of the next task (queue task 5) within the variable interval, the next task (queue task 5) and subsequent scheduled tasks will be postponed for execution one by one.
[0067] Please see Figure 7 , Figure 7 This is a schematic diagram of a variable interval scheduling strategy illustrated in an exemplary embodiment of this application. When scheduling scheduled tasks within a variable interval, the system fully considers the task priority of the scheduled tasks. When a task is moved forward (subsequent tasks are moved ahead), the entire subsequent queue of tasks is moved forward. When a task is moved backward (subsequent tasks are postponed), the system can only move lower-priority queue tasks backward. Figure 7 Because low-priority task 3 has a lower priority than medium-priority task 2, low-priority task 3 will be moved to the next priority level after medium-priority task 2 times out. If the start time of a subsequent higher-priority queue task has expired within a variable queue interval, but the preceding lower-priority task has not yet finished, the system will terminate the execution of the preceding task or reclaim the queue task resources. Figure 7 Since the next task after low-priority task 5, medium-priority task 4, has a higher priority than low-priority task 5, when low-priority task 5 times out and the current time has reached the start time of medium-priority task 4, the execution of low-priority task 5 will be interrupted.
[0068] In one embodiment of this application, if the reservation task is in a variable interval, executing the reservation task in the variable interval of each task queue based on the variable interval scheduling strategy further includes: if the previous task in the task queue times out and there is a higher-level or same-level reservation task in the subsequent reservation tasks, and the current time is equal to the start time of the higher-level or same-level reservation task, before interrupting the previous task, the method further includes: sending an interruption confirmation request to the reservation user of the previous task; if the interruption confirmation feedback returned by the reservation user is confirmation of interruption or no reply after timeout, then the previous task is interrupted and the subsequent reservation tasks are reordered based on the task priority and reservation time period of the subsequent reservation tasks; if the interruption confirmation feedback returned by the reservation user is confirmation of no interruption, then the previous task continues to be executed, and after waiting for a preset buffer time, an interruption notification is sent to the reservation user, and the previous task is interrupted.
[0069] Please see Figure 8 , Figure 8 This is an exemplary embodiment of the present application illustrating an interrupt task flowchart. If the previous task in the task queue times out and has not completed, the following steps must be performed before interrupting the previous task: Figure 8 The process is as follows: when the scheduled time for the previous task has expired (i.e., it has not been completed within the time limit), an interruption confirmation request is sent to the user who made the reservation. If the user does not respond within the time limit, the previous task is interrupted and related processes within the test bench are terminated. If the user responds but does not confirm the interruption, the previous task continues to execute, and after waiting for a preset buffer time, an interruption notification is sent to the user (the second query only includes the termination option). The previous task is then interrupted and related processes within the test bench are terminated after the user responds or after the time limit expires.
[0070] In one embodiment of this application, after obtaining the task queue of multiple node resources, the method further includes: monitoring the task queue of multiple node resources; if the task type of the current task in the task queue is resource reservation, and the reservation user of the current task has not logged in to the node resource corresponding to the reservation task, then the task status of the current task is updated to task waiting; if the task type of the current task in the task queue is resource reservation, and the reservation user of the current task has logged in to the node resource corresponding to the reservation task, then the task status of the current task is updated to task running; if the task type of the current task in the task queue is test reservation, and the test process of the current task has not been executed, then the task status of the current task is updated to task waiting; if the task type of the current task in the task queue is test reservation, and the test process of the current task has been executed, then the task status of the current task is updated to task running; if the current task has ended, then the task status of the current task is updated to task ended; if the current task has been interrupted, then the task status of the current task is updated to task interrupted; and the task status of the current task is visualized.
[0071] In one embodiment of this application, when the task queue changes, the queue notification function sends queue information to queue users through various means, including but not limited to email messages and instant notifications via mobile communication apps. When a scheduled task is about to start or end, the queue notification function sends a notification message to the user, reminding them that the scheduled task is about to take effect or end. When a task execution encounters an error, the system also sends an error message to the user. If a scheduled task within a variable timeframe is postponed by a higher-priority queue task, the system sends a notification message to the user when the postponed task begins execution, reminding them that the postponed task is now in effect and running.
[0072] Please see Figure 9 , Figure 9 This is a block diagram illustrating a cluster resource scheduling apparatus according to an exemplary embodiment of this application. The apparatus can be applied to… Figure 1 The implementation environment shown can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applicable.
[0073] like Figure 9 As shown, this exemplary cluster resource scheduling device includes:
[0074] The queue input module 901 is used to obtain task queues of multiple node resources. Each task queue includes multiple scheduled tasks and the scheduled time periods corresponding to the multiple scheduled tasks.
[0075] The interval determination module 902 is used to determine the queue interval of multiple scheduled tasks based on the scheduled time period. The queue interval includes a fixed interval and a variable interval.
[0076] The fixed scheduling module 903 is used to execute the scheduled tasks in the fixed interval of each task queue based on the pre-set fixed interval scheduling strategy if the scheduled tasks are in a fixed interval.
[0077] The variable scheduling module 904 is used to execute the scheduled tasks in the variable interval of each task queue based on a pre-set variable interval scheduling strategy if the scheduled task is in a variable interval.
[0078] Figure 10 A schematic diagram of a computer system suitable for implementing the embodiments of this application is shown. It should be noted that... Figure 10 The computer system 1000 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0079] like Figure 10As shown, the computer system 1000 includes a Central Processing Unit (CPU) 1001, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1002 or programs loaded from storage portion 1008 into Random Access Memory (RAM) 1003, such as performing the methods described in the above embodiments. The RAM 1003 also stores various programs and data required for system operation. The CPU 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An Input / Output (I / O) interface 1005 is also connected to the bus 1004.
[0080] The following components are connected to I / O interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to I / O interface 1005 as needed. Removable media 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1010 as needed so that computer programs read from them can be installed into storage section 1008 as needed.
[0081] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by central processing unit (CPU) 1001, it performs various functions defined in the system of this application.
[0082] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0083] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0084] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0085] Another aspect of this application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer's processor, causes the computer to perform the cluster resource scheduling method as described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.
[0086] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the cluster resource scheduling method provided in the various embodiments described above.
[0087] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A cluster resource scheduling method, characterized in that, The cluster resource scheduling method includes: A task queue for acquiring multiple node resources, each task queue including multiple reservation tasks and reservation time periods corresponding to the multiple reservation tasks; Multiple queue intervals for appointment tasks are determined based on the appointment time period, and the queue intervals include fixed intervals and variable intervals; If the reservation task is within the fixed interval, then the reservation task in the fixed interval of each task queue is executed based on the pre-set fixed interval scheduling strategy. If the reservation task is within the variable interval, then the reservation task in the variable interval of each task queue is executed based on the pre-set variable interval scheduling strategy.
2. The cluster resource scheduling method according to claim 1, characterized in that, Before retrieving the task queue for multiple node resources, the following also includes: If a reservation request is received, the reasonableness of the reservation request is verified based on the reservation item. The reservation request includes at least the reservation time period, the reservation item, and the task priority. If the rationality verification passes, at least one node resource will be identified as the target node resource based on the reservation project. If the reservation time period requested in the reservation application is not reserved in the task queue of the target node resource, then the reservation application will be added as a reservation task to the task queue of the target node resource. If the rationality check fails, or if the reservation time period requested in the reservation request has already been reserved in the task queue of the target node resource, then the reservation request is rejected and a rejection reason is returned.
3. The cluster resource scheduling method according to claim 1, characterized in that, If the reservation task is within the fixed interval, then executing the reservation task within the fixed interval in each task queue based on the pre-set fixed interval scheduling strategy includes: If the current time is later than or equal to the start time of the current task in the task queue, and the previous task in the task queue has been completed or interrupted, then the current task will begin to be executed. The scheduled time period includes the start time and the end time. If the current time is earlier than or equal to the end time of the current task in the task queue, and the current task has been completed, then wait until the current time is equal to the start time of the next task in the task queue before starting to execute the next task. If the current time is later than the termination time of the current task in the task queue, and the current task has not been completed, then the current task is interrupted, and the execution of the next task begins when the current time equals the start time of the next task in the task queue.
4. The cluster resource scheduling method according to claim 1, characterized in that, If the reservation task is within the variable interval, then executing the reservation tasks within the variable interval in each task queue based on the variable interval scheduling strategy includes: If the previous task in the task queue has been completed, and the time difference between the termination time of the previous task and the start time of the current task exceeds a preset difference threshold, then the scheduled time period of the current task is updated based on the current time and the current task is executed. The subsequent scheduled tasks in the task queue are moved forward one by one for execution, and the scheduled time periods of the subsequent scheduled tasks are updated.
5. The cluster resource scheduling method according to claim 4, characterized in that, If the reservation task is within the variable interval, then executing the reservation tasks within the variable interval in each task queue based on the variable interval scheduling strategy further includes: If the previous task in the task queue times out and is not completed, and there is a higher-level scheduled task in the subsequent scheduled tasks, and the current time is equal to or later than the start time of the higher-level scheduled task, then the previous task is interrupted, and the subsequent scheduled tasks are reordered based on the task priority and scheduled time period of the subsequent scheduled tasks. The higher-level scheduled task is the scheduled task in the subsequent scheduled tasks whose task priority is higher than that of the previous task. If the previous task in the task queue times out and is not completed, and there is a corresponding scheduled task in the subsequent scheduled task, and the current time is equal to or later than the start time of the corresponding scheduled task, then a timeout timer is started, and the previous task is interrupted when the timeout timer ends. The subsequent scheduled tasks are then reordered based on the task priority and scheduled time period of the subsequent scheduled tasks. If the previous task in the task queue times out and is not completed, and there is no higher-level or same-level scheduled task in the subsequent scheduled tasks, then the previous task will continue to be executed, and the subsequent scheduled tasks will be moved to the next task.
6. The cluster resource scheduling method according to claim 5, characterized in that, If the reservation task is within the variable interval, then executing the reservation tasks within the variable interval in each task queue based on the variable interval scheduling strategy further includes: If the previous task in the task queue times out and is not completed, and there is a higher-level or same-level scheduled task among the subsequent scheduled tasks, and the current time is equal to the start time of the higher-level or same-level scheduled task, before interrupting the previous task, the process further includes: Send an interruption confirmation request to the user who made the reservation for the previous task. If the user returns an interruption confirmation response that confirms the interruption or that no response has been received after a timeout, then interrupt the previous task and reorder the subsequent reservation tasks based on their task priority and reservation time period. If the interruption confirmation feedback returned by the user who made the reservation indicates that the interruption will not occur, then the previous task will continue to be executed. After waiting for a preset buffer time, an interruption notification will be sent to the user who made the reservation, and the previous task will be interrupted.
7. The cluster resource scheduling method according to any one of claims 1-4, characterized in that, After acquiring the task queue for multiple node resources, it also includes: Monitor the task queues of the multiple node resources; If the task type of the current task in the task queue is resource reservation, and the user who made the reservation for the current task has not logged into the node resource corresponding to the reservation task, then the task status of the current task will be updated to task waiting. If the task type of the current task in the task queue is resource reservation, and the user who made the reservation for the current task has logged into the node resource corresponding to the reservation task, then the task status of the current task will be updated to task running. If the task type of the current task in the task queue is test appointment, and the test process of the current task has not been executed, then the task status of the current task will be updated to task waiting. If the task type of the current task in the task queue is test appointment, and the test process of the current task has been executed, then the task status of the current task will be updated to task running. If the current task has been completed, then update the task status of the current task to "task completed"; If the current task has been interrupted, then update the task status of the current task to "task interrupted"; The task status of the current task is displayed visually.
8. A cluster resource scheduling system, characterized in that, The cluster resource scheduling system includes a cluster resource central control server and multiple node resources; The cluster resource control server includes at least a resource monitoring module and a resource scheduling algorithm module; The resource monitoring module is used to monitor the usage status of the resources of the multiple nodes, monitor the task queues corresponding to the resources of the multiple nodes, receive reservation requests, and send the reservation requests to the resource scheduling algorithm module. The resource scheduling algorithm module includes a resource request scheduling unit, a queue change scheduling unit, and a scheduling management unit. The resource request scheduling unit is used to perform a reasonableness check on the received reservation requests and add the reservation requests that pass the reasonableness check as reservation tasks to the task queue of the node resources. The queue change scheduling unit is used to schedule the reservation tasks in the task queues of the multiple node resources to be earlier or later. The scheduling management unit is used to manage the usage permissions of the multiple node resources based on the task queues of the multiple nodes.
9. A cluster resource scheduling device, characterized in that, The cluster scheduling device includes: The queue input module is used to obtain a task queue of multiple node resources, and each task queue includes multiple reservation tasks and reservation time periods corresponding to the multiple reservation tasks. The interval determination module is used to determine the queue interval of multiple reservation tasks according to the reservation time period, wherein the queue interval includes a fixed interval and a variable interval; A fixed scheduling module is used to execute the scheduled tasks in the fixed interval of each task queue based on a pre-set fixed interval scheduling strategy if the scheduled task is in the fixed interval. The variable scheduling module is used to execute the reservation tasks in the variable interval of each task queue based on a pre-set variable interval scheduling strategy if the reservation task is in the variable interval.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by the computer's processor, causes the computer to perform the cluster resource scheduling method as described in any one of claims 1-7.