Rule-based task execution methods, devices, and storage media

By generating rule configuration information and reference relationships, and monitoring and saving the execution status of rule tasks, the problem of time-consuming execution of business rules is solved, and system performance is improved.

CN113485774BActive Publication Date: 2026-03-13CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-27
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

The execution of existing business rules consumes a significant amount of time during system operation, leading to a decline in system performance.

Method used

By generating rule configuration information and reference relationships, instances of rule tasks are generated, and subtasks of each stage are executed sequentially in the rule engine. The execution results are monitored and saved, and the execution results of subtasks of other stages are automatically replaced.

Benefits of technology

In a single process, the same subtask only needs to be executed once, saving process execution time and improving system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113485774B_ABST
    Figure CN113485774B_ABST
Patent Text Reader

Abstract

This disclosure relates to a method, apparatus, and storage medium for executing rule tasks. The method includes: generating rule configuration information for a rule task comprising two or more stages based on user input; generating rule reference relationships based on the rule configuration information; each stage of the rule task includes one or more subtasks; the rule reference relationships indicate which stages or stages of the rule task use subtasks; generating an instance of the rule task by a rule engine based on the rule configuration information; executing the subtasks of each stage of the rule task in the order of the rule configuration; monitoring the execution status of the rule instance; recording the change in the execution status of a subtask when it produces a result, and saving the result of that subtask; and replacing the referenced subtasks in other stages with the saved results of the subtasks when it is determined from the rule reference relationships that other stages reference subtasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure generally relates to the IT field, and more specifically to methods, apparatus and storage media for executing rule tasks. Background Technology

[0002] A rule engine is a component embedded in an application that aims to separate business decisions from application code, allowing business decisions to be written using predefined semantic modules. Using a rule engine facilitates rule management and the execution of rule tasks.

[0003] The existing implementation of business rules has the following problems. During system operation, there are many business rule tasks. For example, requiring verification of an individual's ID card before processing a transaction is a business rule task. A system may contain a large number of business rules, and a single business rule may be referenced by multiple stages. Each time a rule is referenced, it must be executed, and rule execution takes time. In actual system operation, rule execution consumes a significant amount of time. Summary of the Invention

[0004] A brief overview of this disclosure is given below to provide a basic understanding of some aspects of it. However, it should be understood that this overview is not an exhaustive summary of this disclosure. It is not intended to identify key or essential parts of this disclosure, nor is it intended to limit the scope of this disclosure. Its purpose is merely to present certain concepts of this disclosure in a simplified form as a prelude to the more detailed description that follows.

[0005] According to one aspect of this disclosure, a method for executing a rule task is provided, comprising: generating rule configuration information for a rule task comprising two or more stages based on user input, and generating rule reference relationships based on the rule configuration information, wherein each stage of the rule task includes one or more subtasks, and the rule reference relationships indicate in which stage(s) of the rule task the subtask is used; generating an instance of the rule task by a rule engine based on the rule configuration information, and executing the subtasks of each stage of the rule task in the order of the rule configuration; monitoring the execution status of the rule instance, and when a subtask in a stage produces a result, recording the change in the execution status of the subtask and saving the result of the subtask; and when it is determined that other stages reference the subtask based on the rule reference relationships, replacing the subtask referenced in the other stages with the saved result of the subtask.

[0006] According to another aspect of this disclosure, an apparatus for executing rule tasks is provided, comprising: a rule configuration unit, which generates rule configuration information for a rule task comprising two or more stages based on user input, wherein each stage of the rule task includes one or more subtasks; a rule reference relationship unit, which generates a rule reference relationship based on the rule configuration information, wherein the rule reference relationship indicates which stage(s) of the rule task uses the subtask; a rule execution unit, which generates an instance of the rule task by a rule engine based on the rule configuration information, and executes the subtasks of each stage of the rule task in the order of the rule configuration; a rule operation monitoring unit, which monitors various states during the execution of rules and subtasks; and a rule result storage and processing unit, which obtains the running state of subtasks in the rule operation monitoring, obtains the execution result of rule subtasks, records the change in the running state of a subtask when a subtask in a stage produces a running result, and saves the running result of the subtask, and replaces the subtask referenced in the other stage with the saved running result of the subtask when it is determined from the rule reference relationship that other stages reference the subtask.

[0007] According to another aspect of this disclosure, an apparatus for executing a rule task is provided, comprising: a memory having instructions stored thereon; and a processor configured to execute the instructions stored in the memory to perform the method described above.

[0008] According to another aspect of this disclosure, a computer-readable storage medium is provided, including computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the method described above.

[0009] According to the present invention, process execution time can be saved and system performance can be improved. Attached Figure Description

[0010] The accompanying drawings, which form part of this specification, illustrate embodiments of this disclosure and, together with the specification, serve to explain the principles of this disclosure.

[0011] This disclosure will be more clearly understood with reference to the accompanying drawings and the following detailed description, wherein:

[0012] Figure 1 This is a schematic flowchart illustrating a rule task execution method according to an embodiment of the present disclosure.

[0013] Figure 2 The flowchart of a rule task execution device 1 according to an embodiment of the present disclosure is shown schematically.

[0014] Figure 3An exemplary configuration of a computing device 1200 capable of implementing embodiments of the present disclosure is shown. Detailed Implementation

[0015] The following detailed description is based on the accompanying drawings and provides various exemplary embodiments of the present disclosure to aid in a comprehensive understanding. Various details are included in the following description to aid understanding; however, these details are considered exemplary only and not intended to limit the present disclosure, which is defined by the appended claims and their equivalents. The words and phrases used in the following description are intended only to provide a clear and consistent understanding of the present disclosure. Additionally, descriptions of well-known structures, functions, and configurations may have been omitted for clarity and brevity. Those skilled in the art will recognize that various changes and modifications can be made to the examples described herein without departing from the spirit and scope of the present disclosure.

[0016] Figure 1 This is a schematic flowchart illustrating a rule task execution method according to an embodiment of the present disclosure.

[0017] like Figure 1 As shown, in step S101, rule configuration information for a rule task comprising two or more stages is generated based on user input, and rule reference relationships are generated based on the rule configuration information. Each stage of the rule task includes one or more subtasks, and the rule reference relationship indicates which stage(s) of the rule task use the subtasks. In some embodiments, the rule configuration information may include: the task stages of the rule task, the relationships between task stages, the subtasks in the task stages, and one or a combination of rule expressions. In some embodiments, for example, the rule task includes three stages, where stage 1 includes three subtasks A, B, and C; stage 2 includes two subtasks A and E; and stage 3 includes three subtasks A, F, and E. Here, the rule reference relationship indicates that subtask A is used in stages 1, 2, and 3, and subtask E is used in stages 2 and 3.

[0018] In step S103, the rule engine generates instances of rule tasks based on the rule configuration information and executes the subtasks of each stage of the rule task in the order of the rule configuration. In some embodiments, when generating instances of rule tasks based on the rule configuration information, instances are generated according to the initial configuration. Thus, when the process ends, the rule engine instance ends, and the next time the rule task is run, the configured task stage is used, and the generated instance is consistent with the initially configured stage. That is to say, in the whole process, only the instance information of the rule tasks in the process is modified, rather than modifying the configuration of all instances.

[0019] In step S105, the execution status of the rule instance is monitored. When a subtask in a stage produces a result, the status change is recorded, and the result of the subtask is saved. In some embodiments, for example, a rule task includes three stages: stage 1 includes three subtasks A, B, and C; stage 2 includes two subtasks A and E; and stage 3 includes three subtasks A, F, and E. Subtask A is "blacklist verification". When subtask A in stage 1 produces a result, such as 'blacklist verification' = 'pass', the result is saved in the cache.

[0020] In step S107, when it is determined that other stages reference the subtask based on the rule reference relationship, the subtask referenced in other stages is replaced with the saved execution result of the subtask. In some embodiments, for example, the rule task includes three stages, wherein stage 1 includes three subtasks A, B, and C, stage 2 includes two subtasks A and E, and stage 3 includes three subtasks A, F, and E, wherein subtask A is "blacklist verification". The execution result of subtask A in stage 1 is generated, for example, 'blacklist verification' = 'pass'. The execution result is saved in the cache, and then when it is determined that other stages (i.e., stage 2 and stage 3) reference subtask A based on the rule reference relationship, the saved execution result of subtask A (i.e., 'blacklist verification' = 'pass') is used to replace the subtask A referenced in stage 2 and stage 3.

[0021] In step S109, it is determined whether all steps have been executed. If it is determined that all steps have been executed, the process ends. If it is determined that not all steps have been executed, the process returns to step S101.

[0022] According to the rule-based task execution method disclosed herein, in a single process, the same subtask in different stages only needs to be executed once. The execution result is automatically saved and pushed to the subtasks in other stages, and the execution result replaces the same subtasks in other stages. This can save process execution time and improve system performance.

[0023] Figure 2 The flowchart of a rule task execution device 1 according to an embodiment of the present disclosure is shown schematically.

[0024] like Figure 2 As shown, the rule task execution device 1 includes: a rule configuration unit 11, a rule reference relationship unit 12, a rule execution unit 13, a rule operation monitoring unit 14, and a rule result storage and processing unit 15.

[0025] The rule configuration unit 11 generates rule configuration information for a rule task comprising two or more stages based on user input. Each stage of the rule task includes one or more subtasks. In some embodiments, the rule configuration information may include: the task stages of the rule task, the relationships between the task stages, the subtasks in the task stages, and one or a combination of rule expressions. In some embodiments, for example, the rule task includes three stages, wherein stage 1 includes three subtasks A, B, and C, stage 2 includes two subtasks A and E, and stage 3 includes three subtasks A, F, and E.

[0026] Rule reference relationship unit 12 generates rule reference relationships based on rule configuration information. These rule reference relationships indicate which stage(s) of the rule task use the subtask. In some embodiments, for example, the rule task includes three stages: stage 1 includes three subtasks A, B, and C; stage 2 includes two subtasks A and E; and stage 3 includes three subtasks A, F, and E. Here, the rule reference relationship indicates that subtask A is used in stages 1, 2, and 3, and subtask E is used in stages 2 and 3.

[0027] The rule execution unit 13 generates instances of rule tasks from the rule engine based on the rule configuration information, and executes the subtasks of each stage of the rule task in the order of the rule configuration. In some embodiments, when generating instances of rule tasks based on the rule configuration information, instances are generated according to the initial configuration. Thus, when the process ends, the rule engine instance ends, and the next time the rule task is run, the configured task stage is used, and the generated instance is consistent with the initially configured stage. That is to say, in the whole process, only the instance information of the rule tasks in the process is modified, rather than modifying the configuration of all instances.

[0028] The rule operation monitoring unit 14 monitors the various states of rules and subtasks during execution.

[0029] The rule result storage and processing unit 15 obtains the running status of subtasks in the rule operation monitoring, obtains the execution results of rule subtasks, records the change in the running status of a subtask when a subtask in a certain stage produces a result, and saves the result of the subtask. When other stages reference the subtask, the saved result of the subtask is used to replace the subtask referenced in the other stages. In some embodiments, for example, a rule task includes three stages, wherein stage 1 includes three subtasks A, B, and C, stage 2 includes two subtasks A and E, and stage 3 includes three subtasks A, F, and E. Subtask A is "blacklist verification". When subtask A in stage 1 produces a result, such as 'blacklist verification' = 'pass', the result is saved in the cache. Later, when other stages (i.e., stage 2 and stage 3) reference subtask A according to the rule reference relationship, the saved result of subtask A (i.e., 'blacklist verification' = 'pass') is used to replace the subtask A referenced in stage 2 and stage 3.

[0030] According to the rule-based task execution device disclosed herein, in a single process, the same subtask in different stages only needs to be executed once. The execution result is automatically saved and pushed to the subtasks in other stages, and the execution result replaces the same subtasks in other stages. Thus, the process execution time can be saved and the system performance can be improved.

[0031] Figure 3 An exemplary configuration of a computing device 1200 capable of implementing embodiments of the present disclosure is shown.

[0032] Computing device 1200 is an example of a hardware device capable of applying the above aspects of this disclosure. Computing device 1200 can be any machine configured to perform processing and / or computation. Computing device 1200 can be, but is not limited to, a workstation, server, desktop computer, laptop computer, tablet computer, personal data assistant (PDA), smartphone, in-vehicle computer, or a combination thereof.

[0033] like Figure 3As shown, computing device 1200 may include one or more components that can be connected to or communicate with bus 1202 via one or more interfaces. Bus 2102 may include, but is not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus. Computing device 1200 may include, for example, one or more processors 1204, one or more input devices 1206, and one or more output devices 1208. The one or more processors 1204 may be any type of processor and may include, but is not limited to, one or more general-purpose processors or special-purpose processors (such as special-purpose processing chips). Processor 1202 may, for example, correspond to... Figure 2 The rule-based task execution device in the system. Input device 1206 can be any type of input device capable of inputting information to the computing device, and may include, but is not limited to, a mouse, keyboard, touch screen, microphone, and / or remote controller. Output device 1208 can be any type of device capable of presenting information, and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer.

[0034] The computing device 1200 may also include or be connected to a non-transitory storage device 1214, which may be any non-transitory storage device capable of storing data, and may include, but is not limited to, disk drives, optical storage devices, solid-state storage, floppy disks, flexible disks, hard disks, magnetic tapes or any other magnetic media, compressed disks or any other optical media, cache memory and / or any other storage chip or module, and / or any other medium from which a computer may read data, instructions and / or code. The computing device 1200 may also include random access memory (RAM) 1210 and read-only memory (ROM) 1212. ROM 1212 may store executable programs, utilities, or processes in a non-volatile manner. RAM 1210 provides volatile data storage and stores instructions related to the operation of the computing device 1200. The computing device 1200 may also include a network / bus interface 1216 coupled to a data link 1218. Network / bus interface 1216 can be any kind of device or system capable of enabling communication with external devices and / or networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication devices and / or chipsets (such as Bluetooth). TM Equipment, 802.11 equipment, WiFi equipment, WiMax equipment, cellular communication facilities, etc.

[0035] This disclosure can be implemented as any combination of apparatus, system, integrated circuit, and computer program on a non-transitory computer-readable medium. One or more processors can be implemented as integrated circuits (ICs), application-specific integrated circuits (ASICs), or large-scale integrated circuits (LSIs), system LSIs, super LSIs, or ultra LSI components that perform some or all of the functions described in this disclosure.

[0036] This disclosure includes the use of software, application programs, computer programs, or algorithms. Software, application programs, computer programs, or algorithms may be stored on a non-transitory computer-readable medium to cause a computer, such as one or more processors, to perform the steps described above and in the accompanying drawings. For example, one or more memories may store the software or algorithm in executable instructions, and one or more processors may be associated with executing a set of instructions of the software or algorithm to provide various functionalities according to embodiments described in this disclosure.

[0037] Software and computer programs (also referred to as programs, software applications, applications, components, or code) include machine instructions for programmable processors and can be implemented in high-level procedural languages, object-oriented programming languages, functional programming languages, logic programming languages, assembly languages, or machine languages. The term "computer-readable medium" means any computer program product, apparatus, or device used to provide machine instructions or data to a programmable data processor, such as magnetic disks, optical disks, solid-state storage devices, memories, and programmable logic devices (PLDs), including computer-readable media that receive machine instructions as computer-readable signals.

