Adaptive task scheduling method and device for distributed rule engine and electronic equipment

By using an adaptive task scheduling method, parameters are adjusted based on the execution results and load data of the rule engine. A dynamic priority algorithm and a PID controller are used to optimize task allocation, which solves the problem of low task scheduling efficiency in distributed rule engines and achieves efficient task management and resource utilization.

CN114327807BActive Publication Date: 2026-01-02ZHONGKE JUXIN INFORMATION TECH BEIJING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011339240.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-25
Publication Date
2026-01-02
Estimated Expiration
2040-11-25

AI Technical Summary

Technical Problem

Existing distributed rule engines struggle to effectively improve overall execution efficiency in task scheduling, especially under heavy workloads where they are unable to achieve real-time, priority scheduling, and dynamic planning.

Method used

By using an adaptive task scheduling method, task allocation and its order are controlled based on the execution results of each rule engine. Parameters are adjusted using load data, and task allocation is optimized using a dynamic priority algorithm and a PID controller to ensure load stability and resource utilization.

Benefits of technology

It improves the overall execution efficiency of the distributed rule engine, realizes efficient task allocation and priority management, and enhances system stability and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114327807B_ABST
    Figure CN114327807B_ABST
Patent Text Reader

Abstract

The application discloses a kind of adaptive task scheduling method, device and electronic equipment for distributed rule engine.The adaptive task scheduling method for distributed rule engine includes: control the task of predetermined number enters task queue;Determine the task in the task queue to be assigned to each rule engine in the distributed rule engine;Determine the order of task assigned to each rule engine;Obtain the execution result that each rule engine executes the task;And, based on the execution result, adjust the parameters of the task to be assigned to each rule engine.This way, based on the execution result of each rule engine to the task, control the task assigned to each rule engine and the order of execution thereof, improve the overall execution efficiency of distributed rule engine.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of task scheduling, and in particular to an adaptive task scheduling method, device and electronic equipment for a distributed rule engine. BACKGROUND

[0002] The distributed rule engine supporting real-time tasks is researched and developed for financial intelligent risk control, aiming to realize the operation mode of centralized business processing. The system relies on the enterprise-level decision management platform based on the service-oriented architecture, and aims to solve various modern queuing theory problems such as real-time performance of rule execution, priority scheduling, dynamic planning, parallel pipeline, etc. under the mode of huge business volume, so as to realize the operation mode of core decision function commonality, business service factory, and centralized risk control.

[0003] Generally, the intelligent decision management platform of an enterprise mainly has three layers: core layer, service layer, and application layer. Among them, task scheduling is the key content in the core layer, therefore, it is expected to provide a task scheduling scheme applicable to the distributed rule engine supporting real-time tasks as described above. SUMMARY

[0004] In order to solve the above technical problems, the present application is proposed. The embodiments of the present application provide an adaptive task scheduling method, device and electronic equipment for a distributed rule engine, which controls the tasks allocated to each rule engine and the execution order of the tasks based on the execution results of the tasks by each rule engine, thereby improving the overall execution efficiency of the distributed rule engine.

[0005] According to an aspect of the present application, an adaptive task scheduling method for a distributed rule engine is provided, comprising: controlling a predetermined number of tasks to enter a task queue; determining tasks to be allocated to each rule engine in the distributed rule engine in the task queue; determining the order of the tasks allocated to each rule engine; obtaining the execution results of each rule engine executing the tasks; and adjusting the parameters of the tasks to be allocated to each rule engine based on the execution results.

[0006] In the above adaptive task scheduling method for a distributed rule engine, obtaining the execution results of each rule engine executing the tasks comprises: obtaining the load data of each rule engine executing the tasks; and controlling a predetermined number of tasks to enter the task queue comprises: determining the overall load situation of a plurality of rule engines based on the load data of each rule engine in the previous period; and adjusting the number of tasks entering the task queue in the current period based on the overall load situation.

[0007] In the adaptive task scheduling method for distributed rule engines, the adjusting of the parameters of the tasks to be allocated to each rule engine based on the execution result comprises: calculating the parameters of the tasks to be allocated to each rule engine in the current period based on the load data of the previous period; evaluating the allowable variation range of the load data of the current period by the calculation of the parameters to obtain the reference value of the load data of the current period; and adjusting the parameters of the tasks to be allocated to each rule engine in the current period by a preset algorithm based on the reference value of the load data.

