Cluster task simulation system and method, electronic equipment and storage medium

The cluster task simulation system simulates the submission, matching and deployment process of task events, which solves the problem of time and resource waste caused by cluster running real task events in the existing technology, realizes fast and accurate task scheduling strategy verification, and saves time and resources. .

CN118567797APending Publication Date: 2024-08-30THE FOURTH PARADIGM BEIJING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311118270.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the existing technology, measuring the performance of the task scheduling strategy of the cluster task scheduling system requires using the cluster to run real task events, resulting in a waste of time and resources.

Method used

Provide a cluster task simulation system, which simulates the submission, matching and deployment process of task events through the simulated task event generation unit, simulated task event execution unit and result output unit, and verifies the effectiveness of the task scheduling strategy according to the preset strategy.

Benefits of technology

It achieves fast and accurate verification of the correctness and performance of the task scheduling system, saves time and resource costs, and avoids dependence on real task events.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567797A
    Figure CN118567797A
Patent Text Reader

Abstract

The invention relates to a cluster task simulation system and method, electronic equipment and a storage medium, and the system comprises a simulation task event generation unit which is configured to generate a simulation task event and submission time, and submit the simulation task event to an event queue based on the submission time; the simulation task event execution unit is configured to match the simulation task event in the event queue with the physical machine in the cluster, deploy the simulation task event to the physical machine based on a matching result, and update the state of the physical machine based on a deployment result; and the result output unit is configured to output a final result of deploying the plurality of generated simulation task events according to a preset task scheduling strategy. Therefore, the task scheduling strategy is verified by using the simulation task event instead of a real task event, so that the time cost and the resource cost can be greatly saved, and excessive occupation of time and software and hardware resources is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and more specifically, to a cluster task simulation system, method, electronic device and storage medium. Background Art

[0002] A cluster is a group of independent computers (also called physical machines or servers) that are interconnected through a network to form a computer service system. These computers can communicate with each other and work together to provide various services to users.

[0003] The cluster task scheduling system can match each task to a suitable physical machine for deployment and execution according to the various resources (for example, CPU, GPU, memory, etc.) required by the tasks submitted by the user and the status of each physical machine in the cluster, according to the preset task scheduling strategy. Under the same physical machine configuration, when the total number of tasks increases, an excellent cluster task scheduling system can often greatly reduce the average waiting time of tasks and improve cluster efficiency.

[0004] However, in the prior art, measuring the performance of a task scheduling strategy of a cluster task scheduling system usually requires using a cluster to run real task events, thereby verifying whether the corresponding task scheduling strategy is appropriate based on the running results under different task scheduling strategies (for example, the length of running time, etc.). This requires a lot of time and software and hardware resources to verify.

[0005] Therefore, a cluster task simulator is needed to simulate the operation of cluster tasks in order to quickly and accurately verify the task scheduling strategy of the cluster task scheduling system. Summary of the invention

[0006] The present disclosure provides a cluster task simulation system, method, electronic device and storage medium to at least solve the problem in the above-mentioned related technologies that using a cluster to run a real task event requires a lot of time and software and hardware resources.

[0007] According to a first aspect of an embodiment of the present disclosure, a cluster task simulation system is provided, comprising: a simulation task event generation unit, configured to generate a simulation task event and generate a submission time of the simulation task event, and submit the simulation task event to an event queue based on the submission time of each simulation task event, wherein the simulation task event is an event generated by simulating a real task event; a simulation task event execution unit, configured to match the simulation task events in the event queue with physical machines in a cluster according to a preset task scheduling strategy, deploy the simulation task events to the physical machines based on the matching results, and update the status of the physical machines based on the deployment results; and a result output unit, outputting the final result of deploying the generated multiple simulation task events according to the preset task scheduling strategy.

[0008] Optionally, the simulation task event execution unit includes: a triggering unit, configured to determine the triggered simulation task event in the event queue based on the status of the simulation task event in the event queue; a scheduling unit, configured to match the triggered simulation task event with the physical machine based on the status of the physical machine in the cluster according to the preset task scheduling strategy; and an operation unit, configured to deploy the triggered simulation task event to the physical machine based on the matching result between the triggered simulation task event and the physical machine, and update the status of the physical machine based on the deployment result.

[0009] Optionally, the initial state of the simulated task event is set to an unsubmitted state; when a first simulated task event in an unsubmitted state is submitted to the event queue, the simulated task event generation unit changes the state of the first simulated task event from the unsubmitted state to a waiting state; when all predecessor tasks of a second simulated task event in a waiting state are completed, the triggering unit changes the state of the second simulated task event from the waiting state to an undetermined state, and determines the second simulated task event in an undetermined state as the triggered simulated task event.

