Method and device for implementing dynamic rule engine, electronic equipment and storage medium

By implementing a dynamic rule engine, business rules are separated from application code, matching target business rules and constructing entity class objects. This solves the problem of high coupling between business rules and applications, and enables low-cost, high-efficiency business logic processing and management.

CN115469833BActive Publication Date: 2026-01-13CHINA TELECOM CLOUD TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210909388.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2026-01-13
Estimated Expiration
2042-07-29

AI Technical Summary

Technical Problem

In existing technologies, business rules are highly coupled with applications, making them difficult to maintain and extend, affecting the management of the main business process, and the business rule code is scattered and poorly managed.

Method used

By adopting a dynamic rule engine approach, business rules are separated from application code. By obtaining message information to match target business rules, entity class objects are constructed and corresponding business logic is called, thus achieving decoupling from the main business process.

Benefits of technology

It reduced learning and development costs, improved agile development capabilities, shortened software development cycles, and solved problems related to difficulty in maintenance and expansion, as well as impact on the management of main business processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115469833B_ABST
    Figure CN115469833B_ABST
Patent Text Reader

Abstract

The application provides an implementation method and device of a dynamic rule engine, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring message information in the case that page indication information is received, wherein the message information carries service event information and service state information of current service data, and the indication information is used for indicating that the page has been executed with a trigger operation; a plurality of target service rules are matched according to the service event information and the service state information; an entity class object of the target service rule is constructed by using a target mechanism; and the corresponding target service rule is called to process the service logic according to the entity class object. Through the application, the problems that it is difficult to maintain and expand and the business mainstream process management is affected in the related art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, and in particular to a dynamic rule engine implementation method and device, electronic equipment and a storage medium. BACKGROUND

[0002] Currently, as the business of the industry becomes more and more complex, the market requires frequent changes in business rules, and IT systems must be quickly and cost-effectively updated according to changes in business rules. At the same time, it is required to provide 7x24 hours of uninterrupted service, and the update of business rules should not affect the provision of services.

[0003] The prior art solution is to add business rule code logic to the business main process according to changes in business rules, and to update and release it together with the system release version. This implementation solution has the disadvantages of high coupling between business rules and applications, high coupling between business rule codes, difficulty in maintaining and expanding, chaotic business code management, and impact on the business main process.

[0004] Therefore, the related art has the problems of difficulty in maintaining and expanding and impact on the management of the business main process. SUMMARY

[0005] The present application provides a dynamic rule engine implementation method and device, electronic equipment and a storage medium to at least solve the problem of difficulty in maintaining and expanding and impact on the management of the business main process in the related art.

[0006] According to an aspect of an embodiment of the present application, a dynamic rule engine implementation method is provided, which includes:

[0007] In the case where the page indication information is received, the message information is obtained, wherein the message information carries business event information and business state information of current business data, and the indication information is used to indicate that the page has been executed with a trigger operation;

[0008] According to the business event information and the business state information, a plurality of target business rules are matched;

[0009] An entity class object of the target business rule is constructed by using a target mechanism;

[0010] According to the entity class object, a corresponding target business rule is called to process business logic.

[0011] According to another aspect of an embodiment of the present application, a dynamic rule engine implementation device is also provided, which includes:

[0012] The acquisition module is used to acquire message information upon receiving page instruction information. The message information carries business event information and business status information of the current business data, and the instruction information is used to indicate that the page has been triggered.

[0013] The matching module is used to match multiple target business rules based on the business event information and the business status information;

[0014] The construction module is used to construct the entity class object of the target business rule using the target mechanism;

[0015] The processing module is used to call the corresponding target business rule to process business logic based on the entity class object.

[0016] Optionally, the processing module includes:

[0017] The sorting unit is used to sort the entity class objects according to a preset priority to obtain the sorting result;

[0018] The processing unit is used to call the corresponding target business rule according to the arrangement result and process the business logic.

[0019] Optionally, the device further includes:

[0020] An embedding module is used to embed tracking information at the application trigger point of the page before receiving page instruction information;

[0021] The determination module is used to determine whether the page has been triggered using the embedded information.

[0022] Optionally, the acquisition module includes:

[0023] The determining unit is configured to determine policy configuration information based on the page indication information, wherein the policy configuration information includes the business event information and the business status information;

[0024] The modification unit is used to modify the message information generated by the policy configuration information according to the policy configuration information, so that the modified message information matches the policy configuration information;

[0025] The acquisition unit is used to acquire the modified message information.

[0026] Optionally, the device further includes:

[0027] The modification module is used to modify the policy configuration information, enabling the target business rules to be updated online or offline, thus realizing a dynamic rule engine.

[0028] Optionally, the rule type to which the target business rule belongs comprises a static definition rule type, a dynamic compilation rule type, a remote call rule type, and a database storage rule type, and the matching module comprises:

[0029] The selecting unit is configured to select any one of the static definition rule type, the dynamic compilation rule type, the remote call rule type, and the database storage rule type as a rule library for selecting the target business rule.

[0030] The matching unit is configured to match a plurality of the target business rules from the rule library.

[0031] According to another aspect of the embodiments of the present application, an electronic device is provided, which comprises a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus; the memory is configured to store a computer program; and the processor is configured to execute the method steps in any of the above embodiments by running the computer program stored in the memory.

[0032] According to another aspect of the embodiments of the present application, a computer readable storage medium is provided, which stores a computer program, wherein the computer program is configured to execute the method steps in any of the above embodiments when running.

[0033] In the embodiments of the present application, the embedded calling mode is completely decoupled from the application core code, the message information is acquired when the page indication information is received, the message information carries the business event information and the business state information of the current business data, and the indication information is used to indicate that the page is executed with a trigger operation; the target business rules are matched according to the business event information and the business state information; the entity class object of the target business rule is constructed by using the target mechanism; and the corresponding target business rule is called to process the business logic according to the entity class object. Since the business rules are separated from the application program code in the embodiments of the present application, the message information is acquired after the page indication information is received, the target business rule corresponding to the current business data is selected, the entity class object of the target business rule is constructed by using the target mechanism, the rule responsibility chain is spliced and generated, the rule chain is then scheduled and executed, and the business is processed, so that the core module of the business main flow can be decoupled, which is conducive to the extension and maintenance in the later period, greatly reduces the learning cost and the development cost, greatly improves the agile development capability, shortens the entire software development cycle and the demand response time, thereby reducing the software development cost, generating great economic value, and further solving the problems of difficult maintenance and extension and influence on the business main flow management in the related art. BRIEF DESCRIPTION OF DRAWINGS

[0034] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the accompanying drawings required to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, for those of ordinary skill in the art, the other drawings can also be obtained based on these drawings without any creative effort.

[0036] Figure 1 is a flow schematic diagram of an optional implementation method of a dynamic rule engine according to an embodiment of the present application;

[0037] Figure 2 is a schematic diagram of a mechanism for realizing hot deployment and pluggability between rule bases according to an embodiment of the present application;

[0038] Figure 3 is a schematic diagram of an overall flow of rule scheduling according to an embodiment of the present application;

[0039] Figure 4 is a structural block diagram of an optional implementation device of a dynamic rule engine according to an embodiment of the present application;

[0040] Figure 5 is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to make the personnel in the art better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described in the embodiments of the present application in combination with the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those of ordinary skill in the art without any creative effort should belong to the scope of protection of the present application.

[0042] It should be noted that the terms "first", "second", and the like in the description and in the claims of the present application and in the above-described drawings are used to distinguish similar objects and are not necessarily used to describe a particular sequential or chronological order. It should be understood that the data thus used can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in other than the order illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that includes a list of steps or units is not necessarily limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to such processes, methods, products, or apparatuses.

[0043] The current business rules need to be updated and iterated in real time with market demand. The prior art solution is to add business rule code logic to the business main process according to the change of the business rule, and update and release it together with the system release version. However, this method has the following defects: the business rule is highly coupled with the application, and is difficult to maintain and expand; the business rule is highly coupled with the business rule code, and is difficult to maintain and expand; the business rule update needs to release the application, affecting the business main process; the business rule code is scattered, and the management is chaotic. In order to solve the above problems, the embodiment of the present application proposes an implementation method of a dynamic rule engine, as shown in Figure 1 The method can be applied to a background server, and the method comprises:

[0044] Step S101, in the case of receiving page indication information, obtaining message information, wherein the message information carries business event information and business state information of current business data, and the indication information is used to indicate that the page has been executed trigger operation;

[0045] Step S102, matching a plurality of target business rules according to the business event information and the business state information;

[0046] Step S103, constructing an entity class object of the target business rule by using a target mechanism;

[0047] Step S104, calling a corresponding target business rule to process business logic according to the entity class object.

[0048] Optionally, the application page of the front-end page of the embodiments of the present application can be embedded with some buried point information at the trigger point, such as some control buttons, of course, the buried point information can also be embedded at any position of the page, only a few lines of scheduling code need to be embedded, and then based on the buried point information, it can be monitored in real time whether the currently displayed page is clicked by the staff or other users, and the trigger operation is executed, if it is determined that the page is executed with the trigger operation, a message information is generated based on the current operation, wherein the message information carries the business event information and the business state information of the currently operated business data, such as the currently clicked business event is xxx package business, and the business state can be before handling, during handling or after handling. It can be known that even if it is the same business event, if the corresponding business state information is different, the generated message information will also be different.

[0049] Then the front end sends the generated message information to the back-end server side, and the back-end server matches a plurality of target business rules from the rule library based on the currently obtained business event information and business state information. For example, if the business event is xxx package business, and the business state is during handling, the matched target business rules can include: free call duration, free SMS number, free ringtone, etc. In addition, these target business rules can be business rules written based on java programming language.

[0050] It should be noted that the plurality of target business rules matched according to the business event information and the business state information must meet the current business event information and the business state information, otherwise an error will be prompted, and the business will fail.

[0051] After obtaining the plurality of target business rules, a target mechanism, such as a java reflection mechanism, is used to construct the target business rule entity class object from the rule library, and then based on the entity class object, the corresponding target business rule is called to execute the business logic processing.

[0052] In the embodiment of the present application, the embedded calling mode is adopted to completely decouple the application core code, the message information is acquired when the page indication information is received, the service event information and the service state information of the current service data are carried in the message information, the indication information is used to indicate that the page is executed with a trigger operation, the target service rules are matched according to the service event information and the service state information, the entity class object of the target service rule is constructed by using the target mechanism, and the corresponding target service rule is called to process the service logic according to the entity class object. In the embodiment of the present application, the service rule is separated from the application program code, the message information is acquired after the page indication information is received, the target service rule corresponding to the current service data is selected, the entity class object of the target service rule is constructed by using the target mechanism, the rule responsibility chain is spliced and generated, and then the rule chain is scheduled and executed to process the service. In this way, the core module of the business main flow can be decoupled, which is beneficial to the extension and maintenance in the later period, greatly reduces the learning cost and development cost, greatly improves the agile development capability, shortens the entire software development cycle and the demand response time, thereby reducing the software development cost, generating great economic value, and further solving the problems of difficult maintenance and extension and affecting the business main flow management in the related art.

[0053] As an optional embodiment, the corresponding target service rule is called to process the service logic according to the entity class object, including:

[0054] The entity class objects are arranged according to the preset priority, and an arrangement result is obtained;

[0055] The corresponding target service rule is called according to the arrangement result to process the service logic.

[0056] Optionally, since there can be multiple target service rules obtained by matching, the corresponding entity class objects will also be multiple, so the embodiment of the present application can arrange and splice the multiple entity class objects according to the priority preset according to the current scene to generate a responsibility chain, and the corresponding target service rule is called according to the arrangement result of the multiple entity class objects in the responsibility chain to process the service logic.

[0057] For example, the current business scene is card replacement, and the identity authentication should be performed first when the target service rule is called. Therefore, the entity class object corresponding to the identity authentication target service rule is arranged at the front, and the identity authentication entity class object is executed first when the business processing logic is scheduled and executed.

[0058] In the embodiment of the present application, the responsibility chain mode makes each target service rule do a single thing, and the codes between rules are completely decoupled, so as not to affect each other.

[0059] As an optional embodiment, the obtaining the message information comprises:

[0060] According to the page indication information, the policy configuration information is determined, wherein the policy configuration information comprises the business event information and the business state information;

[0061] According to the policy configuration information, the message information generated by the policy configuration information is modified, so that the modified message information matches the policy configuration information;

[0062] The modified message information is obtained.

[0063] Optionally, according to the business event information and the business state information of the event occurrence, multi-dimensional policies such as business action, business source, business object type, and business object type ID can be supported to generate the policy configuration information.

[0064] After it is determined that the page is triggered, if the generated policy configuration information does not match the currently generated message information, the core object structure of the application can be changed according to the reference passing value mode of Java, the message information generated by the policy configuration information is modified, so that the modified message information matches the policy configuration information, and then the front end sends the modified message information to the background server.

[0065] The reference passing value mode is adopted to modify the core object structure of the application, so that the purpose of flexibility is achieved.

[0066] As an optional embodiment, the method further comprises:

[0067] The policy configuration information is modified, so that the target business rule is completed online or offline update, and a dynamic rule engine is realized.

[0068] Optionally, after the current policy configuration information is obtained, the policy configuration can be dynamically updated, so that the target business rule is completed online or offline update, and a dynamic rule engine is realized.

[0069] As an optional embodiment, the rule type to which the target business rule belongs comprises: a static definition rule type, a dynamic compilation rule type, a remote call rule type, and a database storage rule type, and the matching to the plurality of target business rules according to the business event information and the business state information comprises:

[0070] Any one of the static definition rule type, the dynamic compilation rule type, the remote call rule type, and the database storage rule type is selected as a rule library for selecting the target business rule;

[0071] The plurality of target business rules are matched from the rule library.

[0072] Optionally, the target business rules are all java rules, and the rule types to which the target business rules belong include, but are not limited to, a static definition rule type, a dynamic compilation rule type, a remote call rule type, and a database storage rule type, the four types being rule libraries, and any one of the four types being selected as a rule library for selecting the target business rules, so as to obtain a plurality of target business rules.

[0073] The static definition rule type: a user implements logic processing according to a specific business by inheriting a general standard java interface defined by a rule engine. The static java rule is compiled in advance and is called when an application is started.

[0074] The dynamic compilation rule type: a rule running module loads, compiles and executes a code content of a standard dynamic java abstract class written in a database field in real time. The dynamic java class is compiled only once, so that hot deployment and pluggability are achieved.

[0075] The remote call rule type: an external java file of an external java abstract class is compiled and placed in a specified remote server directory, so that the application service remotely calls the external java file, the application is effectively isolated, and hot deployment and pluggability of the business rule are achieved.

[0076] The database storage rule type: a plurality of rule information is stored in a database, and whether candidate rule information meeting a condition is found as a parameter to be added to a matching process is determined according to the plurality of stored rule information, so that rich parameters are provided for the rule, and hot deployment, pluggability and agile development of the rule without the participation of a developer are achieved.

[0077] The mechanism for achieving hot deployment and pluggability among the four types of rule libraries can be seen from FIG. 1. Figure 2

[0078] As an optional embodiment, as shown in FIG. 2, Figure 3 Figure 3 is a whole flowchart of rule scheduling according to an optional embodiment of the present application, and the specific steps are as follows:

[0079] First, a rule trigger is defined to be embedded in a contact of an application; a rule calling center generates strategy configuration information according to a multi-dimensional strategy, sets the strategy configuration information in a database, supports dynamic online and offline of a business rule by modifying the configuration, dynamically loads a rule library to realize rule instantiation, and splices a dynamic rule chain according to a priority, the dynamic rule chain including a java rule 1, a java rule 2, and the like, and a specific business logic is executed based on the dynamic rule chain.

[0080] ​​Taking an Internet of Things CRM (Customer Relationship Management) project order service as an example, a CRM project order needs to update a service rule when a monthly version is online. Now, an operation personnel needs to modify the rule according to a business condition, and after the rule is approved, the rule can be updated to the system in real time, without waiting for a version to be updated to update the rule.

[0081] 1. Embedding is done in advance at a trigger point;

[0082] 2. A developer uses one of four rule component classes to complete writing of a rule component, rule logic modifies business data (at this time, execution is not triggered), rule code hot deployment and pluggability are implemented;

[0083] 3. After being audited by a business party, an operation and maintenance personnel can configure a rule engine decision table to make rules online or offline, modify data processing logic, and complete rule updating.

[0084] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application.

[0085] From the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and a necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM (Read-Only Memory) / RAM (Random Access Memory), a magnetic disk, an optical disk), and includes a plurality of instructions to make a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) execute the method of each embodiment of the present application.

[0086] According to another aspect of the embodiments of the present application, a dynamic rule engine implementation device for implementing the implementation method of the dynamic rule engine is also provided. Figure 4 is a structural block diagram of an optional dynamic rule engine implementation device according to an embodiment of the present application, as Figure 4 shown, the device can include:

[0087] The acquisition module 401 is used to acquire message information when receiving page indication information. The message information carries business event information and business status information of the current business data, and the indication information is used to indicate that the page has been triggered.

[0088] Matching module 402 is used to match multiple target business rules based on business event information and business status information;

[0089] Module 403 is used to construct entity class objects of target business rules using the target mechanism;

[0090] Processing module 404 is used to call the corresponding target business rule to process business logic based on the entity class object.

[0091] It should be noted that the acquisition module 401 in this embodiment can be used to execute the above step S101, the matching module 402 in this embodiment can be used to execute the above step S102, the construction module 403 in this embodiment can be used to execute the above step S103, and the processing module 404 in this embodiment can be used to execute the above step S104.

[0092] By separating business rules from application code through the above modules, message information is obtained upon receiving page instructions, target business rules corresponding to the current business data are selected, and then entity class objects of the target business rules are constructed using the target mechanism. These objects are then assembled to generate a rule responsibility chain, which is then scheduled and executed to process the business. This decoupling from the core modules of the main business process facilitates future expansion and maintenance, significantly reduces learning and development costs, greatly enhances agile development capabilities, shortens the entire software development cycle and requirement response time, thereby reducing software development costs and generating significant economic value. This also solves the problems of difficulty in maintenance and expansion, and impact on the management of the main business process in related technologies.

[0093] As an optional embodiment, the processing module includes:

[0094] The sorting unit is used to sort entity class objects according to a preset priority to obtain the sorting result;

[0095] The processing unit is used to call the corresponding target business rule according to the sorting result and process the business logic.

[0096] As an optional embodiment, the device further includes:

[0097] The embedding module is used to embed tracking information at the application trigger point of the page before receiving the page instruction information;

[0098] The determining module is configured to determine whether the page is executed with a trigger operation by using the burying point information.

[0099] As an optional embodiment, the obtaining module comprises:

[0100] The determining unit is configured to determine the policy configuration information according to the page indication information, wherein the policy configuration information comprises service event information and service state information.

[0101] The modifying unit is configured to modify the message information generated by the policy configuration information according to the policy configuration information, so that the modified message information matches the policy configuration information.

[0102] The obtaining unit is configured to obtain the modified message information.

[0103] As an optional embodiment, the apparatus further comprises:

[0104] The modifying module is configured to modify the policy configuration information, so that the target service rule completes online update or offline update, and realizes the dynamic rule engine.

[0105] As an optional embodiment, the rule type to which the target service rule belongs comprises a static definition rule type, a dynamic compilation rule type, a remote call rule type, and a database storage rule type, and the matching module comprises:

[0106] The selecting unit is configured to select any one of the static definition rule type, the dynamic compilation rule type, the remote call rule type, and the database storage rule type as a rule library for selecting the target service rule.

[0107] The matching unit is configured to match a plurality of target service rules from the rule library.

[0108] It should be noted that the above modules and the examples and application scenarios realized by the corresponding steps are the same, but are not limited to the content disclosed in the above embodiments.

[0109] According to another aspect of the embodiments of the present application, an electronic device for implementing the implementation method of the above dynamic rule engine is also provided, which can be a server, a terminal, or a combination thereof.

[0110] Figure 5 is a structural block diagram of an optional electronic device according to an embodiment of the present application, as shown in Figure 5 The processor 501, the communication interface 502, and the memory 503 complete communication with each other through the communication bus 504, wherein,

[0111] The memory 503 is configured to store a computer program.

[0112] When processor 501 executes a computer program stored in memory 503, it performs the following steps:

[0113] Upon receiving the page instruction information, obtain the message information, which carries the business event information and business status information of the current business data, and the instruction information is used to indicate that the page has been triggered.

[0114] Multiple target business rules are matched based on business event information and business status information;

[0115] Construct entity class objects for target business rules using the target mechanism;

[0116] The business logic is processed by calling the corresponding target business rule based on the entity class object.

[0117] Optionally, in this embodiment, the communication bus can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0118] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0119] The memory may include RAM, or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0120] As an example, such as Figure 5 As shown, the memory 503 may include, but is not limited to, the acquisition module 401, matching module 402, construction module 403, and processing module 404 in the implementation device of the dynamic rule engine. Furthermore, it may include, but is not limited to, other module units in the implementation device of the dynamic rule engine, which will not be elaborated upon in this example.

[0121] The processors mentioned above can be general-purpose processors, including but not limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; they can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0122] In addition, the aforementioned electronic device also includes a display for showing the implementation results of the dynamic rule engine.

[0123] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.

[0124] Those skilled in the art will understand that Figure 5 The structure shown is for illustrative purposes only. The device implementing the above dynamic rule engine method can be a terminal device, such as a smartphone (e.g., Android phone, iOS phone), tablet computer, PDA, mobile Internet Devices (MID), PAD, etc. Figure 5 This does not limit the structure of the aforementioned electronic devices. For example, the terminal device may also include components that are more advanced than those described above. Figure 5 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same ​ The different configurations shown.

[0125] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, ROM, RAM, disk or optical disk, etc.

[0126] According to another aspect of the embodiments of this application, a storage medium is also provided. Optionally, in this embodiment, the storage medium can be used to execute program code for implementing a dynamic rule engine method.

[0127] Optionally, in this embodiment, the storage medium may be located on at least one of the network devices in the network shown in the above embodiment.

[0128] Optionally, in the embodiment, the storage medium is configured to store program code for executing the following steps:

[0129] In the case of receiving the page indication information, obtaining the message information, wherein the message information carries the service event information and the service state information of the current service data, and the indication information is used to indicate that the page has been executed with the trigger operation;

[0130] According to the service event information and the service state information, the target service rules are matched;

[0131] An entity class object of the target service rule is constructed by using the target mechanism;

[0132] According to the entity class object, the corresponding target service rule is called to process the service logic.

[0133] Optionally, the specific examples in the embodiment can refer to the examples described in the above embodiments, and the embodiment will not be described here.

[0134] Optionally, in the embodiment, the storage medium described above can include but is not limited to: a U disk, a ROM, a RAM, a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.

[0135] According to another aspect of the embodiment of the application, a computer program product or a computer program is also provided, which includes computer instructions stored in a computer readable storage medium; a processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the implementation method steps of the dynamic rule engine in any one of the above embodiments.

[0136] The above embodiment numbers are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0137] The integrated units in the above embodiments, if realized in the form of software function units and sold or used as independent products, can be stored in the above computer readable storage medium. Based on such understanding, the technical solutions of the application essentially or the parts that make contributions to the prior art or the whole or part of the technical solutions can be embodied in the form of software products, and the computer software product is stored in the storage medium, including a plurality of instructions for causing one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the implementation method of the dynamic rule engine of the embodiments of the application.

