CN115469833A - Method and device for implementing dynamic rule engine, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN115469833A
CN115469833A CN202210909388.1A CN202210909388A CN115469833A CN 115469833 A CN115469833 A CN 115469833A CN 202210909388 A CN202210909388 A CN 202210909388A CN 115469833 A CN115469833 A CN 115469833A
Authority
CN
China
Prior art keywords
rule
information
business
service
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210909388.1A
Other languages
Chinese (zh)
Inventor
张少奇
李文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202210909388.1A priority Critical patent/CN115469833A/en
Publication of CN115469833A publication Critical patent/CN115469833A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/4492Inheritance

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a method and a device for realizing a dynamic rule engine, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring message information under the condition of receiving page indication information, 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 is executed with triggering operation; matching a plurality of target business rules according to the business event information and the business state information; constructing an entity class object of a target business rule by using a target mechanism; and calling the corresponding target business rule processing business logic according to the entity class object. By the method and the device, the problems that maintenance expansion is difficult and main process management of the service is influenced in the related technology are solved.

Description

Method and device for implementing dynamic rule engine, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for implementing a dynamic rule engine, an electronic device, and a storage medium.
Background
Currently, as business of industries is more and more complex, market demands that business rules change frequently, and an IT system must be updated quickly and at low cost according to the change of the business rules. Meanwhile, the service is required to be provided continuously within 7 x 24 hours, and the service provision is not influenced by the updating realization of the business rule.
In the prior art, according to the change of a service rule, a service rule code logic is added into a main service process and is released and updated along with a system release version. The realization scheme has the defects of high coupling degree between the business rules and the application and between the business rule codes, difficult maintenance and expansion, disordered business code management and influence on the main process of the business.
Therefore, the related art has the problems that the maintenance expansion is difficult and the main process management of the business is influenced.
Disclosure of Invention
The application provides a method and a device for realizing a dynamic rule engine, electronic equipment and a storage medium, which are used for at least solving the problems that the maintenance and the expansion are difficult and the management of a main process of a business is influenced in the related technology.
According to an aspect of an embodiment of the present application, there is provided a method for implementing a dynamic rules engine, the method including:
acquiring message information under the condition of receiving page indication information, 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 a page is executed with a trigger operation;
matching a plurality of target business rules according to the business event information and the business state information;
constructing an entity class object of the target business rule by using a target mechanism;
and calling the corresponding target business rule processing business logic according to the entity class object.
According to another aspect of the embodiments of the present application, there is also provided an apparatus for implementing a dynamic rules engine, the apparatus including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring message information under the condition of receiving page indication information, the message information carries service event information and service state information of current service data, and the indication information is used for indicating that a page is executed with a trigger operation;
the matching module is used for matching a plurality of target business rules according to the business event information and the business state information;
the building module is used for building the entity class object of the target business rule by using a target mechanism;
and the processing module is used for calling the corresponding target business rule processing business logic according to the entity class object.
Optionally, the processing module comprises:
the arrangement unit is used for arranging the entity class objects according to a preset priority to obtain an arrangement result;
and the processing unit is used for calling the corresponding target business rule according to the arrangement result and processing the business logic.
Optionally, the apparatus further comprises:
the embedding module is used for embedding the buried point information at the application trigger point of the page before the page indication information is received;
and the determining module is used for determining whether the page is executed with the triggering operation by utilizing the buried point information.
Optionally, the obtaining module includes:
a determining unit, configured to determine policy configuration information according to the page indication information, where the policy configuration information includes the service event information and the service state information;
a modification unit, configured to modify, according to the policy configuration information, message information generated by the policy configuration information, so that the modified message information matches the policy configuration information;
and the acquisition unit is used for acquiring the modified message information.
Optionally, the apparatus further comprises:
and the modification module is used for modifying the strategy configuration information so that the target business rule completes online update or offline update and realizes a dynamic rule engine.
Optionally, the rule type to which the target business rule belongs includes: the system comprises a static definition rule type, a dynamic compiling rule type, a remote calling rule type and a database storage rule type, wherein the matching module comprises:
a selecting unit, configured to select any one rule type from the static definition rule type, the dynamic compilation rule type, the remote invocation rule type, and the database storage rule type as a rule base for selecting the target service rule;
and the matching unit is used for matching a plurality of target business rules from the rule base.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory communicate with each other through the communication bus; wherein the memory is used for storing the computer program; a processor for performing the method steps in any of the above embodiments by running the computer program stored on the memory.
According to a further aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to perform the method steps of any of the above embodiments when the computer program is executed.
In the embodiment of the application, an embedded calling mode and an application core code are completely decoupled, and message information is acquired under the condition 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 a page is executed with a trigger operation; matching a plurality of target business rules according to the business event information and the business state information; constructing an entity class object of a target business rule by using a target mechanism; and calling the corresponding target business rule processing business logic according to the entity class object. According to the method and the device, the business rules are separated from the application program codes, the message information is obtained after the page indication information is received, the target business rules corresponding to the current business data are selected, then the entity class objects of the target business rules are constructed by using a target mechanism, the rule responsibility chain is spliced and generated, then the rule chain is scheduled and executed, and business processing is carried out, so that the decoupling with the core module of the main business process can be realized, the later expansion and maintenance are facilitated, the learning cost and the development cost are greatly reduced, the agile development capability is greatly improved, the whole software development cycle and the demand response time are shortened, the software development cost is reduced, the higher economic value is generated, and the problems that the maintenance expansion is difficult and the business main process management is influenced in the related technology are solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a flow chart diagram illustrating an alternative method for implementing a dynamic rules engine according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an alternative mechanism for implementing hot-deployment and pluggable rule bases according to an embodiment of the present application;
FIG. 3 is a schematic overall flow chart of an alternative rule scheduling according to an embodiment of the present application;
FIG. 4 is a block diagram of an alternative implementation of a dynamic rules engine according to an embodiment of the present application;
fig. 5 is a block diagram of an alternative electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The current business rules need to be updated and iterated in real time along with the market demands, and the prior art scheme is to add business rule code logic into a business main process according to the change of the business rules and issue updates along with a system release version, but the mode has the following defects: the coupling degree of the business rule and the application is high, and the maintenance and the expansion are difficult; the coupling of the business rules and the business rule codes is high, and the maintenance and the expansion are difficult; updating the business rules to release the application, and influencing the main process of the business; and the business rule codes are scattered and management is disordered. In order to solve the above problem, an embodiment of the present application provides an implementation method of a dynamic rule engine, which may be applied to a backend server as shown in fig. 1, and the method includes:
step S101, under the condition of receiving page indication information, obtaining message information, 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 is executed with trigger operation;
step S102, matching a plurality of target business rules according to the business event information and the business state information;
step S103, an entity class object of the target business rule is constructed by using a target mechanism;
and step S104, calling the corresponding target business rule processing business logic according to the entity class object.
Optionally, some embedded point information may be set at a trigger point of an application page of a front-end page in the embodiment of the application, for example, some control buttons, and certainly, embedded point information may also be embedded at any position of the page, only a few simple lines of scheduling codes need to be embedded, then, based on the embedded point information, whether the currently displayed page is clicked by a worker or other users may be monitored in real time, a 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 at this time, where the message information carries service event information and service state information of currently operated service data, for example, the currently clicked service event is xxx package service, and a handled service state may be before, during, after, or the like. It can be known that even if the same service event is the same, if the service event corresponds to different service state information, the generated message information will be different.
And then the front end sends the generated message information to a background server side, and the background server matches a plurality of target service rules from the rule base based on the currently obtained service event information and service state information. For example, if the business event is a xxx package business, the business status of a transaction may be in-process, and the matching target business rules may include: free call duration, free short message number, free color ring, etc. Additionally, the target business rules may be business rules written based on the java programming language.
It should be noted that, the multiple target service rules matched according to the service event information and the service state information are required to satisfy the current service event information and service state information, otherwise, an error is prompted, and the service fails to be handled.
After obtaining a plurality of target business rules, using a target mechanism, such as a java reflection mechanism, to construct the target business rule entity class objects from the rule base, and then invoking corresponding target business rules to execute business logic processing based on the entity class objects.
In the embodiment of the application, an embedded calling mode and an application core code are completely decoupled, and message information is acquired under the condition 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 a page is executed with a trigger operation; matching a plurality of target business rules according to the business event information and the business state information; constructing an entity class object of a target business rule by using a target mechanism; and calling the corresponding target business rule processing business logic according to the entity class object. According to the method and the device, the business rules are separated from the application program codes, the message information is obtained after the page indication information is received, the target business rules corresponding to the current business data are selected, the entity class objects of the target business rules are constructed by using a target mechanism, the rule responsibility chains are spliced and generated, then the rule chain is scheduled and executed, and business processing is carried out, so that the decoupling with the core module of the business main flow can be realized, the later expansion and maintenance are facilitated, the learning cost and the development cost are greatly reduced, the agile development capability is greatly improved, the whole software development period and the required response time are shortened, the software development cost is reduced, the great economic value is generated, and the problems that the maintenance expansion is difficult and the business main flow management is influenced in the related technology are solved.
As an optional embodiment, invoking the corresponding target business rule processing business logic according to the entity class object includes:
arranging the entity class objects according to the preset priority to obtain an arrangement result;
and calling the corresponding target business rule according to the arrangement result, and processing the business logic.
Optionally, since there may be a plurality of target service rules obtained by matching, and there will be a plurality of entity class objects generated correspondingly, in the embodiment of the present application, a plurality of entity class objects may be arranged and spliced according to a preset priority of a current scene to generate a responsibility chain, and the corresponding target service rules are sequentially invoked according to the arrangement results of the plurality of entity class objects in the responsibility chain to process service logic.
For example, when the current service scenario is a complementary card transaction, the identity authentication is required to be performed first when the target service rule is called, so that the entity class objects corresponding to the target service rule of the identity authentication are arranged at the top, and then when the service processing logic is scheduled and executed, the scheduling of the identity authentication entity class objects is performed first.
In the embodiment of the application, each target business rule is made to be a single thing by the responsibility chain mode, and codes between the rules are completely decoupled and do not influence each other.
As an optional embodiment, the obtaining the message information includes:
determining policy configuration information according to the page indication information, wherein the policy configuration information comprises service event information and service state information;
modifying the message information generated by the strategy configuration information according to the strategy configuration information so that the modified message information is matched with the strategy configuration information;
and acquiring the modified message information.
Optionally, the policy configuration information may be generated by supporting multidimensional policies such as a service action, a service source, a service object type, and a service object type ID according to the service event information and the service state information of the event occurrence.
After the page is determined to be triggered, if the generated strategy configuration information is not matched with the currently generated message information, the core object structure of the application can be changed according to the java reference value transferring mode, the message information generated by the strategy configuration information is modified, the modified message information is matched with the strategy configuration information, and then the front end sends the modified message information to the background server.
The embodiment of the application adopts a citation value transfer mode to modify the core object structure of the application so as to achieve the purpose of flexibility and changeability.
As an alternative embodiment, the method further comprises:
and modifying the strategy configuration information to enable the target business rule to complete online updating or offline updating, thereby realizing a dynamic rule engine.
Optionally, after the current policy configuration information is obtained, dynamic update of the policy configuration may be performed, so that the target business rule completes online update or offline update, and a dynamic rule engine is implemented.
As an alternative embodiment, the rule type to which the target business rule belongs includes: the method comprises the following steps of statically defining a rule type, dynamically compiling the rule type, remotely calling the rule type and storing the rule type in a database, wherein the step of matching a plurality of target business rules according to business event information and business state information comprises the following steps:
selecting any one rule type from a static definition rule type, a dynamic compiling rule type, a remote calling rule type and a database storage rule type as a rule base for selecting a target service rule;
a plurality of target business rules are matched from the rule base.
Optionally, the target business rules are java rules, and the rule types include, but are not limited to: the method comprises the steps of statically defining rule types, dynamically compiling rule types, remotely calling rule types and database storage rule types, wherein the 4 types are used as rule bases, and then any one of the 4 types of rule bases is selected as a rule base for selecting target service rules to obtain a plurality of target service rules.
Statically defined rule types: and the universal standard java interface user defined by the inheritance rule engine realizes logic processing according to specific services. The static java rules are compiled in advance like the application codes and are called along with the application start.
Dynamic compilation rule type: the inheritance standard dynamic java abstract class code content is written in a database field and is loaded, compiled and executed by a rule running module in real time. The dynamic java class only needs to be compiled once, and hot deployment and plug-in are achieved.
Remote invocation rule type: the external java file inheriting the external java abstract class can be placed in a specified remote server directory after being compiled, is remotely called by the service, is effectively isolated from the application, and realizes hot deployment and pluggable of the service rule.
The database stores rule types: the database stores various rule information, and can directly search whether candidate rule information meeting the conditions is used as parameters to be added in the matching process according to the stored various rule information so as to provide rich parameters for the rules to use, thereby realizing hot deployment and plug-pull of the rules and agile development without participation of developers.
The mechanism for implementing hot deployment and pluggable among the 4 types of rule bases can be seen in fig. 2.
As an alternative embodiment, as shown in fig. 3, fig. 3 is a schematic overall flow chart of an alternative rule scheduling according to the embodiment of the present application, and the specific step flow is as follows:
firstly, defining a contact point of a rule trigger embedded application; the rule calling center generates strategy configuration information according to the multi-dimensional strategy, sets the strategy configuration information in a database, and supports dynamic online and offline of the business rule through modification and configuration; and dynamically loading a rule base to realize rule instantiation, splicing according to the priority to form a dynamic rule chain comprising java rules 1, java rules 2 and the like, and executing specific business logic based on the dynamic rule chain.
Taking the internet of things CRM (Customer Relationship Management) project order business as an example, the business rules need to be updated when a monthly version of a CRM project order comes online. At present, the requirement that an operator modifies the rule according to the service condition is met, and after approval is passed, the rule can be updated into the system in real time without waiting for updating of the version to update the rule.
1. Making embedded buried points at trigger points in advance;
2. a developer finishes writing the rule components by using one of the four rule component classes, the rule logic modifies the service data (the execution cannot be triggered at the moment), and the hot deployment and the pluggable of the rule codes are realized;
3. after the business party checks the rule, operation and maintenance personnel can configure the rule engine decision table to enable the rule to be online and offline, so that the modification of data processing logic is realized, and the rule updating is completed.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art will recognize that the embodiments described in this specification are preferred embodiments and that acts or modules referred to are not necessarily required for this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., a ROM (Read-Only Memory)/RAM (Random Access Memory), a magnetic disk, an optical disk) and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the methods of the embodiments of the present application.
According to another aspect of the embodiment of the present application, there is also provided an implementation apparatus of a dynamic rules engine, for implementing the implementation method of the dynamic rules engine. Fig. 4 is a block diagram of an implementation apparatus of an optional dynamic rules engine according to an embodiment of the present application, and as shown in fig. 4, the implementation apparatus may include:
an obtaining module 401, configured to obtain message information when page indication information is received, where the message information carries service event information and service state information of current service data, and the indication information is used to indicate that a page is triggered;
a matching module 402, configured to match to multiple target business rules according to the business event information and the business state information;
a constructing module 403, configured to construct an entity class object of the target business rule by using a target mechanism;
and the processing module 404 is configured to invoke a corresponding target business rule processing business logic according to the entity class object.
It should be noted that the obtaining module 401 in this embodiment may be configured to execute the step S101, the matching module 402 in this embodiment may be configured to execute the step S102, the constructing module 403 in this embodiment may be configured to execute the step S103, and the processing module 404 in this embodiment may be configured to execute the step S104.
Through the modules, the business rules are separated from the application program codes, the message information is obtained after the page indication information is received, the target business rules corresponding to the current business data are selected, then the entity class objects of the target business rules are constructed by utilizing a target mechanism, the rule responsibility chains are spliced and generated, then the rule chains are scheduled and executed, and business processing is carried out.
As an alternative embodiment, the processing module comprises:
the arrangement unit is used for arranging the entity class objects according to the preset priority to obtain an arrangement result;
and the processing unit is used for calling the corresponding target business rule according to the arrangement result and processing the business logic.
As an alternative embodiment, the apparatus further comprises:
the embedding module is used for embedding the buried point information at the application trigger point of the page before the page indication information is received;
and the determining module is used for determining whether the page is executed with the triggering operation by utilizing the buried point information.
As an alternative embodiment, the obtaining module includes:
the determining unit is used for determining the strategy configuration information according to the page indication information, wherein the strategy configuration information comprises service event information and service state information;
a modification unit, 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;
and the acquisition unit is used for acquiring the modified message information.
As an alternative embodiment, the apparatus further comprises:
and the modification module is used for modifying the strategy configuration information so that the target business rule completes online update or offline update and realizes a dynamic rule engine.
As an alternative embodiment, the rule type to which the target business rule belongs includes: the matching module comprises a static definition rule type, a dynamic compiling rule type, a remote calling rule type and a database storage rule type, and the matching module comprises:
the selection unit is used for selecting any one rule type from the static definition rule type, the dynamic compiling rule type, the remote calling rule type and the database storage rule type as a rule base for selecting the target service rule;
and the matching unit is used for matching a plurality of target business rules from the rule base.
It should be noted that the modules described above are the same as examples and application scenarios realized by corresponding steps, but are not limited to what is disclosed in the foregoing embodiments.
According to another aspect of the embodiments of the present application, there is further provided an electronic device for implementing the implementation method of the dynamic rules engine, where the electronic device may be a server, a terminal, or a combination thereof.
Fig. 5 is a block diagram of an alternative electronic device according to an embodiment of the present application, as shown in fig. 5, including a processor 501, a communication interface 502, a memory 503, and a communication bus 504, where the processor 501, the communication interface 502, and the memory 503 are communicated with each other through the communication bus 504, where,
a memory 503 for storing a computer program;
the processor 501, when executing the computer program stored in the memory 503, implements the following steps:
acquiring message information under the condition of receiving page indication information, 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 is executed with triggering operation;
matching a plurality of target business rules according to the business event information and the business state information;
constructing an entity class object of a target business rule by using a target mechanism;
and calling the corresponding target business rule processing business logic according to the entity class object.
Alternatively, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The memory may include RAM, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
As an example, as shown in fig. 5, the memory 503 may include, but is not limited to, an obtaining module 401, a matching module 402, a constructing module 403, and a processing module 404 in an implementation apparatus including the dynamic rule engine. In addition, other module units in the implementation apparatus of the dynamic rules engine may also be included, but are not limited to these, and are not described in this example again.
The processor may be a general-purpose processor, and may include but is not limited to: a CPU (Central Processing Unit), an NP (Network Processor), and the like; but also a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In addition, the electronic device further includes: and the display is used for displaying the implementation result of the dynamic rule engine.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 5 is only an illustration, and the device implementing the implementation method of the dynamic rule engine may be a terminal device, and the terminal device may be a terminal device such as a smart phone (e.g., an Android Mobile phone, an iOS Mobile phone, etc.), a tablet computer, a palmtop computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 5 is a diagram illustrating a structure of the electronic device. For example, the terminal device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, and the like.
According to still another aspect of an embodiment of the present application, there is also provided a storage medium. Alternatively, in this embodiment, the storage medium may be used to execute a program code of an implementation method of a dynamic rule engine.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
acquiring message information under the condition of receiving page indication information, 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 is executed with trigger operation;
matching a plurality of target business rules according to the business event information and the business state information;
constructing an entity class object of a target business rule by using a target mechanism;
and calling the corresponding target business rule processing business logic according to the entity class object.
Optionally, the specific example in this embodiment may refer to the example described in the above embodiment, which is not described again in this embodiment.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a U disk, a ROM, a RAM, a removable hard disk, a magnetic disk, or an optical disk.
According to yet another aspect of an embodiment of the present application, there is also provided a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium; the processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to execute the implementation method steps of the dynamic rule engine in any of the above embodiments.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the implementation method of the dynamic rules engine of the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is only a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, and may also be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for implementing a dynamic rules engine, the method comprising:
acquiring message information under the condition of receiving page indication information, 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 a page is executed with trigger operation;
matching a plurality of target business rules according to the business event information and the business state information;
constructing an entity class object of the target business rule by using a target mechanism;
and calling the corresponding target business rule processing business logic according to the entity class object.
2. The method of claim 1, wherein invoking the corresponding target business rule processing business logic according to the entity class object comprises:
arranging the entity class objects according to a preset priority to obtain an arrangement result;
and calling the corresponding target business rule according to the arrangement result, and processing the business logic.
3. The method of claim 1, wherein prior to receiving page indication information, the method further comprises:
embedding buried point information at an application trigger point of the page;
and determining whether the page is executed with a trigger operation by using the buried point information.
4. The method according to any one of claims 1 to 3, wherein the obtaining the message information comprises:
determining policy configuration information according to the page indication information, wherein the policy configuration information comprises the service event information and the service state information;
modifying the message information generated by the strategy configuration information according to the strategy configuration information so that the modified message information is matched with the strategy configuration information;
and acquiring the modified message information.
5. The method of claim 4, further comprising:
and modifying the strategy configuration information to enable the target business rule to complete online updating or offline updating, so as to realize a dynamic rule engine.
6. The method of claim 1, wherein the rule type to which the target business rule belongs comprises: the matching of the service event information and the service state information to a plurality of target service rules comprises the following steps:
selecting any one rule type from the static definition rule type, the dynamic compiling rule type, the remote calling rule type and the database storage rule type as a rule base for selecting the target service rule;
and matching a plurality of target business rules from the rule base.
7. An apparatus for implementing a dynamic rules engine, the apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring message information under the condition of receiving page indication information, the message information carries service event information and service state information of current service data, and the indication information is used for indicating that a page is executed with a trigger operation;
the matching module is used for matching a plurality of target business rules according to the business event information and the business state information;
the building module is used for building the entity class object of the target business rule by using a target mechanism;
and the processing module is used for calling the corresponding target business rule processing business logic according to the entity class object.
8. The apparatus of claim 7, wherein the processing module comprises:
the arrangement unit is used for arranging the entity class objects according to a preset priority to obtain an arrangement result;
and the processing unit is used for calling the corresponding target business rule according to the arrangement result and processing the business logic.
9. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein said processor, said communication interface and said memory communicate with each other via said communication bus,
the memory for storing a computer program;
the processor for performing the method steps of any one of claims 1 to 6 by running the computer program stored on the memory.
10. A computer-readable storage medium, in which a computer program is stored, wherein the computer program realizes the method steps of any one of claims 1 to 6 when executed by a processor.
CN202210909388.1A 2022-07-29 2022-07-29 Method and device for implementing dynamic rule engine, electronic equipment and storage medium Pending CN115469833A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210909388.1A CN115469833A (en) 2022-07-29 2022-07-29 Method and device for implementing dynamic rule engine, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210909388.1A CN115469833A (en) 2022-07-29 2022-07-29 Method and device for implementing dynamic rule engine, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115469833A true CN115469833A (en) 2022-12-13