[0010] Optionally, when a third simulated task event in an undetermined state is successfully deployed to a matching physical machine, the running unit changes the state of the third simulated task event from the undetermined state to the execution state, and updates the state of the matching physical machine; when a fourth simulated task event in the execution state is completed, the running unit changes the state of the fourth simulated task event from the execution state to the completion state, and updates the state of the matching physical machine.

[0011] Optionally, the cluster task simulation system also includes: a clock unit, configured to use the submission time or status change time of each simulation task event as the time node of the cluster task simulation system, wherein when the status of the simulation task event corresponding to the current time node changes, the cluster task simulation process of the cluster task simulation system is triggered to directly advance to the next time node adjacent to the current time node.

[0012] Optionally, the simulation task events generated by the simulation task event generation unit include real-time simulation task events and scheduled simulation task events, wherein the submission time of the scheduled simulation task event is predetermined when the scheduled simulation task event is generated, and the submission time of the real-time simulation task event is the generation time of the real-time simulation task event; wherein, when the time node of the cluster task simulation system reaches the submission time of the first simulation task event, the simulation task event generation unit submits the first simulation task event to the event queue.

[0013] Optionally, the running unit determines the completion time when the state of the fourth simulated task event changes from the execution state to the completion state based on the execution duration of the fourth simulated task event, and determines that the fourth simulated task event is executed and completed when the time node of the cluster task simulation system reaches the completion time.

[0014] According to a second aspect of an embodiment of the present disclosure, a cluster task simulation method is provided, comprising: generating a simulated task event and generating a submission time of the simulated task event, and submitting the simulated task event to an event queue based on the submission time of each simulated task event, wherein the simulated task event is an event generated by simulating a real task event; matching the simulated task events in the event queue with physical machines in the cluster according to a preset task scheduling strategy, deploying the simulated task events to the physical machines based on the matching results, and updating the status of the physical machines based on the deployment results; and outputting a final result of deploying the generated multiple simulated task events according to the preset task scheduling strategy.

[0015] Optionally, the simulated task events in the event queue are matched with physical machines in the cluster according to a preset task scheduling strategy, the simulated task events are deployed to the physical machines based on the matching results, and the status of the physical machines is updated based on the deployment results, including: determining the triggered simulated task events in the event queue based on the status of the simulated task events in the event queue; matching the triggered simulated task events with physical machines based on the status of the physical machines in the cluster according to the preset task scheduling strategy; and deploying the triggered simulated task events to the physical machines based on the matching results between the triggered simulated task events and the physical machines, and updating the status of the physical machines based on the deployment results.

[0016] Optionally, the initial state of the simulated task event is set to an unsubmitted state; when a first simulated task event in an unsubmitted state is submitted to the event queue, the state of the first simulated task event is changed from the unsubmitted state to a waiting state; when all predecessor tasks of a second simulated task event in a waiting state are completed, the state of the second simulated task event is changed from the waiting state to an undetermined state, and the second simulated task event in an undetermined state is determined as the triggered simulated task event.

[0017] Optionally, when a third simulated task event in an undetermined state is successfully deployed to a matching physical machine, the state of the third simulated task event is changed from the undetermined state to the execution state, and the state of the matching physical machine is updated; when a fourth simulated task event in the execution state is completed, the state of the fourth simulated task event is changed from the execution state to the completion state, and the state of the matching physical machine is updated.

[0018] Optionally, the cluster task simulation method also includes: using the submission time or status change time of each simulation task event as the time node of the cluster task simulation system, wherein when the status of the simulation task event corresponding to the current time node changes, the cluster task simulation process of the cluster task simulation system is triggered to directly advance to the next time node adjacent to the current time node.

[0019] Optionally, the simulation task event includes a real-time simulation task event and a scheduled simulation task event, wherein the submission time of the scheduled simulation task event is predetermined when the scheduled simulation task event is generated, and the submission time of the real-time simulation task event is the generation time of the real-time simulation task event; wherein, when the time node of the cluster task simulation system reaches the submission time of the first simulation task event, the first simulation task event is submitted to the event queue.

[0020] Optionally, the cluster task simulation method also includes: determining the completion time when the state of the fourth simulated task event changes from the execution state to the completion state based on the execution duration of the fourth simulated task event, and determining that the fourth simulated task event is executed and completed when the time node of the cluster task simulation system reaches the completion time.

[0021] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the cluster task simulation method according to the present disclosure.

[0022] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium storing instructions is provided, which, when executed by at least one computing device, prompts the at least one computing device to execute the cluster task simulation method according to the present disclosure.

[0023] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0024] In the present disclosure, since the simulated task events are events generated by simulating real task events, it is possible to correctly and accurately simulate the running conditions of various task events, that is, it is possible to accurately simulate the environment of a real cluster, so as to quickly and accurately verify the correctness and performance of the task scheduling system. In addition, since the present disclosure uses simulated task events instead of real task events to verify the task scheduling strategy, it can greatly save time and resource costs, and avoid excessive occupation of time and software and hardware resources.