[0138] In the above embodiments of the application, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0139] In several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other manners. Of course, the unit embodiment described above is only illustrative. For example, the division of the units is only a logical function division. There can be another division manner for the actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the units can be indirect couplings or communication connections through some interfaces, units or modules, and can be in electrical, mechanical or other forms.

[0140] The units described as separated components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. In actual implementation, some or all of the units can be selected according to the actual needs to achieve the purposes of the solutions provided in the embodiments.

[0141] In addition, each functional unit in the embodiments of the present application can be integrated in a processing unit, or each unit can exist physically as a separate unit, or two or more units can be integrated in one unit. The integrated unit can be implemented in the form of hardware, or in the form of a software functional unit.

[0142] The above descriptions are only preferred embodiments of the present application, and it should be pointed out that, for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be regarded as the protection scope of the present application.

Claims

1. A method of implementing a dynamic rules engine, characterized by, The method includes: Upon receiving page instruction information, message information is obtained, wherein the message information carries business event information and business status information of the current business data, and the instruction information is used to indicate that the page has been triggered. Obtaining the message information includes: Based on the page instruction information, determine the policy configuration information, wherein the policy configuration information includes the business event information and the business status information; Based on the policy configuration information, the core object structure of the application is changed using Java's pass-by-reference method, and the message information generated by the policy configuration information is modified so that the modified message information matches the policy configuration information, thus obtaining the modified message information. Multiple target business rules are matched based on the business event information and the business status information; Construct the entity class object of the target business rule using the target mechanism; The business logic is processed by calling the corresponding target business rule based on the entity class object.

2. The method of claim 1, wherein, The step of invoking the corresponding target business rule to process the business logic based on the entity class object includes: The entity class objects are arranged according to a preset priority to obtain the arrangement result; The corresponding target business rule is invoked according to the arrangement result to process the business logic.

3. The method of claim 1, wherein, Before receiving the page instruction information, the method further includes: Embed tracking information at the application trigger points on the page; The tracking information is used to determine whether the page has been triggered.

4. The method of claim 1, wherein, The method further includes: Modify the strategy configuration information to enable the target business rules to be updated online or offline, thus realizing a dynamic rule engine.

5. The method of claim 1, wherein, The rule types to which the target business rules belong include: statically defined rule types, dynamically compiled rule types, remote call rule types, and database storage rule types. Matching multiple target business rules based on the business event information and the business status information includes: Choose any one of the following rule types from the statically defined rule type, the dynamically compiled rule type, the remote call rule type, and the database storage rule type as the rule base for selecting the target business rule; Multiple target business rules are matched from the rule base.

6. An apparatus for implementing a dynamic rules engine, the apparatus comprising: The device includes: The acquisition module is used to acquire message information upon receiving page instruction information. The message information carries business event information and business status information of the current business data. The instruction information is used to indicate that the page has been triggered. The acquisition module includes: a determination unit, used to determine policy configuration information based on the page instruction information. The policy configuration information includes business event information and business status information. The modification unit is used to change the core object structure of the application and modify the message information generated by the policy configuration information according to the policy configuration information using Java's pass-by-reference method, so that the modified message information matches the policy configuration information. The acquisition unit is used to acquire the modified message information; The matching module is used to match multiple target business rules based on the business event information and the business status information; The constructing module is configured to construct an entity class object of the target business rule by using a target mechanism. The processing module is configured to invoke the corresponding target business rule to process a business logic according to the entity class object.

7. The apparatus of claim 6, wherein, The processing module comprises: An arranging unit is configured to arrange the entity class object according to a preset priority to obtain an arrangement result. A processing unit is configured to invoke the corresponding target business rule to process the business logic according to the arrangement result.

8. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein, The processor, the communication interface and the memory complete mutual communication through the communication bus, and the method comprises the following steps: The memory is configured to store a computer program. The processor is configured to execute the method steps of any one of claims 1 to 5 by running the computer program stored in the memory.

9. A computer readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Execution method of rule engine, storage medium and server

    CN109542935A