[0038] For example, computer-readable media may include dynamic random access memory (DRAM), random access memory (RAM), read-only memory (ROM), electrically erasable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage devices, magnetic disk storage devices or other magnetic storage devices, or any other medium that can be used to carry or store required computer-readable program code in the form of instructions or data structures, and that can be accessed by a general-purpose or special-purpose computer or a general-purpose or special-purpose processor. As used herein, a disk or disc includes compact discs (CD), laser discs, optical discs, digital versatile discs (DVD), floppy disks, and Blu-ray discs, wherein a disk typically copies data magnetically, while a disc copies data optically using a laser. Combinations of the above are also included within the scope of computer-readable media.

[0039] The subject matter of this disclosure is provided as examples of apparatus, systems, methods, and programs for performing the features described herein. However, other features or variations are contemplated in addition to those described above. It is anticipated that the components and functions of this disclosure can be implemented using any emerging techniques that may replace any of the above-described implementations.

[0040] Furthermore, the above description provides examples and does not limit the scope, applicability, or configuration set forth in the claims. Changes may be made to the function and arrangement of the elements discussed without departing from the spirit and scope of this disclosure. Various processes or components may be appropriately omitted, substituted, or added in various embodiments. For example, features described with respect to certain embodiments may be combined in other embodiments.

[0041] Furthermore, in the description of this disclosure, the terms “first,” “second,” “third,” etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or order.

[0042] Similarly, although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring the operations to be performed in the specific order shown or in sequential order, or requiring the execution of all illustrated operations to achieve the desired result. In some cases, multitasking and parallel processing can be advantageous.

Claims

1. A rule task execution method, comprising: generating, according to user input, rule configuration information of a rule task including two or more stages, and generating rule reference relationships according to the rule configuration information, the rule reference relationships indicating which stage or stages of the rule task use one or more subtasks included in each stage of the rule task; generating, by a rule engine, an instance of the rule task according to the rule configuration information, and executing the subtasks of each stage of the rule task in the order of rule configuration; monitoring the execution status of the rule instance, recording the change of the execution status of a subtask when the subtask runs to a running result, and saving the running result of the subtask; replacing the subtask referenced in other stages with the saved running result of the subtask when it is determined according to the rule reference relationships that the other stages reference the subtask. 2.The rule task execution method of claim 1, wherein the rule configuration information includes one or a combination of the following: task stages of the rule task, relationships between the task stages, subtasks in the task stages, and expressions of rules. 3.The rule task execution method of claim 1, wherein when generating the instance of the rule task according to the rule configuration information, the instance is generated according to the same initial configuration. 4.A rule task execution apparatus, comprising: a rule configuration unit configured to generate, according to user input, rule configuration information of a rule task including two or more stages, and to generate rule reference relationships according to the rule configuration information, the rule reference relationships indicating which stage or stages of the rule task use one or more subtasks included in each stage of the rule task; a rule execution unit configured to generate, by a rule engine, an instance of the rule task according to the rule configuration information, and to execute the subtasks of each stage of the rule task in the order of rule configuration; a rule operation monitoring unit configured to monitor various states when rules and subtasks are executed; and a rule result saving and processing unit configured to acquire the execution status of a subtask in rule operation monitoring, to acquire the execution result of a rule subtask, to record the change of the execution status of the subtask when the subtask runs to a running result, to save the running result of the subtask, and to replace the subtask referenced in other stages with the saved running result of the subtask when it is determined according to the rule reference relationships that the other stages reference the subtask. 5.The rule task execution apparatus of claim 4, wherein the rule configuration information includes one or a combination of the following: task stages of the rule task, relationships between the task stages, subtasks in the task stages, and expressions of rules. 6.The rule task execution apparatus of claim 4, wherein when generating the instance of the rule task according to the rule configuration information, the instance is generated according to the same initial configuration. 7.A rule task execution apparatus, comprising: a memory having instructions stored thereon; and a processor configured to execute the instructions. ​ ​ a processor configured to execute instructions stored on the memory to perform the method of any of claims 1-3.

8. A computer-readable storage medium comprising computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the method of any of claims 1-3.

Citation Information

Patent Citations

  • Multi-workflow task allocation method and device, computer equipment and storage medium

    CN110231984A

  • Multi-node service task execution method and device and electronic equipment

    CN113138807A