[0025] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0027] Figure 1 is a block diagram illustrating a cluster task simulation system according to an exemplary embodiment of the present disclosure;

[0028] Figure 2 is a block diagram illustrating a simulation task event execution unit according to an exemplary embodiment of the present disclosure;

[0029] Figure 3 is a flow chart illustrating a cluster task simulation method according to an exemplary embodiment of the present disclosure;

[0030] Figure 4 is a schematic diagram showing the architecture of a cluster task simulation system and the interaction process between various units in the cluster task simulation system according to an exemplary embodiment of the present disclosure;

[0031] Figure 5 is a block diagram illustrating an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0032] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.

[0034] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.

[0035] In the prior art, measuring the performance of a task scheduling strategy of a cluster task scheduling system usually requires using a cluster to run real task events, thereby verifying whether the corresponding task scheduling strategy is appropriate based on the running results under different task scheduling strategies (for example, the length of running time, etc.). This requires a lot of time and software and hardware resources to verify.

[0036] In order to solve the above problems existing in the related art, the cluster task simulation system, method, electronic device and storage medium provided by the present disclosure can correctly and accurately simulate the operation of various task events, that is, can accurately simulate the environment of a real cluster, so as to quickly and accurately verify the correctness and performance of the task scheduling system. In addition, since the present disclosure uses simulated task events instead of real task events to verify the task scheduling strategy, it can greatly save time and resource costs and avoid excessive occupation of time and software and hardware resources.

[0037] Figure 1 is a block diagram illustrating a cluster task simulation system 100 according to an exemplary embodiment of the present disclosure.

[0038] Reference Figure 1 , a cluster task simulation system 100 according to an exemplary embodiment of the present disclosure may include a simulation task event generating unit 110 , a simulation task event executing unit 120 , and a result output unit 130 .

[0039] The simulated task event generation unit 110 can generate simulated task events and generate the submission time of the simulated task events, and can submit the simulated task events to the event queue based on the submission time of each simulated task event. Wherein, the simulated task event can be an event generated by simulating a real task event. Wherein, the "event queue" can be a dynamically maintained queue for maintaining global simulated task event information (e.g., the status of the simulated task event, etc.).

[0040] In an exemplary embodiment of the present disclosure, the simulated task event generation unit 110 generates a simulated task event, which means that the simulated task event generation unit 110 generates a simulated task event by simulating various attributes of a real task event (e.g., required running time, required physical machine resource types and sizes, dependencies between real task events, etc.). In an exemplary embodiment of the present disclosure, the simulated task event generation unit 110 can use discrete event simulation to simulate real task events, or can generate simulated task events based on information of continuous task events. Here, discrete event simulation refers to using instantaneous events or discrete events to simulate the operation of a system. This will be described in more detail later.

[0041] The simulation task event execution unit 120 can match the simulation task event in the event queue with the physical machine in the cluster according to the preset task scheduling strategy, and then can deploy the simulation task event to the physical machine based on the matching result, and can update the state of the physical machine based on the deployment result. Among them, the "deployment result" can include the deployment time consumed by successfully deploying the simulation task event to the matched physical machine, and which physical machine the simulation task event is successfully deployed to. The result output unit 130 can output the final result of deploying the generated multiple simulation task events according to the preset task scheduling strategy. Among them, the "final result" can include which physical machine each simulation task event is successfully deployed to in the generated multiple simulation task events, the update state of the physical machine after deploying the simulation task event on the matched physical machine, and the time consumed by deploying the simulation task event. In this way, it is possible to verify whether the corresponding task scheduling strategy is appropriate based on the above-mentioned "final result". Exemplarily, the shorter the total deployment time corresponding to the generated multiple simulation task events is, the better the corresponding task scheduling strategy can be considered. Furthermore, when evaluating the performance of the task scheduling strategy, manual evaluation can be used, or automatic evaluation can be performed using a cluster task simulation system. The present disclosure does not impose any specific restrictions on the method of evaluating the performance of the task scheduling strategy. Figure 2 The simulation task event execution unit 120 is described in detail.

[0042] In this way, since the simulated task event is an event generated by simulating the real task event, it is possible to correctly and accurately simulate the operation of various task events, that is, it is possible to accurately simulate the environment of the real cluster to quickly and accurately verify the correctness and performance of the task scheduling system. In addition, since the present disclosure uses simulated task events instead of real task events to verify the task scheduling strategy, it can greatly save time and resource costs and avoid excessive occupation of time and software and hardware resources.

[0043] Figure 2 is a block diagram illustrating a simulation task event execution unit 120 according to an exemplary embodiment of the present disclosure.

[0044] Reference Figure 2 The simulation task event execution unit 120 includes a trigger unit 210 , a scheduling unit 220 and an operation unit 230 .

[0045] The trigger unit 210 may determine the triggered simulation task event in the event queue based on the state of the simulation task event in the event queue. The scheduling unit 220 may match the triggered simulation task event with the physical machine based on the state of the physical machine in the cluster according to the preset task scheduling strategy. The operation unit 230 may deploy the triggered simulation task event to the physical machine based on the matching result between the triggered simulation task event and the physical machine, and update the state of the physical machine based on the deployment result.

[0046] More specifically, the initial state of the simulated task event generated by the simulated task event generation unit 110 may be an uncommitted state. When the first simulated task event in the uncommitted state is submitted to the event queue, the simulated task event generation unit 110 may change the state of the first simulated task event from an uncommitted state to a waiting state.

[0047] It should be noted that the simulated task event is in a waiting state because the simulated task event has a predecessor task that has not been completed. The simulated task event can only be executed when all the predecessor tasks of the simulated task event are completed. Before the predecessor tasks of the simulated task event are all completed, the simulated task event cannot be executed and can only remain in a waiting state until all the predecessor tasks of the simulated task event are completed. Exemplarily, when the simulated task event generated by the simulated task event generation unit 110 has dependent tasks (i.e., predecessor tasks), the simulated task event generation unit 110 can solve the dependency changes of these dependent tasks by a preset sorting algorithm (e.g., online topological sorting (TopoSort)) to determine the execution order of each task therein.

[0048] In addition, in an exemplary embodiment of the present disclosure, when all predecessor tasks of a second simulated task event in a waiting state are completed, the trigger unit 210 can change the state of the second simulated task event from a waiting state to an undetermined state (pending), and determine the second simulated task event in the undetermined state as a triggered simulated task event.

[0049] In an exemplary embodiment of the present disclosure, the simulation task event being in an undetermined state may indicate that the simulation task event has not yet been determined to be matched to which physical machine for execution. In this case, the scheduling unit 220 may determine the match between the triggered simulation task event and the physical machine according to the preset task scheduling strategy. Specifically, the scheduling unit 220 may obtain an ordered queue of <simulation task event, physical machine> tuples according to the current event queue and the state of the physical machines in the cluster, each tuple indicating a match of a simulation task event in an undetermined state to a physical machine, and the position of the tuple in the ordered queue may indicate the priority of the match. In an exemplary embodiment of the present disclosure, in the ordered queue, there may be several physical machine matches with priorities for a simulation task event, and similarly, there may also be several simulation task event matches with different priorities for a physical machine. In an exemplary embodiment of the present disclosure, the task scheduling strategy used by the scheduling unit 220 may be predetermined, for example, reinforcement learning, heuristic search, etc. The specific task scheduling strategy adopted does not affect the performance of the cluster task simulation system 100 of the exemplary embodiment of the present disclosure, so it is not described in detail here.

[0050] The operation unit 230 can attempt to deploy the simulated task event to the corresponding matching physical machine based on the above-mentioned ordered queue. The operation unit 230 can start from the binary group with the highest priority in the ordered queue and try to deploy the simulated task event in the undetermined state in each binary group to the corresponding physical machine. If the third simulated task event in the undetermined state in the binary group is successfully deployed to the matching physical machine, the operation unit 230 can change the state of the third simulated task event from the undetermined state to the executing state (executing), and update the state of the matching physical machine. For example, the currently available or remaining resources of the matching physical machine can be deducted from the resources required for the simulated task event to simulate the resource occupation of the simulated task event, and it is considered that the simulated task event is running in the physical machine. On the contrary, when the simulated task event in the undetermined state in the binary group is not successfully deployed to the matching physical machine, the operation unit 230 can attempt the deployment of the binary group of the next priority, at this time, the simulated task event that is not successfully deployed can continue to be in the undetermined state until it is successfully deployed.

[0051] It should be noted that the state update of the physical machine refers to the update of the state of the available resources of the physical machine. After the simulated task event is successfully deployed to the physical machine, the operation of the task event is simulated by deducting the operating resources required by the simulated task event, and the state of the physical machine is updated according to the deducted operating resources. That is, after the simulated task event is successfully deployed to the corresponding matching physical machine, the physical machine does not actually execute the simulated task event, but only simulates the operation of the simulated task event by deducting the operating resources required by the simulated task event within the operating time of the simulated task event, and updates the state of the physical machine accordingly, thereby greatly improving the operating efficiency of the simulated task event.

[0052] When the fourth simulated task event in the execution state on the physical machine is completed, the running unit 230 can change the state of the fourth simulated task event from the execution state to the completion state (done), and update the state of the matching physical machine, that is, restore the resources occupied by the simulated task event, that is, release the resources occupied by the simulated task event in the matching physical machine.

[0053] It should be noted that, although the above description describes the execution of the simulation task events in chronological order, in an exemplary embodiment of the present disclosure, the cluster task simulation system 100 may not advance the entire simulation process based on the actual execution time of the simulation task events, but may advance the simulation process based on discrete events.

[0054] Specifically, in an exemplary embodiment of the present disclosure, the cluster task simulation system 100 may further include a clock unit, which may be configured to use the submission time or state change time of each simulation task event as a time node of the cluster task simulation system. When the state of the simulation task event corresponding to the current time node changes, the cluster task simulation process of the cluster task simulation system 100 is triggered to directly advance to the next time node adjacent to the current time node.

[0055] Exemplary, assuming that in chronological order, at the 0th minute, the first simulation task event is submitted and the state changes to the waiting state, at the 5th minute the second simulation task event is submitted and the state changes to the waiting state, at the 7th minute the state of the first simulation task event changes to the undetermined state... Then the clock unit can directly advance to the 5th minute after the state of the first simulation task event changes at the 0th minute, without actually waiting for 5 minutes; and directly advance to the 7th minute after the state of the second simulation task event changes, without actually waiting for 2 minutes, and so on. In other words, the clock unit does not need to advance the cluster task simulation process according to real time, but can determine the time node of the change in the entire cluster task simulation system, and directly advance to the next time node after the action at a time node is completed. In this way, the simulation acceleration ratio of the simulation task event with a longer running time can be greatly improved, and the changes of each component in the cluster task simulation system 100 can also be more accurately simulated.

[0056] According to an exemplary embodiment of the present disclosure, for a simulated task event running in simulation on a physical machine, since its running time is usually known, its completion time can be determined. At this time, when the time node of the clock unit advances to the completion time, the state of the simulated task event can be changed from the execution state to the completion state. That is, the operation unit 230 can determine the completion time when the state of the fourth simulated task event changes from the execution state to the completion state based on the execution duration of the fourth simulated task event, and then the operation unit 230 can determine that the fourth simulated task event is executed and completed when the time node of the cluster task simulation system 100 reaches the completion time of the fourth simulated task event.

[0057] In an exemplary embodiment of the present disclosure, in order to more accurately simulate a real cluster environment, the simulated task events generated by the simulated task event generation unit 110 may include real-time simulated task events and timed simulated task events. The submission time of the timed simulated task event may be predetermined when the timed simulated task event is generated. The submission time of the real-time simulated task event may be the generation time of the real-time simulated task event. Exemplarily, during the simulation process of the cluster task simulation system 100, the simulated task event generation unit 110 may generate a real-time simulated task event in a burst manner and submit it to the event queue at the same time. Due to its real-time nature, the real-time simulated task event usually does not have a preceding task, so the trigger unit 210 may directly determine its state as an undetermined state and determine the simulated task event as a triggered simulated task event. Moreover, when the time node of the cluster task simulation system 100 reaches the submission time of the first simulated task event, the simulated task event generation unit 110 may submit the first simulated task event to the event queue. By simulating these two different types of task events, the cluster task simulation system 100 of the present disclosure can be freely switched between a static environment and a dynamic environment, and can be applied to more complex scenarios.

[0058] The cluster task simulation system 100 according to the exemplary embodiment of the present disclosure has been described above in combination with discrete event simulation, but it should be understood that the present application is not limited thereto, and exemplary, continuous event simulation may also be used to simulate task events.

[0059] Figure 3 is a flowchart illustrating a cluster task simulation method according to an exemplary embodiment of the present disclosure.

[0060] Reference Figure 3 In step 301, a simulated task event can be generated and a submission time of the simulated task event can be generated, and the simulated task event can be submitted to an event queue based on the submission time of each simulated task event. Wherein, the simulated task event can be an event generated by simulating a real task event. The "event queue" can be a dynamically maintained queue for maintaining global simulated task event information (e.g., the status of the simulated task event, etc.).

[0061] It should be noted that the simulated task event can be generated by simulating various attributes of the real task event (e.g., required running time, required physical machine resource type and size, dependencies between real task events, etc.). In an exemplary embodiment of the present disclosure, discrete event simulation can be used to simulate the real task event, and the simulated task event can also be generated based on the information of continuous task events. Here, discrete event simulation refers to the operation of the simulation system using instantaneous events or discrete events. This will be described in more detail later.

[0062] In step 302, the simulated task events in the event queue can be matched with the physical machines in the cluster according to the preset task scheduling strategy, and then the simulated task events can be deployed to the physical machines based on the matching results, and the status of the physical machines can be updated based on the deployment results. Among them, the "deployment results" can include the deployment time consumed to successfully deploy the simulated task event to the matched physical machine, and to which physical machine the simulated task event is successfully deployed.