Family

ID=84366582

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210909388.1A Pending CN115469833A (en) 2022-07-29 2022-07-29 Method and device for implementing dynamic rule engine, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115469833A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115774707A (en) * 2023-02-15 2023-03-10 广州汇通国信科技有限公司 Object attribute based data processing method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115774707A (en) * 2023-02-15 2023-03-10 广州汇通国信科技有限公司 Object attribute based data processing method and device, electronic equipment and storage medium
CN115774707B (en) * 2023-02-15 2023-05-12 广州汇通国信科技有限公司 Object attribute-based data processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107979508B (en) Micro-service test method and device
CN110162470B (en) Block chain testing method and device
CN108920370B (en) Compatibility problem detection method, device and equipment
CN112488855B (en) Business verification method and device based on rule template
CN110569035A (en) Code compiling method, device, equipment and storage medium of software development project
JP2019500680A (en) Data processing method and apparatus
CN112631803A (en) Intelligent contract calling method, device, server and storage medium for block chain
CN112165507B (en) Method, device, equipment and medium for supporting multi-service architecture by single Web project
CN111899008B (en) Resource transfer method, device, equipment and system
CN111782519A (en) Test method and device and electronic equipment
CN111694638A (en) Rule package loading method, rule package executing method and terminal equipment
CN109885612B (en) Synchronous validation method and device for intelligent contracts of block chains
CN112882732A (en) Method and device for updating function codes in Software Development Kit (SDK)
CN115469833A (en) Method and device for implementing dynamic rule engine, electronic equipment and storage medium
CN110347735A (en) The data forwarding of configurationization mends processing method, device and readable storage medium storing program for executing extremely
CN112486518B (en) Consensus algorithm assembling method and device
CN110111188B (en) Business handling method and equipment
CN108932146A (en) Page display method, device and computer readable storage medium
CN112132530A (en) Visual dynamic flow arrangement method and system
CN111782518A (en) Test method and device and electronic equipment
US11669316B2 (en) Web-based customer service via single-class rebuild
CN114356346A (en) Application program deployment method, device, storage medium and electronic equipment
CN108845953B (en) Interface testing method and device
CN114358936A (en) Intelligent contract operation method based on micro-service block chain
CN112306843A (en) Test method, test device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination