A policy scheduling method and system
Patent Information
- Application Number
- CN202210851274.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-20
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2042-07-20
AI Technical Summary
[0004]目前设计的规则引擎,在策略调度过程中的时间复杂度和空间复杂度较高,导致策略调度效率低、联动响应速度慢
[0018]1)策略调度过程完全运行在内存中,没有大量的读写数据库等耗时操作,提高运行速度;
Smart Images

Figure CN115220894B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer information processing technology, and in particular relates to a strategy scheduling method and system. Background Technology
[0002] With the development of IoT technology, people's production and life have become much more convenient. An IoT system, composed of edge computing units and related devices such as cameras, broadcasting systems, information screens, lighting controllers, sensors, and artificial intelligence devices, can automatically operate and maintain each related device in the IoT system through the edge computing units. This includes managing related devices and controlling them automatically or manually.
[0003] Generally, a rule engine is designed to manage and schedule various strategies, such as timed strategies, internal linkage strategies, external linkage strategies, and manual control strategies, to achieve automatic operation and maintenance functions of the edge computing unit for associated devices. Among them, timed strategies are strategies that control associated devices to perform corresponding actions within a specified time period; internal linkage strategies are strategies that trigger associated devices to perform corresponding actions when certain events or attribute changes occur; external linkage strategies are linkage strategies that are decided by the rule engine of an external platform and then issued to this edge computing unit for execution; and manual control strategies are manual control strategies for associated devices when they are in automatic mode and do not need to be switched to manual mode.
[0004] The current rule engine design has high time and space complexity in the policy scheduling process, resulting in low policy scheduling efficiency and slow linkage response speed. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a strategy scheduling method and system to reduce the time and space complexity of the strategy scheduling process and improve strategy scheduling efficiency and linkage response speed.
[0006] This application provides a strategy scheduling method, comprising: a strategy management module sending strategy tasks to a corresponding level of scheduling module according to the strategy type, wherein the scheduling module includes a high-level scheduling module and a low-level scheduling module; the high-level scheduling module sending a first target task to the low-level scheduling module according to a first preset priority; and the low-level scheduling module sending a second target task to a running module according to a second preset priority to execute the second target task.
[0007] In one embodiment, according to the policy type, the policy task is sent to the corresponding level of the scheduling module, including: if the policy type is a timed policy, the timed policy task is sent to the high-level scheduling module; if the policy type is another policy, the other policy task is sent to the low-level scheduling module.
[0008] In one embodiment, the other strategy tasks include internal linkage strategy tasks; sending other strategy tasks to the low-level scheduling module includes: the strategy management module obtaining a first execution condition for the internal linkage strategy task; and when the first execution condition meets a preset condition, sending the internal linkage strategy task to the low-level scheduling module.
[0009] In one embodiment, the step of the high-level scheduling module sending a first target task to the low-level scheduling module according to a first preset priority includes: the high-level scheduling module taking a timed strategy task that is in a waiting state and whose start execution time has arrived as the first target task, and sending the first target task to the low-level scheduling module.
[0010] In one embodiment, the low-level scheduling module sends a second target task to the running module according to a second preset priority, including: the low-level scheduling module designates a first strategy task that is in a ready state, within an execution period, and has the highest execution priority as the second target task; if there is no second strategy task in a running state, the low-level scheduling module sends the second target task to the running module for execution; if there is a second strategy task in a running state, the low-level scheduling module obtains a second execution condition of the second strategy task and a third execution condition of the second target task; when the relationship between the second execution condition and the third execution condition satisfies a preset relationship, the low-level scheduling module sends the second target task to the running module for execution; when the relationship between the second execution condition and the third execution condition does not satisfy the preset relationship, the low-level scheduling module sends the second target task to the running module according to the execution priority relationship between the second strategy task and the second target task.
[0011] In one embodiment, the low-level scheduling module sends the second target task to the running module according to the execution priority relationship between the second policy task and the second target task, including: if both the second policy task and the second target task are timed policy tasks, and the execution priority of the second policy task is lower than the execution priority of the second target task, then the low-level scheduling module sends the second target task to the running module to execute the second target task and adjusts the state of the second policy task to a ready state; if the second policy task is a timed policy task, the second target task is another policy task, and the execution priority of the second policy task is lower than the execution priority of the second target task, then the low-level scheduling module sends the second target task to the running module to execute the second target task and adjusts the state of the second policy task to a suspended state.
[0012] After adjusting the state of the second strategy task to the suspended state, the following steps are taken: if the execution priority of the second strategy task is lower than the execution priority of other timed strategy tasks during the execution of the second target task, the low-level scheduling module adjusts the state of the second strategy task to the ready state; if the execution priority of the second strategy task is the highest during the execution of the second target task, the low-level scheduling module adjusts the state of the second strategy task to the running state when the second target task is completed.
[0013] In one embodiment, after the low-level scheduling module sends the second target task to the running module according to the second preset priority, the process includes: the running module sending the completed second target task to the low-level scheduling module; if the completed second target task is the timed policy task, the low-level scheduling module sending the completed second target task to the high-level scheduling module; if the completed second target task is the other policy task, the low-level scheduling module deleting the completed second target task.
[0014] In one embodiment, the strategy scheduling method includes: if the end execution time of a timed strategy task in a ready state arrives, the low-level scheduling module sends the timed strategy task to the high-level scheduling module; if the end execution time of other strategy tasks in a ready state arrives, the low-level scheduling module deletes the other strategy tasks.
[0015] This application also provides a strategy scheduling system, which includes a strategy management module, a high-level scheduling module, a low-level scheduling module, and an execution module. The strategy management module is used to send strategy tasks to the corresponding level of the scheduling module according to the strategy type. The high-level scheduling module is used to send a first target task to the low-level scheduling module according to a first preset priority. The low-level scheduling module is used to send a second target task to the execution module according to a second preset priority. The execution module is used to execute the second target task.
[0016] In one embodiment, the low-level scheduling module is further configured to send the timed strategy task whose execution time has reached the end of execution state after execution completion and / or ready state to the high-level scheduling module, and delete other strategy tasks whose execution time has reached the end of execution state after execution completion and / or ready state.
[0017] The policy scheduling method and system provided in this application, through the separation of policy management and policy scheduling functions, the design of high-level scheduling and low-level scheduling functions, and the adjustment of policy state during policy scheduling, can bring the following beneficial effects:
[0018] 1) The policy scheduling process runs entirely in memory, without a large number of time-consuming operations such as reading and writing to the database, thus improving the running speed;
[0019] 2) Control the execution depth of the strategy. Strategies that cannot meet the conditions for subsequent execution can only stop at the current execution stage, reducing the scheduling workload of each module;
[0020] 3) Manage strategies in different states in different modules, dynamically adjust the latest state of the strategy in real time, and distribute the state adjustment in idle time to shorten the decision-making time at critical time points.
[0021] 4) Easy to expand and update, and easy to add artificial intelligence modules such as expert systems;
[0022] 5) Reduce the time and space complexity of the policy scheduling process;
[0023] 6) Improve strategy scheduling efficiency and linkage response speed. Attached Figure Description
[0024] Figure 1 This is a flowchart illustrating the strategy scheduling method provided in Embodiment 1 of this application;
[0025] Figure 2 This is a schematic diagram of the specific process of the strategy scheduling method provided in Embodiment 2 of this application.
[0026] Figure 3 This is a schematic diagram of the strategy scheduling system provided in Embodiment 3 of this application. Detailed Implementation
[0027] The technical solutions of this application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this application. The word "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0028] Figure 1 This is a flowchart illustrating the strategy scheduling method provided in Embodiment 1 of this application. Figure 1 As shown, the policy scheduling method of this application may include the following steps:
[0029] Step S101: The policy management module sends the policy task to the corresponding level of the scheduling module according to the policy type. The scheduling module includes a high-level scheduling module and a low-level scheduling module.
[0030] In one embodiment, step S101 includes:
[0031] If the policy type is a timed policy, the timed policy task will be sent to the advanced scheduling module.
[0032] If the strategy type is other, then the other strategy task will be sent to the low-level scheduling module.
[0033] Optionally, the strategy types include timed strategies, internal linkage strategies, external linkage strategies, and manual control strategies, among other strategies; the strategy tasks include timed strategy tasks, internal linkage strategy tasks, external linkage strategy tasks, and manual control strategies, among other strategy tasks.
[0034] In one implementation, sending other policy tasks to the low-level scheduling module includes:
[0035] The strategy management module obtains the first execution condition for internal linkage strategy tasks;
[0036] When the first execution condition meets the preset condition, the internal linkage strategy task is sent to the low-level scheduling module.
[0037] Optionally, the first execution condition includes events, attribute changes, and other conditions required to trigger the execution of the internal linkage strategy task; the first execution condition satisfies preset conditions, including events, attribute changes, and other conditions that trigger the execution of the internal linkage strategy task satisfying preset conditions.
[0038] Optionally, the initial state of a timed strategy task entering the high-level scheduling module is a waiting state; the initial state of other strategy tasks entering the low-level scheduling module is a ready state.
[0039] Step S102: The high-level scheduling module sends the first target task to the low-level scheduling module according to the first preset priority;
[0040] In one embodiment, step S102 includes:
[0041] The high-level scheduling module will designate the timed policy task that is in a waiting state and whose start time has arrived as the first target task, and send the first target task to the low-level scheduling module.
[0042] Optionally, the advanced scheduling module obtains the status and start time of each strategy task in the strategy task list of this module, and sends the timed strategy task that is in the waiting state and whose start time has arrived as the first target task to the low-level scheduling module.
[0043] Optionally, after the first target task is sent from the high-level scheduling module to the low-level scheduling module, its status is changed from waiting to ready.
[0044] Step S103: The low-level scheduling module sends the second target task to the running module according to the second preset priority to execute the second target task.
[0045] In one embodiment, step S103 includes:
[0046] The low-level scheduling module will select the first strategy task, which is in the ready state, within the execution period, and has the highest execution priority, as the second target task.
[0047] If there is no running second strategy task, the low-level scheduling module will send the second target task to the running module for execution.
[0048] If there is a second strategy task in the running state, the low-level scheduling module obtains the second execution condition of the second strategy task and the third execution condition of the second target task respectively.
[0049] When the relationship between the second execution condition and the third execution condition satisfies the preset relationship, the low-level scheduling module sends the second target task to the running module to execute the second target task;
[0050] When the relationship between the second execution condition and the third execution condition does not meet the preset relationship, the low-level scheduling module sends the second target task to the running module according to the relationship between the execution priorities of the second strategy task and the second target task.
[0051] Optionally, the low-level scheduling module obtains the status, execution time period (e.g., 8:00-9:00), and execution priority of each strategy task in the strategy task list of this module, and selects the first strategy task, which is in the ready state, within the execution time period (e.g., the current time is within the 8:00-9:00 time period), and has the highest execution priority, as the second target task. Further, the low-level scheduling module checks with the running module to see if a second strategy task exists in a running state. If a second strategy task exists in a running state, the low-level scheduling module further analyzes whether there is a conflict between the execution conditions (e.g., the device, instructions, etc.) of the second strategy task and the second target task. If the execution conditions of the second strategy task and the second target task do not conflict, the low-level scheduling module sends the second target task to the running module and adjusts the status of the second target task from the ready state to the running state. The running module then executes the running second target task. If the execution conditions of the second strategy task and the second target task conflict, the low-level scheduling module sends the second target task to the running module according to the relationship between the execution priorities of the second strategy task and the second target task. Optionally, the execution priority of each strategy task in the low-level scheduling module is set according to actual usage requirements.
[0052] In one embodiment, the low-level scheduling module sends the second target task to the execution module according to the execution priority relationship between the second strategy task and the second target task, including:
[0053] If both the second strategy task and the second target task are timed strategy tasks, and the execution priority of the second strategy task is lower than that of the second target task, then the low-level scheduling module will send the second target task to the running module to execute the second target task and adjust the status of the second strategy task to the ready state.
[0054] If the second strategy task is a timed strategy task, the second target task is another strategy task, and the execution priority of the second strategy task is lower than the execution priority of the second target task, then the low-level scheduling module will send the second target task to the running module to execute the second target task and adjust the status of the second strategy task to the suspended state.
[0055] Optionally, if the execution conditions of the second strategy task and the second target task conflict, and both the second strategy task and the second target task are timed strategy tasks, if the execution priority of the second strategy task in the running state is lower than that of the second target task, the low-level scheduling module sends an instruction to the running module to cancel the execution of the second strategy task. The running module cancels the execution of the second strategy task and sends the second strategy task to the low-level scheduling module. The low-level scheduling module adjusts the state of the canceled second strategy task to the ready state and adjusts the state of the second target task from the ready state to the running state. At the same time, it sends the second target task to the running module, and the running module executes the running second target task.
[0056] Optionally, if the execution conditions of the second strategy task and the second target task conflict, and the second strategy task is a timed strategy task while the second target task is another strategy task, if the execution priority of the running second strategy task is lower than that of the second target task, the low-level scheduling module sends an instruction to the running module to cancel the execution of the second strategy task. The running module cancels the execution of the second strategy task and sends it back to the low-level scheduling module. The low-level scheduling module adjusts the status of the canceled second strategy task to a suspended state and adjusts the status of the second target task from a ready state to a running state. At the same time, it sends the second target task back to the running module, and the running module executes the running second target task.
[0057] In one embodiment, after adjusting the state of the second strategy task to a suspended state, the process includes:
[0058] If, during the execution of the second target task, the execution priority of the second strategy task is lower than that of other timed strategy tasks, the low-level scheduling module will adjust the state of the second strategy task to the ready state.
[0059] If the second strategy task has the highest execution priority during the execution of the second target task, then when the second target task is completed, the low-level scheduling module will adjust the state of the second strategy task to the running state.
[0060] Optionally, after adjusting the status of the second strategy task to the suspended state, during the execution of the second target task, if a new timed strategy task with a higher execution priority is added to the strategy task list of the low-level scheduling module, the status of the second strategy task is adjusted from the suspended state to the ready state; if no new timed strategy task or other strategy task with a higher execution priority is added to the strategy task list of the low-level scheduling module, that is, the second strategy task has the highest execution priority, then when the second target task is completed, the low-level scheduling module adjusts the status of the second strategy task from the suspended state to the running state and sends the second strategy task to the running module, and the running module executes the second strategy task in the running state.
[0061] In one embodiment, after step S103, the following is included:
[0062] The execution module will send the completed second target task to the low-level scheduling module;
[0063] If the completed second objective task is a timed policy task, the low-level scheduling module will send the completed second objective task to the high-level scheduling module;
[0064] If the completed second objective task is a task with another strategy, the low-level scheduling module will delete the completed second objective task.
[0065] Optionally, after the second target task is completed, the running module sends the second strategy task to the low-level scheduling module. The low-level scheduling module determines the type of the completed second strategy task. If the second target task is a timed strategy task, considering the normal execution characteristics of timed strategy tasks, the low-level scheduling module sends the second target task to the high-level scheduling module. The high-level scheduling module adjusts the status of the second target task to a waiting state, and the subsequent scheduling process will be carried out when the start execution time of the second target task arrives. If the second target task is another strategy task, considering the short-term and trigger-based execution characteristics of other strategy tasks, the low-level scheduling module directly deletes the completed second target task.
[0066] It is worth mentioning that the strategy scheduling method provided in this application also includes:
[0067] If the execution time of a timed policy task in the ready state arrives, the low-level scheduling module will send the timed policy task to the high-level scheduling module.
[0068] If the execution time of other policy tasks that are in the ready state arrives, the low-level scheduling module deletes the other policy tasks.
[0069] Optionally, the low-level scheduling module may have multiple ready-to-execute policy tasks waiting to be scheduled, and these policy tasks may have execution time limits. If the end time of a ready-to-execute timed policy task arrives (i.e., the timed policy task has not been executed but its execution time has expired), considering the normal execution characteristics of timed policy tasks, the low-level scheduling module sends the unexecuted but expired timed policy task to the high-level scheduling module. The high-level scheduling module adjusts the status of the timed policy task to a waiting state, and the subsequent scheduling process will proceed when the start time of the timed policy task arrives. If the end time of other ready-to-execute policy tasks arrives (i.e., other policy tasks have not been executed but their execution time has expired), considering the short-term, trigger-based execution characteristics of other policy tasks, the low-level scheduling module directly deletes the other unexecuted but expired policy tasks.
[0070] The strategy scheduling method provided in Embodiment 1 of this application effectively reduces the time and space complexity of the strategy scheduling process and effectively improves the efficiency of strategy scheduling and the speed of linkage response by separating strategy management and strategy scheduling functions, designing high-level scheduling and low-level scheduling functions, and adjusting the strategy state during the strategy scheduling process.
[0071] Figure 2 This is a schematic diagram illustrating the specific process of the strategy scheduling method provided in Embodiment 2 of this application. Figure 2 As shown, the policy scheduling method provided in this application may include the following steps:
[0072] Step S201: The advanced scheduling module obtains the status and start execution time of each policy task in the policy task list of this module;
[0073] Step S202: The advanced scheduling module determines whether there is a first target task that is in a waiting state and whose start execution time has arrived;
[0074] If there is a first target task that is in a waiting state and whose start time has arrived, then step S203 is executed: the high-level scheduling module sends the first target task to the low-level scheduling module;
[0075] If there is no first target task that is in a waiting state and whose start time has arrived, then return to step S201.
[0076] Step S204: The low-level scheduling module obtains the status, execution time period, and execution priority of each policy task in the policy task list of this module;
[0077] Step S205: The low-level scheduling module determines whether there are any policy tasks that are in a ready state and within the execution period;
[0078] If there is a strategy task that is in a ready state and within the execution period, then step S206 is executed: the low-level scheduling module sends the second target task that is in a ready state, within the execution period and has the highest execution priority to the running module, and adjusts the status of the second target task to the running state;
[0079] If there are no policy tasks in a ready state and within the execution period, return to step S204.
[0080] Step S207: The low-level scheduling module determines whether there are any strategy tasks whose execution time has expired and / or whose execution has ended;
[0081] If there is a strategy task whose execution time has expired and / or whose execution has ended, then step S208 is executed: the low-level scheduling module determines whether the strategy task whose execution time has expired and / or whose execution has ended is a timed strategy task.
[0082] If the strategy task whose execution time has expired and / or whose execution has ended is a timed strategy task, then execute step S209: The low-level scheduling module sends the strategy task whose execution time has expired and / or whose execution has ended to the high-level scheduling module and returns to execute step S201.
[0083] If the strategy task whose execution time has expired and / or whose execution has ended is not a timed strategy task, then step S210 is executed: the low-level scheduling module deletes the strategy task whose execution time has expired and / or whose execution has ended.
[0084] If there are no strategy tasks whose execution time has expired and / or whose execution has ended, return to step S204.
[0085] Step S211: The running module executes the second target task that is in the running state;
[0086] After the second target task in the running state is completed, step S212 is executed: the running module sends the completed second target task to the low-level scheduling module, and then returns to step S208.
[0087] Optionally, the policy tasks in the policy task list of the high-level scheduling module are timed policy tasks sent by the policy management module; the policy tasks in the policy task list of the low-level scheduling module include the first target task sent by the high-level scheduling module and other policy tasks such as internal linkage policy tasks, external linkage policy tasks, and manual control policy tasks sent by the policy management module.
[0088] The strategy scheduling method provided in Embodiment 2 of this application schedules timed strategy tasks through a high-level scheduling module and performs overall scheduling of various types of strategy tasks through a low-level scheduling module. This effectively reduces the time and space complexity of the strategy scheduling process and effectively improves the efficiency of strategy scheduling and the speed of linkage response.
[0089] Figure 3 This is a schematic diagram of the strategy scheduling system provided in Implementation 3 of this application. For example... Figure 3 As shown, the policy scheduling system of this application includes a policy management module 11, a high-level scheduling module 12, a low-level scheduling module 13, and an operation module 14; the policy management module 11, the high-level scheduling module 12, and the low-level scheduling module 13 are interconnected, and the low-level scheduling module 13 is connected to the operation module 14.
[0090] The strategy management module 11 is used to send strategy tasks to the corresponding level of the scheduling module according to the strategy type;
[0091] The high-level scheduling module 12 is used to send the first target task to the low-level scheduling module according to the first preset priority;
[0092] The low-level scheduling module 13 is used to send the second target task to the running module 14 according to the second preset priority;
[0093] Module 14 is used to execute the second objective task.
[0094] In one embodiment, the strategy management module 11 is also used to provide an external interface to add, delete, modify, and query timed strategy tasks, internal linkage strategy tasks, external linkage strategy tasks, and manual control strategy tasks, and to save timed strategy tasks and internal linkage strategy tasks locally.
[0095] In one embodiment, the low-level scheduling module 13 is further configured to send the timed strategy task whose execution time has reached the end of execution state after execution completion and / or ready state to the high-level scheduling module, and delete other strategy tasks whose execution time has reached the end of execution state after execution completion and / or ready state.
[0096] The specific implementation method of this embodiment refers to the embodiment of the strategy control method described above, and will not be repeated here.
[0097] The strategy scheduling system provided in Embodiment 3 of this application effectively reduces the time and space complexity of the strategy scheduling process and effectively improves the efficiency of strategy scheduling and the speed of linkage response through the interaction between the strategy management module, the high-level scheduling module, the low-level scheduling module and the operation module.
[0098] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0099] In this document, the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, which includes not only the elements listed but also other elements not expressly listed.
[0100] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A policy scheduling method, characterized in that, The method comprises the following steps: The policy management module sends the policy task to the scheduling module of the corresponding level according to the policy type, wherein the scheduling module comprises a high-level scheduling module and a low-level scheduling module; The step of sending the policy task to the scheduling module of the corresponding level according to the policy type comprises the following steps: If the policy type is a timing policy, the timing policy task is sent to the high-level scheduling module; If the policy type is another policy, the another policy task is sent to the low-level scheduling module; The high-level scheduling module sends a first target task to the low-level scheduling module according to a first preset priority; The high-level scheduling module takes the timing policy task in the waiting state and the start execution time as the first target task, and sends the first target task to the low-level scheduling module; The low-level scheduling module sends a second target task to a running module according to a second preset priority to execute the second target task; The low-level scheduling module takes the first policy task in the ready state, within the execution period and with the highest execution priority as the second target task; If there is no second policy task in the running state, the low-level scheduling module sends the second target task to the running module to execute the second target task; If there is a second policy task in the running state, the low-level scheduling module sends the second target task to the running module to execute the second target task according to the execution condition relationship and the execution priority relationship of the second target task and the second policy task; After the low-level scheduling module sends the second target task to the running module according to the second preset priority, the method comprises the following steps: The running module sends an executed second target task to the low-level scheduling module; If the executed second target task is the timing policy task, the low-level scheduling module sends the executed second target task to the high-level scheduling module; If the executed second target task is the another policy task, the low-level scheduling module deletes the executed second target task.
2. The policy dispatch method of claim 1, wherein, The another policy task comprises an internal linkage policy task; The step of sending the another policy task to the low-level scheduling module comprises the following steps: The policy management module acquires a first execution condition of the internal linkage policy task; When the first execution condition meets a preset condition, the internal linkage policy task is sent to the low-level scheduling module.
3. The policy scheduling method of claim 1, wherein, The step of sending the second target task to the running module according to the second preset priority by the low-level scheduling module comprises the following steps: If there is a second policy task in the running state, the low-level scheduling module acquires a second execution condition of the second policy task and a third execution condition of the second target task respectively; When the relationship between the second execution condition and the third execution condition meets a preset relationship, the low-level scheduling module sends the second target task to the running module to execute the second target task; When the relationship between the second execution condition and the third execution condition does not satisfy the preset relationship, the low-level scheduling module sends the second target task to the running module according to the relationship between the execution priorities of the second strategy task and the second target task.
4. The policy dispatch method of claim 3, wherein, The low-level scheduling module sends the second target task to the running module according to the relationship between the execution priorities of the second strategy task and the second target task, comprising: If the second strategy task and the second target task are both the timing strategy task, and the execution priority of the second strategy task is lower than the execution priority of the second target task, the low-level scheduling module sends the second target task to the running module to execute the second target task, and adjusts the state of the second strategy task to a ready state; If the second strategy task is the timing strategy task, the second target task is the other strategy task, and the execution priority of the second strategy task is lower than the execution priority of the second target task, the low-level scheduling module sends the second target task to the running module to execute the second target task, and adjusts the state of the second strategy task to a suspended state; After adjusting the state of the second strategy task to the suspended state, comprising: If the execution priority of the second strategy task is lower than the execution priority of other timing strategy tasks during the execution of the second target task, the low-level scheduling module adjusts the state of the second strategy task to the ready state; If the execution priority of the second strategy task is the highest during the execution of the second target task, the low-level scheduling module adjusts the state of the second strategy task to a running state when the second target task is executed.
5. The policy dispatch method of claim 1, wherein, The strategy scheduling method, comprising: If the end execution time of the timing strategy task in the ready state arrives, the low-level scheduling module sends the timing strategy task to the high-level scheduling module; If the end execution time of the other strategy task in the ready state arrives, the low-level scheduling module deletes the other strategy task.
6. A policy scheduling system characterized by, The strategy scheduling system comprises a strategy management module, a high-level scheduling module, a low-level scheduling module, and a running module; The strategy management module is configured to send strategy tasks to scheduling modules of corresponding levels according to strategy types; The strategy management module is configured to send strategy tasks to scheduling modules of corresponding levels according to strategy types, and further comprises: If the strategy type is a timing strategy, send the timing strategy task to the high-level scheduling module; If the strategy type is an other strategy, send the other strategy task to the low-level scheduling module; The high-level scheduling module is configured to send a first target task to the low-level scheduling module according to a first preset priority; The high-level scheduling module sends a timing strategy task in a waiting state and whose start execution time arrives as the first target task, and sends the first target task to the low-level scheduling module; The low-level scheduling module is configured to send a second target task to the running module according to a second preset priority; The low-level scheduling module takes a first strategy task in a ready state, within an execution period, and with the highest execution priority as the second target task; If there is no second strategy task in a running state, the low-level scheduling module sends the second target task to the running module to execute the second target task; If there is a second strategy task in a running state, according to an execution condition relationship and an execution priority relationship of the second target task and the second strategy task, the low-level scheduling module sends the second target task to the running module to execute the second target task; The running module is configured to execute the second target task; The low-level scheduling module is further configured to send a timing strategy task with an execution completion and / or a ready state ending execution time arrival to the high-level scheduling module, and delete other strategy tasks with an execution completion and / or a ready state ending execution time arrival.
Citation Information
Patent Citations
Hybrid task scheduling method and model for railway locomotive operation control system
CN106773711A