[0063] Figure 4 1 is a schematic diagram showing the architecture of a cluster task simulation system according to an exemplary embodiment of the present disclosure and the interaction process between various units in the cluster task simulation system. Figure 4 The cluster task simulation system may include a simulation task event generation unit (generator), a trigger unit (trigger), a scheduling unit (agent), an operation unit (clustermodel) and a clock unit (clock). It should be noted that the cluster task simulation system not only includes the aforementioned functional units, but also may include other functional units, and illustratively, may also include a result output unit, etc., which will not be described one by one here.

[0064] And, refer to Figure 4 , the simulation task event can exist in multiple states, for example, it can be uncommitted, waiting, pending, executing, done, etc. After each functional unit performs a corresponding functional operation on the simulation task event, the state of the simulation task event can be changed from the current state to another state.

[0065] Exemplarily, after the simulation task event generation unit (generator) submits a simulation task event to the event queue, the state of the simulation task event is changed from an unsubmitted state to a waiting state; when all the predecessor tasks of the simulation task event are completed, the trigger unit (trigger) can change the state of the simulation task event from a waiting state to an undetermined state; the scheduling unit (agent) is used to match the triggered simulation task event with the physical machine based on the state of the physical machine in the cluster according to the preset task scheduling strategy; the operation unit (cluster model) is used to deploy the triggered simulation task event to the matching physical machine based on the matching result output by the scheduling unit (agent), and can change the state of the simulation task event from an undetermined state to an executed state, and when the simulation task event is executed, change the state of the simulation task event from an executed state to a completed state.

[0066] According to an exemplary embodiment of the present disclosure, the triggered simulated task event in the event queue can be determined based on the state of the simulated task event in the event queue. Then, the triggered simulated task event can be matched with the physical machine based on the state of the physical machine in the cluster according to the preset task scheduling strategy. Next, based on the matching result between the triggered simulated task event and the physical machine, the triggered simulated task event can be deployed to the physical machine, and the state of the physical machine can be updated based on the deployment result.

[0067] According to an exemplary embodiment of the present disclosure, the initial state of the simulation task event can be set to an unsubmitted state. When the first simulation task event in the unsubmitted state is submitted to the event queue, the state of the first simulation task event can be changed from the unsubmitted state to the waiting state.

[0068] It should be noted that the simulated task event is in a waiting state because the simulated task event has a pre-task that has not been completed, and the simulated task event can only be executed when all the pre-tasks of the simulated task event are completed. Before the pre-tasks of the simulated task event are all completed, the simulated task event can not be executed, and can only remain in a waiting state until all the pre-tasks of the simulated task event are completed and the simulated task event can be executed. Exemplary, when the simulated task event has dependent tasks (that is, pre-tasks), the dependent changes of these dependent tasks can be solved by a preset sorting algorithm (for example, online topological sorting (TopoSort)), to determine the execution order of each task therein.

[0069] When all predecessor tasks of the second simulated task event in the waiting state are completed, the state of the second simulated task event may be changed from the waiting state to the undetermined state, and the second simulated task event in the undetermined state may be determined as a triggered simulated task event.

[0070] According to an exemplary embodiment of the present disclosure, when the third simulated task event in an undetermined state is successfully deployed to a matching physical machine, the state of the third simulated task event can be changed from an undetermined state to an execution state, and the state of the matching physical machine can be updated. Exemplarily, the currently available or remaining resources of the matching physical machine can be subtracted from the resources required by the simulated task event to simulate the resource occupancy of the simulated task event, and the simulated task event is considered to be running in the physical machine. Conversely, the simulated task event that has not been successfully deployed can continue to be in an undetermined state until it is successfully deployed.

[0071] It should be noted that the state update of the physical machine refers to the update of the state of the available resources of the physical machine. After the simulated task event is successfully deployed to the physical machine, the operation of the task event is simulated by deducting the operating resources required by the simulated task event, and the state of the physical machine is updated according to the deducted operating resources. That is, after the simulated task event is successfully deployed to the corresponding matching physical machine, the physical machine does not actually execute the simulated task event, but only simulates the operation of the simulated task event by deducting the operating resources required by the simulated task event within the operating time of the simulated task event, and updates the state of the physical machine accordingly, thereby greatly improving the operating efficiency of the simulated task event.

[0072] When the fourth simulated task event in the execution state is completed, the state of the fourth simulated task event can be changed from the execution state to the completion state, and the state of the matching physical machine can be updated, that is, the resources occupied by the simulated task event can be restored, that is, the resources occupied by the simulated task event in the matching physical machine can be released.