[0008] In the adaptive task scheduling method for distributed rule engines, the determining of the sequence of the tasks to be allocated to each rule engine comprises: for each rule engine, scheduling a plurality of tasks to be executed by the rule engine by a predetermined algorithm based on dynamic priority to determine the sequence of the plurality of tasks.

[0009] In the adaptive task scheduling method for distributed rule engines, the predetermined algorithm based on dynamic priority determines the priority of the allocated tasks based on the sequence of the deadlines of the tasks, wherein the priority of the task with an earlier deadline is higher, and the priority of the task with a later deadline is lower.

[0010] In the adaptive task scheduling method for distributed rule engines, the predetermined algorithm based on dynamic priority determines the priority of the allocated tasks based on the criticality ratio of the tasks, which is the ratio of (current time-process start time) to process estimated time of the task, wherein the priority of the task with a larger criticality ratio value is higher.

[0011] In the adaptive task scheduling method for distributed rule engines, the predetermined algorithm based on dynamic priority determines the priority of the allocated tasks based on the shortest processing time of the tasks, which is calculated from the allocated tasks by a predetermined algorithm.

[0012] In the adaptive task scheduling method for distributed rule engines, the predetermined algorithm based on dynamic priority determines the priority of the allocated tasks based on the arrival time of the tasks, wherein the priority of the task with an earlier arrival time is higher.

[0013] In the adaptive task scheduling method for distributed rule engines, the predetermined algorithm based on dynamic priority sets weights for different priorities and sorts the different priorities according to the sizes of the weights to determine the priority of each task.

[0014] According to another aspect of the present application, there is provided an adaptive task scheduling apparatus for a distributed rule engine, comprising: a queue control unit configured to control a predetermined number of tasks to enter a task queue; a task allocation unit configured to determine tasks in the task queue to be allocated to each rule engine in the distributed rule engine; a task scheduling unit configured to determine an order of the tasks allocated to each rule engine; a task execution unit configured to obtain an execution result of each rule engine executing the tasks; and a task feedback unit configured to adjust parameters of the tasks to be allocated to each rule engine based on the execution result.

[0015] According to yet another aspect of the present application, there is provided an electronic device, comprising: a processor; and a memory having computer program instructions stored therein, the computer program instructions, when executed by the processor, causing the processor to perform the adaptive task scheduling method for a distributed rule engine as described above.

[0016] According to still another aspect of the present application, there is provided a computer readable medium having computer program instructions stored therein, the computer program instructions, when executed by a processor, causing the processor to perform the adaptive task scheduling method for a distributed rule engine as described above.

[0017] The adaptive task scheduling method, apparatus and electronic device for a distributed rule engine according to embodiments of the present application can control the tasks allocated to each rule engine and the order of execution of the tasks based on the execution result of each rule engine on the tasks, thereby improving the overall execution efficiency of the distributed rule engine. BRIEF DESCRIPTION OF DRAWINGS

[0018] The above and other objects, features and advantages of the present application will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings in which:

[0019] Figure 1 FIG. 1 illustrates a schematic diagram of an overall architecture of a priority ordering and scheduling control mechanism according to embodiments of the present application.

[0020] Figure 2 FIG. 2 illustrates a flowchart of an adaptive task scheduling method for a distributed rule engine according to embodiments of the present application.

[0021] Figure 3 FIG. 3 illustrates a schematic diagram of the working of queue management according to embodiments of the present application.

[0022] Figure 4 FIG. 1 illustrates a schematic diagram of an adaptive task scheduling method for a distributed rule engine according to an embodiment of the present application.

[0023] Figure 5 FIG. 2 illustrates a block diagram of an adaptive task scheduling apparatus for a distributed rule engine according to an embodiment of the present application.

[0024] Figure 6 FIG. 3 illustrates a block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] Hereinafter, example embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part but not all of the embodiments of the present application. It should be understood that the present application is not limited to the described example embodiments.

[0026] Exemplary method

[0027] As described above, in the task scheduling process of an enterprise-level intelligent decision management platform, a queue control mechanism with a priority queue is adopted. The queue control mechanism provides adjustment in different dimensions such as business rules, rule sets, permissions, time to be completed, importance level, system load, etc. Moreover, the queue can use a PID (Proportional Integral Derivative) priority scheduler to control each link of rule set execution in real time.

[0028] Figure 1 FIG. 4 illustrates a schematic diagram of the overall architecture of a priority sorting and scheduling control mechanism according to an embodiment of the present application.

[0029] As shown in FIG. 5, three dimensions of priority control are provided in the rule task queue to be executed: Figure 1

[0030] 1. Initial priority management: priority is defined by the user, and the priority of the rule is taken out through rule definition maintenance of the rule coding table;

[0031] 2. Manual adjustment: controlled by the user, the priority of the current rule execution task and the rule set execution task is adjusted through the rule priority management function;

[0032] 3. System adjustment: when the rule engine calculates the submission task, the priority manager updates the current working time, and dynamically adjusts according to the parameters defined by the business through the time limit priority rule; the priority base is obtained through the adjustment mode of PID, considering the load of the system, to avoid excessive priority of the rule execution task, thereby improving the overall efficiency.

[0033] ​Here, the adaptive task scheduling method for the distributed rule engine according to the embodiments of the present application mainly involves system adjustment.

[0034] In the following, the adaptive task scheduling method for the distributed rule engine according to the embodiments of the present application will be explained in further detail.

[0035] Figure 2 A flow chart of the adaptive task scheduling method for the distributed rule engine according to the embodiments of the present application is shown.

[0036] As shown in Figure 2 the adaptive task scheduling method for the distributed rule engine according to the embodiments of the present application comprises the steps of: S110, controlling a predetermined number of tasks to enter a task queue; S120, determining the tasks in the task queue to be assigned to each rule engine in the distributed rule engine; S130, determining the order of the tasks assigned to each rule engine; S140, obtaining the execution results of each rule engine executing the tasks; and S150, adjusting the parameters of the tasks to be assigned to each rule engine based on the execution results.

[0037] In the following, each step in the adaptive task scheduling method for the distributed rule engine according to the embodiments of the present application will be explained in detail.

[0038] In step S110, a predetermined number of tasks are controlled to enter a task queue. Here, the task queue can also be referred to as a rule execution queue, which is established based on physical storage according to different rule attributes in order to improve the efficiency of the rule engine client obtaining rules to be executed. Specifically, a plurality of execution queues can be established, and each execution queue receives the request of a task manager in the form of a service, returns the tasks in the current secondary cache, and at the same time maintains the background process of the execution queue of the tasks in the cache. Different execution task queue services and rule execution engines can be deployed on the same or different physical machines to realize distributed rule execution and processing.

[0039] The definition system of the task queue is created by default by the system according to the institution or user to which the rule creator belongs, and corresponds to the institution or user name one by one. At the same time, according to different requirements of rule execution, a virtual user name or institution name can be customized, and the system generates the corresponding queue according to the defined user name or institution name. Different rules in the same rule set definition or any rules in different rule set definitions can be set to execute the queue name. Therefore, it is possible to realize that the rules in different business rule sets can exist in the same task queue, thereby providing convenience for the integration of peripheral business systems.

[0040] To improve the efficiency of the task queue service as much as possible, the task queue itself is also divided into two levels of cache. The queue head is stored in the form of a map, and the first n task data is stored. The request sent by the task manager is preferentially selected from the queue head. Since the number of tasks in the second level cache may be large, the task queue body uses a B-tree structure for storage.

[0041] Figure 3 A schematic diagram of the working of the queue management according to an embodiment of the present application is shown. As Figure 3 shown, the queue management mainly involves maintaining the queues of various services, and can implement functions such as overflow shunting of traffic volume, regional mutual backup, etc. Moreover, the queue management belongs to the queue service of the service layer; the queue service provides the queue management function, and mainly caches rule execution task items. Different queues are provided for each institution or user type, and an index of the user and institution dimensions is established at the same time.

[0042] The adaptive task scheduling method for a distributed rule engine according to an embodiment of the present application mainly involves adaptive task scheduling of a single queue. Therefore, in step S110, a single task queue is first obtained, and a predetermined number of tasks are controlled to enter the task queue.

[0043] Figure 4 A schematic diagram of the adaptive task scheduling method for a distributed rule engine according to an embodiment of the present application is shown. As Figure 4 shown, the control of the predetermined number of tasks entering the task queue is implemented by an admission controller, that is, the admission controller is responsible for controlling the number of tasks entering the task queue. It controls the load of the rule engine in the DWFS (Distributed Workflow System) adaptive rule execution task scheduling system by adjusting the task flow, and can prevent the overall instantaneous overload of multiple rule engines. The admission controller works according to the load data of multiple rule engines obtained by sampling, and calculates the overall load of multiple rule engines in real time, and then performs admission control on the arriving tasks in real time according to the calculation result.

[0044] Therefore, in the adaptive task scheduling method for a distributed rule engine according to an embodiment of the present application, obtaining the execution result of each rule engine executing the task includes: obtaining the load data of each rule engine executing the task; and controlling a predetermined number of tasks to enter the task queue includes: determining the overall load of multiple rule engines based on the load data of each rule engine in the previous period; and adjusting the number of tasks entering the task queue in the current period based on the overall load.

[0045] In step S120, the tasks in the task queue to be allocated to each rule engine in the distributed rule engine are determined. As Figure 4As shown, the task allocator is responsible for assigning tasks in the task queue to the appropriate rule engine in order to make full use of resources and improve throughput.

[0046] In step S130, the order in which tasks are assigned to each rule engine is determined. For example... Figure 4 As shown, the task scheduler is responsible for determining the order in which tasks are executed in a specific rule engine.

[0047] In step S140, the execution result of each rule engine performing the task is obtained. And in step S150, the parameters to be assigned to each rule engine's task are adjusted based on the execution result. Specifically, as follows... Figure 4 As shown, the PID controller uses the PID feedback control method to calculate various parameters of multiple tasks that have entered the task distributor, evaluate the allowable range of total load variation, provide reference values ​​for load changes, and ensure that the load is maintained at a stable and high value.

[0048] here, Figure 4 The admission controller and PID controller in the system can be collectively referred to as the feedback control module. That is, the feedback control module is mainly used to predict and control factors such as load and task execution time, so as to keep the load stable at a high value.

[0049] And, as Figure 4 The task scheduler shown also utilizes the calculation results of the PID controller and, through a spring algorithm, adjusts various parameters of the real-time tasks to be allocated to the rule engine. This accurately reflects the load on the rule engine, aiming to allow the rule engine to handle as many tasks as possible. Here, the spring algorithm is used to find the difference between the target load value and the current load value of the rule engine, and adjusts the relevant parameters affecting the rule engine load. This process is repeated until the calculated current load value is close to the target load value, thus obtaining the relevant parameter values. Furthermore, the task scheduler can also use the highly efficient EDF (Earliest Deadline First) algorithm for scheduling, which can potentially achieve 100% utilization of the rule engine.

[0050] Therefore, in the adaptive task scheduling method for distributed rule engines according to the embodiments of the present application, the adjusting the parameters of the tasks to be allocated to each rule engine based on the execution result comprises: calculating the parameters of the tasks allocated to each rule engine in the current period based on the load data of the previous period; evaluating the allowed variation range of the load data of the current period by the calculation of the parameters to obtain the reference value of the load data of the current period; and adjusting the parameters of the tasks allocated to each rule engine in the current period by a preset algorithm based on the reference value of the load data.

[0051] As described above, when a task is allocated to a certain rule engine, all the tasks on the rule engine are scheduled by the task scheduler using the EDF algorithm. In the EDF algorithm, the priority of a task is dynamically changed.

[0052] That is, in the adaptive task scheduling method for distributed rule engines according to the embodiments of the present application, determining the order of the tasks allocated to each rule engine comprises: for each rule engine, scheduling a plurality of tasks allocated to the rule engine for execution by a predetermined algorithm based on dynamic priority to determine the order of the plurality of tasks.

[0053] In addition, in addition to the EDF algorithm, other predetermined algorithms based on dynamic priority are also included. In the following, some examples of the predetermined algorithm assigning priority will be described.

[0054] In one example, at any time, the tasks in the rule engine scheduled by the task scheduler are sorted in the order of their deadlines from early to late, and the priority of the task with the earlier deadline is higher. That is, when scheduling tasks, the task scheduler selects the task with the earliest deadline to schedule and execute.

[0055] That is, in the adaptive task scheduling method for distributed rule engines described above, the predetermined algorithm based on dynamic priority determines the priority of the tasks based on the order of the deadlines of the allocated tasks, wherein the priority of the task with the earlier deadline is higher, and the priority of the task with the later deadline is lower.

[0056] In another example, the tasks are sorted according to the minimum critical ratio, and the critical ratio is the ratio of (current time - process start time) to the estimated time of the process; if the critical ratio is larger, it means that the process is more likely to be completed, and based on the principle of maximum throughput, the task should be placed in front.

[0057] That is, in the adaptive task scheduling method for the distributed rule engine, the predetermined algorithm based on dynamic priority determines the priority of the assigned task based on a critical ratio of the task, the critical ratio being a ratio of (current time-process start time) to process estimated time of the task, wherein the task with a larger critical ratio value has a higher priority.

[0058] In yet another example, the tasks are sorted by the shortest processing time, i.e., according to a user-defined algorithm, the shortest processing time of the average process being the algorithm to achieve optimal scheduling.

[0059] That is, in the adaptive task scheduling method for the distributed rule engine, the predetermined algorithm based on dynamic priority determines the priority of the assigned task based on the shortest processing time of the task, the shortest processing time of the task being calculated from the assigned task by the predetermined algorithm.

[0060] In addition, a conventional FCFS (First Come First Service) sorting can also be included, i.e., for all tasks, or the same tasks as above, a first come first service manner is adopted.

[0061] That is, in the adaptive task scheduling method for the distributed rule engine, the predetermined algorithm based on dynamic priority determines the priority of the assigned task based on the arrival time of the task, wherein the task with an earlier arrival time has a higher priority.

[0062] In addition, in the embodiments of the present application, weights of different priorities can also be set, and the different priorities are sorted according to the size of the weights.

[0063] That is, in the adaptive task scheduling method for the distributed rule engine, the predetermined algorithm based on dynamic priority sets weights of different priorities, and sorts the different priorities according to the size of the weights to determine the priority of each task.

[0064] Exemplary apparatus

[0065] Figure 5 FIG. 1 illustrates a block diagram of an adaptive task scheduling device for a distributed rule engine according to an embodiment of the present application.

[0066] As Figure 5As shown, the adaptive task scheduling apparatus 200 for distributed rule engine according to the embodiments of the present application comprises: a queue control unit 210 configured to control a predetermined number of tasks to enter a task queue; a task allocation unit 220 configured to determine tasks in the task queue to be allocated to each rule engine in the distributed rule engine; a task scheduling unit 230 configured to determine an order of the tasks allocated to each rule engine; a task execution unit 240 configured to obtain an execution result of each rule engine executing the tasks; and a task feedback unit 250 configured to adjust parameters of the tasks to be allocated to each rule engine based on the execution result.

[0067] In one example, in the adaptive task scheduling apparatus 200 for distributed rule engine described above, the task execution unit 240 is configured to obtain load data of each rule engine executing the tasks; and the queue control unit 210 is configured to determine an overall load condition of a plurality of rule engines based on the load data of each rule engine in a previous period; and adjust the number of tasks entering the task queue in a current period based on the overall load condition.

[0068] In one example, in the adaptive task scheduling apparatus 200 for distributed rule engine described above, the task feedback unit 250 is configured to calculate parameters of the tasks allocated to each rule engine in a current period based on the load data in a previous period; evaluate an allowable variation range of the load data in the current period by calculation of the parameters to obtain a reference value of the load data in the current period; and adjust the parameters of the tasks allocated to each rule engine in the current period by a preset algorithm based on the reference value of the load data.

[0069] In one example, in the adaptive task scheduling apparatus 200 for distributed rule engine described above, the task scheduling unit 230 is configured to, for each rule engine, schedule a plurality of tasks allocated to the rule engine for execution by a predetermined algorithm based on dynamic priority to determine an order of the plurality of tasks.

[0070] In one example, in the adaptive task scheduling apparatus 200 for distributed rule engine described above, the predetermined algorithm based on dynamic priority determines priority of the tasks based on an order of a deadline of the allocated tasks, wherein a task with an earlier deadline has a higher priority, and a task with a later deadline has a lower priority.

[0071] In one example, in the adaptive task scheduling apparatus 200 for distributed rule engine as above, the predetermined algorithm based on dynamic priority determines the priority of the assigned task based on a critical ratio of the task, which is a ratio of (current time-process start time) to process estimated time of the task, wherein the task with a larger value of the critical ratio has a higher priority.

[0072] In one example, in the adaptive task scheduling apparatus 200 for distributed rule engine as above, the predetermined algorithm based on dynamic priority determines the priority of the assigned task based on a shortest processing time of the task, which is calculated by the predetermined algorithm from the assigned task.

[0073] In one example, in the adaptive task scheduling apparatus 200 for distributed rule engine as above, the predetermined algorithm based on dynamic priority determines the priority of the assigned task based on an arrival time of the task, wherein the task with an earlier arrival time has a higher priority.

[0074] In one example, in the adaptive task scheduling apparatus 200 for distributed rule engine as above, the predetermined algorithm based on dynamic priority sets weights for different priorities and sorts the different priorities according to the size of the weights to determine the priority of each task.

[0075] Here, those skilled in the art can understand that other details of the adaptive task scheduling apparatus 200 for distributed rule engine according to the embodiments of the present application are exactly the same as the corresponding details in the “Exemplary Method” section, and thus are not repeated here to avoid redundancy.

[0076] Similarly, the adaptive task scheduling apparatus 200 for distributed rule engine according to the embodiments of the present application can be implemented in various terminal devices, such as a server for an enterprise-level decision management platform, etc. In one example, the adaptive task scheduling apparatus 200 for distributed rule engine according to the embodiments of the present application can be integrated into a terminal device as a software module and / or a hardware module. For example, the adaptive task scheduling apparatus 200 for distributed rule engine can be a software module in the operating system of the terminal device, or can be an application program developed for the terminal device; of course, the adaptive task scheduling apparatus 200 for distributed rule engine can also be one of the many hardware modules of the terminal device.

[0077] Alternatively, in another example, the adaptive task scheduling device 200 for the distributed rule engine and the terminal device can also be separate devices, and the adaptive task scheduling device 200 for the distributed rule engine can be connected to the terminal device via wired and / or wireless networks, and transmit interactive information in accordance with an agreed data format.

[0078] Exemplary electronic device

[0079] Below, for reference Figure 6 This describes an electronic device according to embodiments of the present application.

[0080] Figure 6 A block diagram of an electronic device according to an embodiment of this application is illustrated.

[0081] like Figure 6 As shown, the electronic device 10 includes one or more processors 11 and memory 12.

[0082] The processor 11 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 10 to perform desired functions.

[0083] The memory 12 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 11 may execute the program instructions to implement the adaptive task scheduling method for a distributed rule engine and / or other desired functions described in the various embodiments of this application above. The computer-readable storage medium may also store various contents such as tasks to be assigned, task execution results, task parameters, etc.

[0084] In one example, the electronic device 10 may also include an input device 13 and an output device 14, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).

[0085] The input device 13 may include, for example, a keyboard, a mouse, etc.

[0086] The output device 14 can output various information including the assignment result of the task and the scheduling order, etc. to the outside. The output device 14 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, etc.

[0087] Of course, in order to simplify, Figure 6 Only some of the components in the electronic device 10 related to the present application are shown in the figure, and components such as buses, input / output interfaces, etc. are omitted. In addition, the electronic device 10 can include any other appropriate components according to specific application cases.

[0088] Exemplary computer program product and computer readable storage medium

[0089] In addition to the method and device described above, the embodiments of the present application can also be a computer program product, which includes computer program instructions, which, when executed by a processor, cause the processor to perform the steps in the adaptive task scheduling method for distributed rule engine according to various embodiments of the present application described in the above "Exemplary Method" section of the specification.

[0090] The computer program product can be written in any combination of one or more programming languages, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0091] In addition, the embodiments of the present application can also be a computer readable storage medium, which stores computer program instructions, which, when executed by a processor, cause the processor to perform the steps in the adaptive task scheduling method for distributed rule engine according to various embodiments of the present application described in the above "Exemplary Method" section of the specification.

[0092] The computer readable storage medium can be embodied as one or more combinations of a readable medium and a readable medium can be a readable signal medium or a readable storage medium. A readable storage medium, for example, can include one or more of a semiconductor-based, a magnetic-based, an optical-based, an infrared-based, or a combination of any of these. A more specific example (a non-exhaustive list) of the readable storage medium includes an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0093] The above description of the disclosed aspects is merely exemplary in nature and is not intended to limit the present disclosure, application, and uses. The description of the aspects together with the accompanying drawings are intended to explain aspects of the present disclosure and are not intended to limit the scope of the disclosure, its application, or uses. Notwithstanding the description of the aspects, the disclosure, its application, and uses are capable of considerable modification, alternation, and equivalents. Numerous specific aspects have been discussed herein for purposes of illustration and explanation. One of ordinary skill in the art will appreciate the many variations and modifications that can be made to the described aspects without departing from the scope of the present disclosure. Accordingly, the description of the aspects is not intended to limit the scope of the disclosure, its application, or uses. The description of the aspects together with the accompanying drawings are intended to explain aspects of the present disclosure and are not intended to limit the scope of the disclosure, its application, or uses. The disclosure, its application, and uses are capable of considerable modification, alternation, and equivalents.

[0094] The block diagrams of the devices, apparatuses, equipment, systems referred to in the present disclosure are merely illustrative examples and are not intended to require or imply that the connections, arrangements, configurations are as shown in the block diagrams. As will be recognized by one of ordinary skill in the art, the devices, apparatuses, equipment, systems can be connected, arranged, configured in any manner. Words such as "include," "contain," "have," etc., are used synonymously with each other and are meant to be interpreted in their broadest, most inclusive sense, as opposed to an exclusive or an exhaustive sense. The word "or" as used in "A or B" or "A-B" means "A or B or both A and B". The word "and" as used in "A and B" means "A and B both". The word "such as" is used in its broadest sense, meaning "such as, but not limited to". The word "comprising" as used in this disclosure means "including, but not limited to".

[0095] It should also be noted that in the apparatuses, equipment and methods of the present disclosure, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalents of the present disclosure.

[0096] The above description of the disclosed aspects is merely exemplary in nature and is not intended to limit the present disclosure, application, and uses. The description of the aspects together with the accompanying drawings are intended to explain aspects of the present disclosure and are not intended to limit the scope of the disclosure, its application, or uses. Notwithstanding the description of the aspects, the disclosure, its application, and uses are capable of considerable modification, alternation, and equivalents. Numerous specific aspects have been discussed herein for purposes of illustration and explanation. One of ordinary skill in the art will appreciate the many variations and modifications that can be made to the described aspects without departing from the scope of the present disclosure. Accordingly, the description of the aspects is not intended to limit the scope of the disclosure, its application, or uses. The description of the aspects together with the accompanying drawings are intended to explain aspects of the present disclosure and are not intended to limit the scope of the disclosure, its application, or uses. The disclosure, its application, and uses are capable of considerable modification, alternation, and equivalents.

[0097] The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the application to the forms disclosed herein. Although various example aspects and embodiments have been discussed above, those of ordinary skill in the art will appreciate a variety of modifications, alternatives, permutations, additions, and sub-combinations, which fall within the scope of the application.

Claims

1. An adaptive task scheduling method for distributed rule engines, characterized in that, The method comprises: controlling a predetermined number of tasks to enter a task queue; determining tasks in the task queue to be assigned to each rule engine in the distributed rule engine; determining the order of the tasks assigned to each rule engine; obtaining the execution result of each rule engine executing the tasks; and dynamically adjusting the parameters of the tasks to be assigned to each rule engine based on the execution result. The method of controlling a predetermined number of tasks to enter a task queue comprises: determining the overall load situation of a plurality of rule engines based on the load data of each rule engine in the previous period; and adjusting the number of tasks entering the task queue in the current period based on the overall load situation. The method of determining the order of the tasks assigned to each rule engine comprises: for each rule engine, scheduling a plurality of tasks assigned to the rule engine for execution by a predetermined algorithm based on dynamic priority to determine the order of the plurality of tasks; further comprising: the predetermined algorithm based on dynamic priority sets the weight of different priorities, and sorts different priorities according to the size of the weight to determine the priority of each task. The method of obtaining the execution result of each rule engine executing the tasks comprises: obtaining the load data of each rule engine executing the tasks. The method of dynamically adjusting the parameters of the tasks to be assigned to each rule engine based on the execution result comprises: using a PID controller to adjust each parameter of the real-time tasks to be assigned to the rule engine by a spring algorithm, finding the gap between the target load value and the current load value of the rule engine by the spring algorithm, adjusting the related parameters affecting the load of the rule engine until the calculated current load value is close to the target load value; calculating the parameters of the tasks assigned to each rule engine in the current period based on the load data in the previous period; evaluating the allowable variation range of the load data in the current period by the calculation of the parameters to obtain the reference value of the load data in the current period; and adjusting the parameters of the tasks assigned to each rule engine in the current period by a preset algorithm based on the reference value of the load data. The predetermined algorithm based on dynamic priority determines the priority of the assigned tasks based on the order of the deadline of the tasks, wherein the priority of the task with an earlier deadline is higher, and the priority of the task with a later deadline is lower.

2. The adaptive task scheduling method for distributed rule engine of claim 1, wherein, The predetermined algorithm based on dynamic priority determines the priority of the assigned tasks based on the criticality ratio of the tasks, wherein the criticality ratio of the task is the ratio of the difference between the current time and the process start time of the task to the estimated process time, and the priority of the task with a larger criticality ratio is higher.

3. The adaptive task scheduling method for distributed rule engine of claim 1, wherein, The predetermined algorithm based on dynamic priority determines the priority of the assigned tasks based on the shortest processing time of the tasks, which is calculated by a predetermined algorithm from the assigned tasks.

4. The adaptive task scheduling method for distributed rule engine of claim 1, wherein, The predetermined algorithm based on dynamic priority determines the priority of the assigned tasks based on the arrival time of the tasks, wherein the priority of the task with an earlier arrival time is higher.

5. The adaptive task scheduling method for distributed rule engine as claimed in claim 1 wherein, The method comprises:

6. An adaptive task scheduling apparatus for a distributed rules engine, characterized by, ​ A queue control unit for controlling a predetermined number of tasks to enter a task queue, comprising: determining an overall load condition of a plurality of rule engines based on load data of each rule engine of a previous period; and adjusting the number of tasks entering the task queue in a current period based on the overall load condition; A task allocation unit for determining tasks in the task queue to be allocated to each rule engine of the distributed rule engines; A task scheduling unit for determining an order of the tasks allocated to each rule engine, comprising: for each rule engine, scheduling a plurality of tasks allocated to the rule engine for execution by a predetermined algorithm based on dynamic priority to determine the order of the plurality of tasks; further comprising: the predetermined algorithm based on dynamic priority setting weights of different priorities and sorting the different priorities according to the size of the weights to determine the priority of each task; A task execution unit for obtaining an execution result of each rule engine executing the tasks, comprising: obtaining load data of each rule engine executing the tasks; and A task feedback unit for dynamically adjusting parameters of tasks to be allocated to each rule engine based on the execution result, comprising: using a PID controller to adjust each parameter of real-time tasks to be allocated to a rule engine by a spring algorithm, finding the gap between the target load value and the current load value of the rule engine by the spring algorithm, and adjusting the related parameters affecting the load of the rule engine until the calculated current load value and the target load value are close; calculating the parameters of tasks allocated to each rule engine in a current period based on the load data of a previous period; evaluating the allowed variation range of the load data of the current period by the calculation of the parameters to obtain a reference value of the load data of the current period; and adjusting the parameters of tasks allocated to each rule engine in the current period by a preset algorithm based on the reference value of the load data.

7. An electronic device, comprising: a processor; and a memory having computer program instructions stored therein, which, when executed by the processor, cause the processor to perform the adaptive task scheduling method for distributed rule engines according to any one of claims 1-5.

Citation Information

Patent Citations

  • Data parallel processing method and system as well as load balancing scheduler

    CN103226467A

  • Task scheduling method and device

    CN111198754A