[0073] According to an exemplary embodiment of the present disclosure, the submission time or state change time of each simulated task event can also be used as the time node of the cluster task simulation system. Among them, when the state of the simulated task event corresponding to the current time node changes, the cluster task simulation process of the cluster task simulation system is triggered to directly advance to the next time node adjacent to the current time node. In other words, it is not necessary to advance the cluster task simulation process according to real time, but it is possible to determine the time node of the change in the entire cluster task simulation system, and directly advance to the next time node after the action at a time node is completed. In this way, the simulation acceleration ratio of the simulated task events with a longer running time can be greatly improved, and the changes of various components in the cluster task simulation system can also be more accurately simulated.

[0074] According to an exemplary embodiment of the present disclosure, in order to more accurately simulate a real cluster environment, a simulation task event may include a real-time simulation task event and a timing simulation task event. The submission time of the timing simulation task event may be predetermined when the timing simulation task event is generated. The submission time of the real-time simulation task event may be the generation time of the real-time simulation task event. Exemplarily, in the simulation process of the cluster task simulation system, a real-time simulation task event may be generated in a burst manner and submitted to the event queue at the same time. Due to its real-time nature, the real-time simulation task event usually does not have a preceding task, so its state may be directly determined as an undetermined state, and the simulation task event may be determined as a triggered simulation task event. Moreover, when the time node of the cluster task simulation system reaches the submission time of the first simulation task event, the first simulation task event may be submitted to the event queue. By simulating these two different types of task events, the cluster task simulation system of the present disclosure may be freely switched between a static environment and a dynamic environment, and may be applicable to more complex scenarios.

[0075] According to an exemplary embodiment of the present disclosure, for a simulation task event running in simulation on a physical machine, since its running time is usually known, its completion time can be determined. At this time, when the time node of the cluster task simulation system advances to the completion time, the state of the simulation task event can be changed from the execution state to the completion state. That is, the completion time when the state of the fourth simulation task event is changed from the execution state to the completion state can also be determined based on the execution duration of the fourth simulation task event, and when the time node of the cluster task simulation system arrives at the completion time, it is determined that the fourth simulation task event is executed and completed.

[0076] In step 303, the final result of deploying the generated multiple simulated task events according to the preset task scheduling strategy can be output. Among them, the "final result" can include which physical machine each simulated task event in the generated multiple simulated task events is successfully deployed to, the update status of the physical machine after the simulated task event is deployed on the matched physical machine, and the time consumed to deploy the simulated task event. In this way, it is possible to verify whether the corresponding task scheduling strategy is appropriate based on the above-mentioned "final result". Exemplarily, the shorter the total deployment time corresponding to the generated multiple simulated task events, the better the corresponding task scheduling strategy can be considered, and so on. Furthermore, when evaluating the performance of the task scheduling strategy, manual evaluation can be used, or automatic evaluation can be performed using a cluster task simulation system. The present disclosure does not specifically limit the method of evaluating the performance of the task scheduling strategy.

[0077] Figure 5 is a block diagram illustrating an electronic device 500 according to an exemplary embodiment of the present disclosure.

[0078] Reference Figure 5 The electronic device 500 includes at least one memory 501 and at least one processor 502. The at least one memory 501 stores instructions. When the instructions are executed by the at least one processor 502, the cluster task simulation method according to the exemplary embodiment of the present disclosure is executed.

[0079] As an example, the electronic device 500 may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above instructions. Here, the electronic device 500 is not necessarily a single electronic device, but may also be any device or circuit capable of executing the above instructions (or instruction sets) individually or in combination. The electronic device 500 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.

[0080] In the electronic device 500, the processor 502 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not limitation, the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0081] The processor 502 may execute instructions or codes stored in the memory 501, wherein the memory 501 may also store data. Instructions and data may also be sent and received over a network via a network interface device, wherein the network interface device may employ any known transmission protocol.

[0082] The memory 501 may be integrated with the processor 502, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 501 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 501 and the processor 502 may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 502 can read files stored in the memory.

[0083] In addition, the electronic device 500 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device 500 may be connected to each other via a bus and / or a network.

[0084] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium storing instructions may also be provided, and when the instructions are executed by at least one computing device, at least one computing device is prompted to perform the cluster task simulation method according to the present disclosure. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.

[0085] According to the cluster task simulation system, method, electronic device and storage medium disclosed in the present invention, since the simulated task event is an event generated by simulating the real task event, it is possible to correctly and accurately simulate the operation of various task events, that is, it is possible to accurately simulate the environment of the real cluster to quickly and accurately verify the correctness and performance of the task scheduling system. In addition, since the present invention uses simulated task events instead of real task events to verify the task scheduling strategy, it can greatly save time and resource costs and avoid excessive occupation of time and software and hardware resources.

[0086] Furthermore, after the simulated task event is successfully deployed to the corresponding matching physical machine, the physical machine does not actually execute the simulated task event, but only simulates the operation of the simulated task event by deducting the running resources required for the simulated task event within the running time of the simulated task event, thereby greatly improving the running efficiency of the simulated task event.

[0087] Furthermore, it is not necessary to advance the cluster task simulation process according to real time, but it is possible to determine the time nodes where changes occur in the entire cluster task simulation system, and directly advance to the next time node after the action at one time node is completed. In this way, the simulation acceleration ratio of simulation task events with long running time can be greatly improved, and the changes of various components in the cluster task simulation system can also be simulated more accurately.

[0088] Furthermore, by simulating two different types of task events, namely real-time task events and scheduled task events, the cluster task simulation system of the present invention can switch freely between static and dynamic environments and can be applied to more complex scenarios.

[0089] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0090] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A cluster task simulation system, characterized in that: include: A simulated task event generating unit is configured to generate simulated task events and generate submission time of the simulated task events, and submit the simulated task events to an event queue based on the submission time of each simulated task event, wherein the simulated task events are events generated by simulating real task events; A simulation task event execution unit is configured to match the simulation task events in the event queue with the physical machines in the cluster according to a preset task scheduling strategy, deploy the simulation task events to the physical machines based on the matching results, and update the status of the physical machines based on the deployment results; The result output unit is configured to output the final result of deploying the generated multiple simulated task events according to the preset task scheduling strategy.

2. The cluster task simulation system according to claim 1, characterized in that: The simulation task event execution unit comprises: a triggering unit configured to determine a triggered simulation task event in the event queue based on a state of the simulation task event in the event queue; a scheduling unit configured to match the triggered simulation task event with the physical machine based on the status of the physical machine in the cluster according to the preset task scheduling strategy; and The running unit is configured to deploy the triggered simulation task event to the physical machine based on the matching result between the triggered simulation task event and the physical machine, and update the state of the physical machine based on the deployment result.

3. The cluster task simulation system according to claim 2, characterized in that: The initial state of the simulation task event is set to an unsubmitted state; When a first simulation task event in an unsubmitted state is submitted to the event queue, the simulation task event generation unit changes the state of the first simulation task event from the unsubmitted state to a waiting state; When all predecessor tasks of the second simulated task event in the waiting state are completed, the triggering unit changes the state of the second simulated task event from the waiting state to an undetermined state, and determines the second simulated task event in the undetermined state as the triggered simulated task event.

4. The cluster task simulation system according to claim 3, characterized in that: When the third simulation task event in an undetermined state is successfully deployed to the matching physical machine, the running unit changes the state of the third simulation task event from the undetermined state to the execution state, and updates the state of the matching physical machine; When the fourth simulation task event in the execution state is completed, the operation unit changes the state of the fourth simulation task event from the execution state to the completion state, and updates the state of the matching physical machine.

5. The cluster task simulation system according to claim 4, characterized in that: The cluster task simulation system also includes: The clock unit is configured to use the submission time or status change time of each simulation task event as the time node of the cluster task simulation system, wherein when the status of the simulation task event corresponding to the current time node changes, the cluster task simulation process of the cluster task simulation system is triggered to directly advance to the next time node adjacent to the current time node.

6. The cluster task simulation system according to claim 5, characterized in that: The simulation task events generated by the simulation task event generation unit include real-time simulation task events and timed simulation task events, wherein the submission time of the timed simulation task event is predetermined when the timed simulation task event is generated, and the submission time of the real-time simulation task event is the generation time of the real-time simulation task event; When the time node of the cluster task simulation system reaches the submission time of the first simulation task event, the simulation task event generation unit submits the first simulation task event to the event queue.

7. The cluster task simulation system according to claim 5, characterized in that: The running unit determines the completion time when the state of the fourth simulated task event changes from the execution state to the completion state based on the execution duration of the fourth simulated task event, and determines that the fourth simulated task event is executed and completed when the time node of the cluster task simulation system reaches the completion time.

8. A cluster task simulation method, characterized in that: include: Generate a simulated task event and generate a submission time of the simulated task event, and submit the simulated task event to an event queue based on the submission time of each simulated task event, wherein the simulated task event is an event generated by simulating a real task event; According to a preset task scheduling strategy, the simulated task events in the event queue are matched with the physical machines in the cluster, the simulated task events are deployed to the physical machines based on the matching results, and the status of the physical machines is updated based on the deployment results; Output the final result of deploying the generated multiple simulation task events according to the preset task scheduling strategy.

9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the instructions to implement the cluster task simulation method as claimed in claim 8.

10. A computer-readable storage medium storing instructions, characterized in that: When the instructions are executed by at least one computing device, the at least one computing device is prompted to execute the cluster task simulation method as claimed in claim 8.