[go: up one dir, main page]

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
information
business
rule
target
target business
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.)
China Telecom Cloud Technology Co Ltd
Original Assignee
China Telecom 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 China Telecom Cloud Technology Co Ltd filed Critical China Telecom 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

动态规则引擎的实现方法和装置、电子设备和存储介质Realization method and device of dynamic rule engine, electronic device and storage medium

技术领域technical field

本申请涉及计算机技术领域,尤其涉及一种动态规则引擎的实现方法和装置、电子设备和存储介质。The present application relates to the field of computer technology, in particular to a method and device for realizing a dynamic rule engine, electronic equipment and a storage medium.

背景技术Background technique

当前,随着行业的业务越来越复杂,市场要求业务规则经常变化,IT系统必须依据业务规则的变化快速、低成本的更新。同时要求应用7×24小时不间断提供服务,业务规则的更新实现不影响服务提供。At present, as the business of the industry becomes more and more complex, the market requires frequent changes in business rules, and IT systems must be updated quickly and at low cost according to changes in business rules. At the same time, the application is required to provide services 7×24 hours a day, and the update of business rules will not affect the service provision.

现有技术方案是根据业务规则变化,将业务规则代码逻辑加入业务主流程,随系统发布版本一起发布更新。这种实现方案存在业务规则与应用耦合度、业务规则代码之间的耦合度高,难以维护扩展,业务代码管理混乱,影响业务主流程的缺点。The existing technical solution is to add business rule code logic into the main business process according to changes in business rules, and release updates together with the system release version. This implementation scheme has the disadvantages of high coupling between business rules and applications, and high coupling between business rule codes, which makes it difficult to maintain and expand, and business code management is chaotic, which affects the main business process.

因此,相关技术中存在难以维护扩展、影响业务主流程管理的问题。Therefore, there are problems in the related technology that it is difficult to maintain and expand, and affects the management of the main business process.

发明内容Contents of the invention

本申请提供了一种动态规则引擎的实现方法和装置、电子设备和存储介质,以至少解决相关技术中存在难以维护扩展、影响业务主流程管理的问题。The present application provides a method and device for implementing a dynamic rule engine, an electronic device and a storage medium, so as to at least solve the problems in related technologies that are difficult to maintain and expand, and affect the management of the main business process.

根据本申请实施例的一个方面,提供了一种动态规则引擎的实现方法,该方法包括:According to an aspect of an embodiment of the present application, a method for implementing a dynamic rule engine is provided, the method including:

在接收到页面指示信息的情况下,获取报文信息,其中,所述报文信息中携带有当前业务数据的业务事件信息和业务状态信息,所述指示信息用于指示页面被执行了触发操作;In the case of receiving the page indication information, obtain message information, wherein 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. ;

根据所述业务事件信息和所述业务状态信息匹配到多个目标业务规则;matching multiple target business rules according to the business event information and the business state information;

利用目标机制构建所述目标业务规则的实体类对象;Using the target mechanism to construct the entity class object of the target business rule;

根据所述实体类对象调用对应的所述目标业务规则处理业务逻辑。Invoking the corresponding target business rule processing business logic according to the entity class object.

根据本申请实施例的另一个方面,还提供了一种动态规则引擎的实现装置,该装置包括:According to another aspect of the embodiment of the present application, an apparatus for implementing a dynamic rule engine is also provided, the apparatus including:

获取模块,用于在接收到页面指示信息的情况下,获取报文信息,其中,所述报文信息中携带有当前业务数据的业务事件信息和业务状态信息,所述指示信息用于指示页面被执行了触发操作;An acquisition module, configured to acquire message information when page indication information is received, wherein the message information carries business event information and business status information of current business data, and the indication information is used to indicate page A trigger operation is performed;

匹配模块,用于根据所述业务事件信息和所述业务状态信息匹配到多个目标业务规则;A matching module, configured to match multiple target business rules according to the business event information and the business state information;

构建模块,用于利用目标机制构建所述目标业务规则的实体类对象;A building module, configured to use a target mechanism to construct an entity class object of the target business rule;

处理模块,用于根据所述实体类对象调用对应的所述目标业务规则处理业务逻辑。A processing module, configured to call the corresponding target business rule to process business logic according to the entity class object.

可选地,处理模块包括:Optionally, processing modules include:

排列单元,用于根据预设优先级对所述实体类对象进行排列,得到排列结果;an arrangement unit, configured to arrange the entity class objects according to a preset priority to obtain an arrangement result;

处理单元,用于按照所述排列结果调用对应的所述目标业务规则,处理所述业务逻辑。A processing unit, configured to call the corresponding target business rule according to the arrangement result, and process the business logic.

可选地,该装置还包括:Optionally, the device also includes:

嵌入模块,用于在接收到页面指示信息之前,在所述页面的应用触发点处嵌入埋点信息;An embedding module, configured to embed buried point information at the application trigger point of the page before receiving the page indication information;

确定模块,用于利用所述埋点信息确定所述页面是否被执行了触发操作。A determination module, configured to determine whether a trigger operation has been performed on the page by using the buried point information.

可选地,获取模块包括:Optionally, the acquisition module includes:

确定单元,用于根据所述页面指示信息,确定策略配置信息,其中,所述策略配置信息包括所述业务事件信息和所述业务状态信息;A determining unit, configured to determine policy configuration information according to the page indication information, wherein the policy configuration information includes the business event information and the business status information;

修改单元,用于根据所述策略配置信息,修改由所述策略配置信息生成的报文信息,使得修改后的报文信息与所述策略配置信息相匹配;A modifying unit, configured to modify 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;

获取单元,用于获取所述修改后的报文信息。An obtaining unit, configured to obtain the modified message information.

可选地,该装置还包括:Optionally, the device also includes:

修改模块,用于修改所述策略配置信息,使得所述目标业务规则完成线上更新或线下更新,实现动态规则引擎。The modification module is used to modify the policy configuration information, so that the target business rules can be updated online or offline, and realize a dynamic rule engine.

可选地,目标业务规则所属的规则类型包括:静态定义规则类型、动态编译规则类型、远程调用规则类型、数据库存储规则类型,匹配模块包括:Optionally, the rule type to which the target business rule belongs includes: static definition rule type, dynamic compilation rule type, remote call rule type, database storage rule type, and the matching module includes:

选取单元,用于从所述静态定义规则类型、所述动态编译规则类型、所述远程调用规则类型、所述数据库存储规则类型中选取任意一种规则类型作为选取所述目标业务规则的规则库;An selecting unit, configured to select any rule type from the static definition rule type, the dynamic compilation rule type, the remote call rule type, and the database storage rule type as a rule base for selecting the target business rule ;

匹配单元,用于从所述规则库中匹配出多个所述目标业务规则。A matching unit, configured to match a plurality of target business rules from the rule base.

根据本申请实施例的又一个方面,还提供了一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器、通信接口和存储器通过通信总线完成相互间的通信;其中,存储器,用于存储计算机程序;处理器,用于通过运行所述存储器上所存储的所述计算机程序来执行上述任一实施例中的方法步骤。According to yet 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, wherein, the processor, the communication interface, and the memory complete mutual communication through the communication bus; wherein, The memory is used to store a computer program; the processor is used to execute the method steps in any one of the above embodiments by running the computer program stored in the memory.

根据本申请实施例的又一个方面,还提供了一种计算机可读的存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一实施例中的方法步骤。According to still another 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 set to execute the method in any of the above-mentioned embodiments when running step.

在本申请实施例中,采用嵌入式调用方式与应用核心代码完全解耦的方式,通过在接收到页面指示信息的情况下,获取报文信息,其中,报文信息中携带有当前业务数据的业务事件信息和业务状态信息,指示信息用于指示页面被执行了触发操作;根据业务事件信息和业务状态信息匹配到多个目标业务规则;利用目标机制构建目标业务规则的实体类对象;根据实体类对象调用对应的目标业务规则处理业务逻辑。由于本申请实施例将业务规则从应用程序代码中分离出来,在接收到页面指示信息后获取报文信息,选取与当前业务数据相对应的目标业务规则,然后利用目标机制构建目标业务规则的实体类对象,拼接生成规则责任链,进而进行规则链的调度执行,进行业务处理,这样就可以做到与业务主流程的核心模块解耦,有利于后期的扩展和维护,且大幅度降低学习成本和开发成本,极大提升敏捷开发能力,缩短了整个软件开发周期和需求响应时间,从而降低软件开发成本,产生较大的经济价值,进而解决了相关技术中存在的难以维护扩展、影响业务主流程管理的问题。In this embodiment of the application, the embedded call method is completely decoupled from the application core code, and the message information is obtained when the page indication information is received, wherein the message information carries the information of the current business data Business event information and business status information, the indication information is used to indicate that the page has been triggered; match multiple target business rules according to the business event information and business status information; use the target mechanism to construct the entity class object of the target business rule; according to the entity The class object invokes the corresponding target business rule to process the business logic. Since the embodiment of the present application separates the business rules from the application program code, obtain the message information after receiving the page instruction information, select the target business rules corresponding to the current business data, and then use the target mechanism to construct the entity of the target business rules Class objects are stitched together to generate a rule chain of responsibility, and then the scheduling and execution of the rule chain is carried out to perform business processing, so that it can be decoupled from the core module of the main business process, which is conducive to later expansion and maintenance, and greatly reduces learning costs. and development costs, greatly improving agile development capabilities, shortening the entire software development cycle and demand response time, thereby reducing software development costs and generating greater economic value, thereby solving problems in related technologies that are difficult to maintain and expand, and affect business owners. problem of process management.

附图说明Description of 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 technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, In other words, other drawings can also be obtained from these drawings without paying creative labor.

图1是根据本申请实施例的一种可选的动态规则引擎的实现方法的流程示意图;FIG. 1 is a schematic flowchart of an optional implementation method of a dynamic rule engine according to an embodiment of the present application;

图2是根据本申请实施例的一种可选的规则库之间实现热部署、可插拔的机制示意图;FIG. 2 is a schematic diagram of an optional mechanism for implementing hot deployment and pluggability between rule bases according to an embodiment of the present application;

图3是根据本申请实施例的一种可选的规则调度的整体流程示意图;FIG. 3 is a schematic diagram of an overall process flow of an optional rule scheduling according to an embodiment of the present application;

图4是根据本申请实施例的一种可选的动态规则引擎的实现装置的结构框图;FIG. 4 is a structural block diagram of an optional implementation device of a dynamic rule engine according to an embodiment of the present application;

图5是根据本申请实施例的一种可选的电子设备的结构框图。Fig. 5 is a structural block diagram of an optional electronic device according to an embodiment of the present application.

具体实施方式detailed description

为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the application. Obviously, the described embodiment is only It is an embodiment of a part of the application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.

需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first" and "second" in the description and claims of the present application and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed Those steps or elements may instead include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.

当前的业务规则随着市场的需求需要实时更新迭代,现有技术方案是根据业务规则变化,将业务规则代码逻辑加入业务主流程,随系统发布版本一起发布更新,但是这种方式存在以下缺陷:业务规则与应用耦合度高,难以维护扩展;业务规则与业务规则代码耦合高,难以维护扩展;业务规则更新需要发布应用,影响业务主流程;业务规则代码分散,管理混乱。为了解决上述问题,本申请实施例提出一种动态规则引擎的实现方法,如图1所示,该方法可以应用于后台服务器,该方法包括:The current business rules need to be updated and iterated in real time according to the market demand. The existing technical solution is to add the business rule code logic into the main business process according to the change of the business rules, and release the update together with the system release version. However, this method has the following defects: Business rules and applications are highly coupled, making it difficult to maintain and expand; business rules and business rule codes are highly coupled, making maintenance and expansion difficult; business rule updates require the release of applications, affecting the main business process; business rule codes are scattered and management is chaotic. In order to solve the above problems, the embodiment of the present application proposes a method for implementing a dynamic rule engine. As shown in FIG. 1, the method can be applied to a background server, and the method includes:

步骤S101,在接收到页面指示信息的情况下,获取报文信息,其中,报文信息中携带有当前业务数据的业务事件信息和业务状态信息,指示信息用于指示页面被执行了触发操作;Step S101, in the case of receiving the page indication information, obtain message information, wherein the message information carries business event information and business status information of current business data, and the indication information is used to indicate that the page has been triggered;

步骤S102,根据业务事件信息和业务状态信息匹配到多个目标业务规则;Step S102, matching multiple target business rules according to the business event information and business state information;

步骤S103,利用目标机制构建目标业务规则的实体类对象;Step S103, using the target mechanism to construct the entity class object of the target business rule;

步骤S104,根据实体类对象调用对应的目标业务规则处理业务逻辑。Step S104, call the corresponding target business rule to process business logic according to the entity class object.

可选地,本申请实施例的前端页面的应用页面的触发点处,比如一些控制按钮处可以嵌入地设置一些埋点信息,当然也可以在页面的任何位置嵌入埋点信息,只需要嵌入简单的几行调度代码,然后基于这个埋点信息可以实时监控到当前展示的页面是否被工作人员或其他用户点击,执行了触发操作,若确定页面被执行了触发操作,这时会基于当前的操作生成一个报文信息,其中,该报文信息中携带有当前被操作的业务数据的业务事件信息和业务状态信息,比如当前点击的业务事件是xxx套餐业务,办理的业务状态可以是办理前、办理中还是办理后等。可以知道的是,即使是同一个业务事件,如果对应不同的业务状态信息,那生成的报文信息也将是不同的。Optionally, at the trigger point of the application page of the front-end page of the embodiment of the present application, such as some control buttons, some embedded point information can be embedded, and of course embedded point information can be embedded anywhere on the page, as long as the embedded point is simple A few lines of scheduling code, and then based on this 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 trigger operation has been executed on the page, it will be based on the current operation. Generate a message message, where the message message carries the business event information and business status information of the currently operated business data. For example, the currently clicked business event is the xxx package service, and the business status processed can be before processing, In process or after processing. It can be known that, even if it is the same business event, if it corresponds to different business state information, the message information generated will be different.

然后前端会将生成的报文信息发送到后台服务器侧,后台服务器会基于当前得到的业务事件信息和业务状态信息从规则库中匹配到多个目标业务规则。举例说明,如果业务事件是xxx套餐业务,办理的业务状态可以是办理中,那匹配到的目标业务规则就可以包括:免费通话时长、免费短信条数、免费彩铃等。另外,这些目标业务规则可以是基于java编程语言编写的业务规则。Then the front end will send the generated message information to the background server side, and the background server will match multiple target business rules from the rule base based on the currently obtained business event information and business status information. For example, if the business event is the xxx package business, and the business status being handled can be in process, then the matched target business rules can include: free call duration, number of free text messages, free ring tones, etc. In addition, these target business rules may be business rules written based on the java programming language.

需要说明的是,依据业务事件信息和业务状态信息匹配到的多个目标业务规则一定是要满足当下的业务事件信息和业务状态信息的,否则就会提示报错,这项业务也就办理失败了。It should be noted that the multiple target business rules matched according to the business event information and business status information must meet the current business event information and business status information, otherwise an error will be prompted and the business will fail .

在得到多个目标业务规则后,使用目标机制,比如java反射机制,从规则库中构造上述的目标业务规则实体类对象,然后基于这些实体类对象调用对应的目标业务规则执行业务逻辑的处理。After obtaining multiple target business rules, use the target mechanism, such as the java reflection mechanism, to construct the above-mentioned target business rule entity class objects from the rule base, and then call the corresponding target business rules based on these entity class objects to execute business logic processing.

在本申请实施例中,采用嵌入式调用方式与应用核心代码完全解耦的方式,通过在接收到页面指示信息的情况下,获取报文信息,其中,报文信息中携带有当前业务数据的业务事件信息和业务状态信息,指示信息用于指示页面被执行了触发操作;根据业务事件信息和业务状态信息匹配到多个目标业务规则;利用目标机制构建目标业务规则的实体类对象;根据实体类对象调用对应的目标业务规则处理业务逻辑。由于本申请实施例将业务规则从应用程序代码中分离出来,在接收到页面指示信息后获取报文信息,选取与当前业务数据相对应的目标业务规则,然后利用目标机制构建目标业务规则的实体类对象,拼接生成规则责任链,进而进行规则链的调度执行,进行业务处理,这样就可以做到与业务主流程的核心模块解耦,有利于后期的扩展和维护,且大幅度降低学习成本和开发成本,极大提升敏捷开发能力,缩短了整个软件开发周期和需求响应时间,从而降低软件开发成本,产生较大的经济价值,进而解决了相关技术中存在的难以维护扩展、影响业务主流程管理的问题。In this embodiment of the application, the embedded call method is completely decoupled from the application core code, and the message information is obtained when the page indication information is received, wherein the message information carries the information of the current business data Business event information and business status information, the indication information is used to indicate that the page has been triggered; match multiple target business rules according to the business event information and business status information; use the target mechanism to construct the entity class object of the target business rule; according to the entity The class object invokes the corresponding target business rule to process the business logic. Since the embodiment of the present application separates the business rules from the application program code, obtain the message information after receiving the page instruction information, select the target business rules corresponding to the current business data, and then use the target mechanism to construct the entity of the target business rules Class objects are stitched together to generate a rule chain of responsibility, and then the scheduling and execution of the rule chain is carried out to perform business processing, so that it can be decoupled from the core module of the main business process, which is conducive to later expansion and maintenance, and greatly reduces learning costs. and development costs, greatly improving agile development capabilities, shortening the entire software development cycle and demand response time, thereby reducing software development costs and generating greater economic value, thereby solving problems in related technologies that are difficult to maintain and expand, and affect business owners. problem of process management.

作为一种可选实施例,根据实体类对象调用对应的目标业务规则处理业务逻辑包括:As an optional embodiment, invoking the corresponding target business rule to process business logic according to the entity class object includes:

根据预设优先级对实体类对象进行排列,得到排列结果;Arrange the entity class objects according to the preset priority to get the arrangement result;

按照排列结果调用对应的目标业务规则,处理业务逻辑。Invoke the corresponding target business rules according to the arrangement results to process the business logic.

可选地,由于匹配得到的目标业务规则可能存在多个的情况,那对应生成的实体类对象也将是多个,所以本申请实施例可以根据当前场景预先设定好的优先级对多个实体类对象进行排列拼接,生成责任链,根据责任链中多个实体类对象的排列结果依次调用对应的目标业务规则,处理业务逻辑。Optionally, since there may be multiple target business rules obtained through matching, there will be multiple corresponding generated entity class objects. Therefore, this embodiment of the application can classify multiple The entity class objects are arranged and spliced to generate a chain of responsibility, and the corresponding target business rules are called sequentially according to the arrangement results of multiple entity class objects in the responsibility chain to process business logic.

比如当前办理的业务场景是补卡办理,那在调用目标业务规则时首先进行逻辑执行的应该就是身份认证,所以身份认证这一目标业务规则对应的实体类对象将排列在最前面,然后在调度执行业务处理逻辑时,也是先执行调度身份认证实体类对象。For example, if the current business scenario is card replacement, identity authentication should be the first logical execution when invoking the target business rule, so the entity class object corresponding to the target business rule of identity authentication will be arranged at the front, and then in the scheduling When executing the business processing logic, it is also the first to execute the scheduling identity authentication entity class object.

在本申请实施例中,责任链模式使得每个目标业务规则都做单一的事,规则与规则之间的代码也是完全解耦,做到互不影响。In the embodiment of this application, the chain of responsibility mode enables each target business rule to do a single thing, and the codes between rules are also completely decoupled so that they do not affect each other.

作为一种可选实施例,获取报文信息包括:As an optional embodiment, obtaining message information includes:

根据页面指示信息,确定策略配置信息,其中,策略配置信息包括业务事件信息和业务状态信息;Determine policy configuration information according to the page indication information, wherein the policy configuration information includes business event information and business status information;

根据策略配置信息,修改由策略配置信息生成的报文信息,使得修改后的报文信息与策略配置信息相匹配;According to the policy configuration information, modify the message information generated by the policy configuration information, so that the modified message information matches the policy configuration information;

获取修改后的报文信息。Obtain the modified packet information.

可选地,可以根据事件发生的业务事件信息和业务状态信息,支持业务动作、业务来源、业务对象类型、业务对象类型ID等多维策略,生成策略配置信息。Optionally, according to the business event information and business status information of event occurrence, multi-dimensional policies such as business action, business source, business object type, and business object type ID can be supported to generate policy configuration information.

在确定页面被触发后,如果生成的策略配置信息与当前生成的报文信息不相匹配,可以根据java的引用传值方式,更改应用的核心对象结构,修改由策略配置信息生成的报文信息,使得修改后的报文信息与策略配置信息相匹配,进而前端将修改后的报文信息发送至后台服务器。After confirming that the page is triggered, if the generated policy configuration information does not match the currently generated message information, you can change the core object structure of the application and modify the message information generated by the policy configuration information according to the java reference value passing method , so that the modified packet information matches the policy configuration information, and then the front end sends the modified packet information to the background server.

本申请实施例采用引用传值方式,修改应用的核心对象结构,以达到灵活多变的目的。The embodiment of the present application adopts the method of passing by value by reference, and modifies the core object structure of the application to achieve the goal of flexibility.

作为一种可选实施例,方法还包括:As an optional embodiment, the method also includes:

修改策略配置信息,使得目标业务规则完成线上更新或线下更新,实现动态规则引擎。Modify the policy configuration information so that the target business rules can be updated online or offline to implement a dynamic rule engine.

可选地,在得到当下的策略配置信息后,还可以对策略配置动态更新,使得目标业务规则完成线上更新或线下更新,实现动态规则引擎。Optionally, after obtaining the current policy configuration information, the policy configuration can also be dynamically updated, so that the target business rules can be updated online or offline to realize a dynamic rule engine.

作为一种可选实施例,目标业务规则所属的规则类型包括:静态定义规则类型、动态编译规则类型、远程调用规则类型、数据库存储规则类型,根据业务事件信息和业务状态信息匹配到多个目标业务规则包括:As an optional embodiment, the rule types to which the target business rules belong include: statically defined rule types, dynamic compilation rule types, remote call rule types, and database storage rule types, matching multiple targets according to business event information and business status information Business rules include:

从静态定义规则类型、动态编译规则类型、远程调用规则类型、数据库存储规则类型中选取任意一种规则类型作为选取目标业务规则的规则库;Select any rule type from statically defined rule types, dynamic compilation rule types, remote call rule types, and database storage rule types as the rule base for selecting target business rules;

从规则库中匹配出多个目标业务规则。Multiple target business rules are matched from the rule base.

可选地,目标业务规则均为java规则,其所属的规则类型包括但不限于:静态定义规则类型、动态编译规则类型、远程调用规则类型、数据库存储规则类型,这4类作为规则库,然后从这4类规则库中选取任意一种作为选取目标业务规则的规则库,得到多个目标业务规则。Optionally, the target business rules are all java rules, and their rule types include but are not limited to: statically defined rule types, dynamic compilation rule types, remote call rule types, and database storage rule types. These four types are used as rule bases, and then Select any one of these four types of rule bases as a rule base for selecting target business rules, and obtain multiple target business rules.

静态定义规则类型:继承规则引擎定义好的通用标准java接口用户按具体业务实现逻辑处理。静态java规则跟应用代码一样事先编译,随应用启动调用。Statically defined rule type: Inherit the general standard java interface defined by the rule engine, and the user implements logic processing according to the specific business. Static java rules are compiled in advance like application code, and invoked with application startup.

动态编译规则类型:继承标准动态java抽象类代码内容写在数据库字段中,由规则运行模块实时加载、编译和执行。动态java类只需一次编译即可,实现热部署和可插拔。Dynamic compilation rule type: Inherit the standard dynamic java abstract class. The code content is written in the database field, and is loaded, compiled and executed by the rule running module in real time. Dynamic java classes only need to be compiled once to achieve hot deployment and pluggability.

远程调用规则类型:继承外部java抽象类的外部java文件编译后可放在指定的远程服务器目录中,供应用服务远程调用,有效的跟应用隔离,实现业务规则热部署、可插拔。Remote call rule type: The external java file inherited from the external java abstract class can be compiled and placed in the specified remote server directory for remote call of the application service, effectively isolated from the application, and realizes hot deployment and pluggability of business rules.

数据库存储规则类型:在数据库中已存储有多种规则信息,可直接根据已存储的多种规则信息,查找是否有符合条件的候选规则信息作为参数加入匹配过程中,以提供丰富的参数供规则使用,实现规则的热部署、可插拔以及不需要开发人员参与的敏捷开发。Database storage rule type: A variety of rule information has been stored in the database, and you can directly find out whether there is qualified candidate rule information as a parameter in the matching process based on the stored various rule information, so as to provide rich parameters for the rule Use to implement hot deployment of rules, pluggability, and agile development that does not require developers to participate.

上述4类规则库之间实现热部署、可插拔的机制可参见图2所示。The hot deployment and pluggable mechanism among the above four types of rule bases can be seen in Figure 2.

作为一种可选实施例,如图3所示,图3是根据本申请实施例的一种可选的规则调度的整体流程示意图,具体步骤流程如下:As an optional embodiment, as shown in FIG. 3, FIG. 3 is a schematic diagram of an overall process flow of an optional rule scheduling according to an embodiment of the present application, and the specific steps are as follows:

首先定义规则触发器嵌入应用的触点;规则调用中心根据多维策略,生成策略配置信息,将策略配置信息设置在数据库内,通过修改配置支持业务规则的动态上下线;再动态加载规则库实现规则实例化,并根据优先级拼接形成动态规则链,包含java规则1,java规则2等,基于动态规则链执行具体业务逻辑。First, define the contact point where the rule trigger is embedded in the application; the rule call center generates policy configuration information according to the multi-dimensional strategy, sets the policy configuration information in the database, and supports dynamic online and offline business rules by modifying the configuration; then dynamically loads the rule library to implement the rules Instantiate and splicing according to the priority to form a dynamic rule chain, including java rule 1, java rule 2, etc., and execute specific business logic based on the dynamic rule chain.

以物联网CRM(Customer Relationship Management,客户关系管理)项目订单业务为例,CRM项目订单,每月版本上线时需要更新业务规则。现在需要满足运营人员根据业务情况修改规则,审批通过后,可实时的更新到系统中,不必等待版本的更新而更新规则。Take the Internet of Things CRM (Customer Relationship Management, Customer Relationship Management) project order business as an example. For CRM project orders, business rules need to be updated when the monthly version is launched. Now it is necessary for the operator to modify the rules according to the business situation. After the approval, it can be updated to the system in real time, and the rules can be updated without waiting for the version update.

1.提前在触发点做好嵌入式埋点;1. Make embedded embedded points at the trigger point in advance;

2.开发人员使用四种规则组件类中的一种,完成规则组件的编写,规则逻辑对业务数据进行修改(此时还不会触发执行),实现规则代码热部署、可插拔;2. The developer uses one of the four rule component classes to complete the writing of the rule component, and the rule logic modifies the business data (the execution will not be triggered at this time), so as to realize the hot deployment and pluggability of the rule code;

3.通过业务方审核后,运维人员可以配置规则引擎决策表,使规则上下线,实现数据处理逻辑的修改,完成规则更新。3. After passing the audit by the business side, the operation and maintenance personnel can configure the rule engine decision table, make the rules go offline, realize the modification of data processing logic, and complete the rule update.

需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Depending on the application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions and modules involved are not necessarily required by this application.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM(Read-Only Memory,只读存储器)/RAM(Random Access Memory,随机存取存储器)、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in other words, the part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM (Read-Only Memory, Read-only memory)/RAM (Random Access Memory, random access memory), magnetic disk, optical disk), including several instructions to make a terminal device (which can be a mobile phone, computer, server, or network device, etc.) execute this Applies the method of each embodiment.

根据本申请实施例的另一个方面,还提供了一种用于实施上述动态规则引擎的实现方法的动态规则引擎的实现装置。图4是根据本申请实施例的一种可选的动态规则引擎的实现装置的结构框图,如图4所示,该装置可以包括:According to another aspect of the embodiments of the present application, a device for implementing a dynamic rule engine for implementing the above method for implementing a dynamic rule engine is also provided. Fig. 4 is a structural block diagram of an optional device for implementing a dynamic rule engine according to an embodiment of the present application. As shown in Fig. 4, the device may include:

获取模块401,用于在接收到页面指示信息的情况下,获取报文信息,其中,报文信息中携带有当前业务数据的业务事件信息和业务状态信息,指示信息用于指示页面被执行了触发操作;The acquiring module 401 is configured to acquire message information when page indication information is received, wherein the message information carries business event information and business status information of current business data, and the indication information is used to indicate that the page has been executed trigger action;

匹配模块402,用于根据业务事件信息和业务状态信息匹配到多个目标业务规则;A matching module 402, configured to match multiple target business rules according to business event information and business status information;

构建模块403,用于利用目标机制构建目标业务规则的实体类对象;A construction module 403, configured to use the target mechanism to construct the entity class object of the target business rule;

处理模块404,用于根据实体类对象调用对应的目标业务规则处理业务逻辑。The processing module 404 is configured to invoke corresponding target business rules to process business logic according to the entity class object.

需要说明的是,该实施例中的获取模块401可以用于执行上述步骤S101,该实施例中的匹配模块402可以用于执行上述步骤S102,该实施例中的构建模块403可以用于执行上述步骤S103,该实施例中的处理模块404可以用于执行上述步骤S104。It should be noted that the acquisition module 401 in this embodiment can be used to perform the above step S101, the matching module 402 in this embodiment can be used to perform the above step S102, and the construction module 403 in this embodiment can be used to perform the above In step S103, the processing module 404 in this embodiment may be used to execute the above step S104.

通过上述模块,将业务规则从应用程序代码中分离出来,在接收到页面指示信息后获取报文信息,选取与当前业务数据相对应的目标业务规则,然后利用目标机制构建目标业务规则的实体类对象,拼接生成规则责任链,进而进行规则链的调度执行,进行业务处理,这样就可以做到与业务主流程的核心模块解耦,有利于后期的扩展和维护,且大幅度降低学习成本和开发成本,极大提升敏捷开发能力,缩短了整个软件开发周期和需求响应时间,从而降低软件开发成本,产生较大的经济价值,进而解决了相关技术中存在的难以维护扩展、影响业务主流程管理的问题。Through the above modules, separate the business rules from the application code, obtain the message information after receiving the page instruction information, select the target business rules corresponding to the current business data, and then use the target mechanism to construct the entity class of the target business rules Objects are stitched together to generate a rule responsibility chain, and then the rule chain is scheduled and executed to perform business processing, so that it can be decoupled from the core module of the main business process, which is conducive to later expansion and maintenance, and greatly reduces learning costs and Development costs, greatly improving agile development capabilities, shortening the entire software development cycle and demand response time, thereby reducing software development costs and generating greater economic value, thereby solving the difficulties in related technologies that are difficult to maintain and expand, and affect the main business process management issues.

作为一种可选的实施例,处理模块包括:As an optional embodiment, the processing module includes:

排列单元,用于根据预设优先级对实体类对象进行排列,得到排列结果;The arrangement unit is used to arrange the entity class objects according to the preset priority to obtain the arrangement result;

处理单元,用于按照排列结果调用对应的目标业务规则,处理业务逻辑。The processing unit is used to invoke the corresponding target business rules according to the arrangement result, and process the business logic.

作为一种可选的实施例,该装置还包括:As an optional embodiment, the device also includes:

嵌入模块,用于在接收到页面指示信息之前,在页面的应用触发点处嵌入埋点信息;An embedding module, configured to embed buried point information at the application trigger point of the page before receiving the page indication information;

确定模块,用于利用埋点信息确定页面是否被执行了触发操作。The determination module is configured to determine whether the trigger operation is performed on the page by using the buried point information.

作为一种可选的实施例,获取模块包括:As an optional embodiment, the acquisition module includes:

确定单元,用于根据页面指示信息,确定策略配置信息,其中,策略配置信息包括业务事件信息和业务状态信息;A determining unit, configured to determine policy configuration information according to the page indication information, wherein the policy configuration information includes business event information and business status information;

修改单元,用于根据策略配置信息,修改由策略配置信息生成的报文信息,使得修改后的报文信息与策略配置信息相匹配;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;

获取单元,用于获取修改后的报文信息。The acquiring unit is configured to acquire the modified message information.

作为一种可选的实施例,该装置还包括:As an optional embodiment, the device also includes:

修改模块,用于修改策略配置信息,使得目标业务规则完成线上更新或线下更新,实现动态规则引擎。The modification module is used to modify the policy configuration information, so that the target business rules can be updated online or offline, and a dynamic rule engine can be realized.

作为一种可选的实施例,目标业务规则所属的规则类型包括:静态定义规则类型、动态编译规则类型、远程调用规则类型、数据库存储规则类型,匹配模块包括:As an optional embodiment, the rule types to which the target business rules belong include: statically defined rule types, dynamic compilation rule types, remote call rule types, and database storage rule types, and the matching module includes:

选取单元,用于从静态定义规则类型、动态编译规则类型、远程调用规则类型、数据库存储规则类型中选取任意一种规则类型作为选取目标业务规则的规则库;The selecting unit is used to select any rule type from statically defined rule types, dynamic compilation rule types, remote call rule types, and database storage rule types as a rule base for selecting target business rules;

匹配单元,用于从规则库中匹配出多个目标业务规则。The matching unit is used to match multiple target business rules from the rule base.

此处需要说明的是,上述模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例所公开的内容。It should be noted here that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments.

根据本申请实施例的又一个方面,还提供了一种用于实施上述动态规则引擎的实现方法的电子设备,该电子设备可以是服务器、终端、或者其组合。According to yet another aspect of the embodiments of the present application, there is also provided an electronic device for implementing the method for implementing the dynamic rule engine above, where the electronic device may be a server, a terminal, or a combination thereof.

图5是根据本申请实施例的一种可选的电子设备的结构框图,如图5所示,包括处理器501、通信接口502、存储器503和通信总线504,其中,处理器501、通信接口502和存储器503通过通信总线504完成相互间的通信,其中,Fig. 5 is a structural block diagram of an optional electronic device according to the embodiment of the present application, as shown in Fig. 502 and memory 503 complete mutual communication through communication bus 504, wherein,

存储器503,用于存储计算机程序;memory 503, for storing computer programs;

处理器501,用于执行存储器503上所存放的计算机程序时,实现如下步骤:When the processor 501 is used to execute the computer program stored on the memory 503, the following steps are implemented:

在接收到页面指示信息的情况下,获取报文信息,其中,报文信息中携带有当前业务数据的业务事件信息和业务状态信息,指示信息用于指示页面被执行了触发操作;In the case of receiving the page indication information, obtain message information, wherein 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;

根据业务事件信息和业务状态信息匹配到多个目标业务规则;Match multiple target business rules based on business event information and business status information;

利用目标机制构建目标业务规则的实体类对象;Use the target mechanism to construct the entity class object of the target business rule;

根据实体类对象调用对应的目标业务规则处理业务逻辑。Call the corresponding target business rule to process business logic according to the entity class object.

可选地,在本实施例中,上述的通信总线可以是PCI(Peripheral ComponentInterconnect,外设部件互连标准)总线、或EISA(Extended Industry StandardArchitecture,扩展工业标准结构)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图5中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。Optionally, in this embodiment, the aforementioned communication bus may be a PCI (Peripheral Component Interconnect, Peripheral Component Interconnect Standard) bus, or an EISA (Extended Industry Standard Architecture, Extended Industry Standard Architecture) bus, or the like. The communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in FIG. 5 , but it does not mean that there is only one bus or one type of bus.

通信接口用于上述电子设备与其他设备之间的通信。The communication interface is used for communication between the electronic device and other devices.

存储器可以包括RAM,也可以包括非易失性存储器(non-volatile memory),例如,至少一个磁盘存储器。可选地,存储器还可以是至少一个位于远离前述处理器的存储装置。The memory may include RAM, and may also include non-volatile memory (non-volatile memory), for example, at least one magnetic disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

作为一种示例,如图5所示,上述存储器503中可以但不限于包括上述动态规则引擎的实现装置中的获取模块401、匹配模块402、构建模块403、处理模块404。此外,还可以包括但不限于上述动态规则引擎的实现装置中的其他模块单元,本示例中不再赘述。As an example, as shown in FIG. 5 , the memory 503 may include, but is not limited to, the acquisition module 401 , the matching module 402 , the construction module 403 , and the processing module 404 in the implementation device of the dynamic rule engine. In addition, it may also include but not limited to other module units in the above-mentioned dynamic rule engine implementation device, which will not be repeated in this example.

上述处理器可以是通用处理器,可以包含但不限于:CPU(Central ProcessingUnit,中央处理器)、NP(Network Processor,网络处理器)等;还可以是DSP(DigitalSignal Processing,数字信号处理器)、ASIC(Application Specific IntegratedCircuit,专用集成电路)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。Above-mentioned processor can be general-purpose processor, can include but not limited to: CPU (Central Processing Unit, central processing unit), NP (Network Processor, network processor) etc.; Can also be DSP (DigitalSignal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit, Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array, Field Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

此外,上述电子设备还包括:显示器,用于显示动态规则引擎的实现结果。In addition, the above-mentioned electronic device further includes: a display for displaying the realization result of the dynamic rule engine.

可选地,本实施例中的具体示例可以参考上述实施例中所描述的示例,本实施例在此不再赘述。Optionally, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments, and details are not repeated in this embodiment.

本领域普通技术人员可以理解,图5所示的结构仅为示意,实施上述动态规则引擎的实现方法的设备可以是终端设备,该终端设备可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图5其并不对上述电子设备的结构造成限定。例如,终端设备还可包括比图5中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图5所示的不同的配置。Those of ordinary skill in the art can understand that the structure shown in Figure 5 is only for illustration, and the device that implements the method for implementing the above-mentioned dynamic rule engine can be a terminal device, and the terminal device can be a smart phone (such as an Android phone, an iOS phone, etc.), Tablet PCs, PDAs, and mobile Internet devices (Mobile Internet Devices, MID), PAD and other terminal equipment. FIG. 5 does not limit the structure of the above-mentioned electronic equipment. For example, the terminal device may also include more or less components than those shown in FIG. 5 (such as a network interface, a display device, etc.), or have a different configuration from that shown in FIG. 5 .

本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、ROM、RAM、磁盘或光盘等。Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can be Including: flash disk, ROM, RAM, magnetic disk or optical disk, etc.

根据本申请实施例的又一个方面,还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于执行动态规则引擎的实现方法的程序代码。According to still another aspect of the embodiments of the present application, a storage medium is also provided. Optionally, in this embodiment, the foregoing storage medium may be used to execute the program code of the method for implementing the dynamic rule engine.

可选地,在本实施例中,上述存储介质可以位于上述实施例所示的网络中的多个网络设备中的至少一个网络设备上。Optionally, in this embodiment, the foregoing storage medium may be located on at least one network device among the plurality of network devices in the network shown in the foregoing embodiments.

可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:Optionally, in this embodiment, the storage medium is configured to store program codes for performing the following steps:

在接收到页面指示信息的情况下,获取报文信息,其中,报文信息中携带有当前业务数据的业务事件信息和业务状态信息,指示信息用于指示页面被执行了触发操作;In the case of receiving the page indication information, obtain message information, wherein 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;

根据业务事件信息和业务状态信息匹配到多个目标业务规则;Match multiple target business rules based on business event information and business status information;

利用目标机制构建目标业务规则的实体类对象;Use the target mechanism to construct the entity class object of the target business rule;

根据实体类对象调用对应的目标业务规则处理业务逻辑。Call the corresponding target business rule to process business logic according to the entity class object.

可选地,本实施例中的具体示例可以参考上述实施例中所描述的示例,本实施例中对此不再赘述。Optionally, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments, which will not be repeated in this embodiment.

可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、ROM、RAM、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the above-mentioned storage medium may include, but not limited to, various media capable of storing program codes such as a U disk, ROM, RAM, removable hard disk, magnetic disk, or optical disk.

根据本申请实施例的又一个方面,还提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中;计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述任一个实施例中的动态规则引擎的实现方法步骤。According to yet another aspect of the embodiments of the present application, a computer program product or computer program is also provided, the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; the processor of the computer device The computer instruction is read from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the implementation method steps of the dynamic rule engine in any one of the above embodiments.

上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.

上述实施例中的集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在上述计算机可读取的存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在存储介质中,包括若干指令用以使得一台或多台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例动态规则引擎的实现方法的全部或部分步骤。If the integrated units in the above embodiments are realized in the form of software function units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium. Several instructions are included to enable 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 methods of the dynamic rule engine in various embodiments of the present application.

在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present application, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.

在本申请所提供的几个实施例中,应该理解到,所揭露的客户端,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. Wherein, the device embodiments described above are only illustrative, such as the division of units, which is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into Another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of units or modules may be in electrical or other forms.

作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例中所提供的方案的目的。A unit described as a separate component may or may not be physically separated, and a component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above description is only the preferred embodiment of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present application, some improvements and modifications can also be made. These improvements and modifications are also It should be regarded as the protection scope of this 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 (5)

* 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 device and storage medium
CN116301803A (en) * 2023-02-24 2023-06-23 深圳兔展智能科技有限公司 Output method, device, equipment and medium of product data
CN116521219A (en) * 2023-05-09 2023-08-01 中设数字技术有限公司 Visual configuration method and system based on rule engine
CN116975239A (en) * 2023-08-17 2023-10-31 网易(杭州)网络有限公司 Methods, devices and server equipment for processing question and answer data in games
CN117278620A (en) * 2023-09-21 2023-12-22 中科驭数(北京)科技有限公司 Configuration method and system of data plane forwarding rule of DPU

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003005167A2 (en) * 2001-07-06 2003-01-16 Computer Associates Think, Inc. Business process policy object
CN109542935A (en) * 2018-10-11 2019-03-29 平安科技(深圳)有限公司 A kind of execution method, storage medium and the server of regulation engine
CN114237602A (en) * 2021-12-21 2022-03-25 中国建设银行股份有限公司 Rule engine construction method, device, equipment and computer storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003005167A2 (en) * 2001-07-06 2003-01-16 Computer Associates Think, Inc. Business process policy object
CN109542935A (en) * 2018-10-11 2019-03-29 平安科技(深圳)有限公司 A kind of execution method, storage medium and the server of regulation engine
CN114237602A (en) * 2021-12-21 2022-03-25 中国建设银行股份有限公司 Rule engine construction method, device, equipment and computer storage medium

Cited By (6)

* 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 device and storage medium
CN115774707B (en) * 2023-02-15 2023-05-12 广州汇通国信科技有限公司 Object attribute-based data processing method and device, electronic equipment and storage medium
CN116301803A (en) * 2023-02-24 2023-06-23 深圳兔展智能科技有限公司 Output method, device, equipment and medium of product data
CN116521219A (en) * 2023-05-09 2023-08-01 中设数字技术有限公司 Visual configuration method and system based on rule engine
CN116975239A (en) * 2023-08-17 2023-10-31 网易(杭州)网络有限公司 Methods, devices and server equipment for processing question and answer data in games
CN117278620A (en) * 2023-09-21 2023-12-22 中科驭数(北京)科技有限公司 Configuration method and system of data plane forwarding rule of DPU

Similar Documents

Publication Publication Date Title
CN112000348B (en) Control method, device and computer equipment for service gray level release
US20230106675A1 (en) Api driven continuous testing systems for testing disparate software
CN115469833A (en) Method and device for implementing dynamic rule engine, electronic equipment and storage medium
US11093232B2 (en) Microservice update system
CN108319460B (en) Method and device for generating application program installation package, electronic equipment and storage medium
CN111694638B (en) Rule package loading method, rule package executing method and terminal equipment
CN110113391B (en) Client online method and device and client operation method and device
CN108829588A (en) A kind of processing method of test application program, deployment system and device
CN113778878A (en) Interface testing method and device, electronic equipment and storage medium
WO2020211360A1 (en) Mock test method and system, electronic device, and computer non-volatile readable storage medium
CN114816493B (en) Grayscale upgrade method and device for blockchain service platform, and electronic equipment
CN114356346A (en) Application program deployment method, device, storage medium and electronic equipment
CN113326052A (en) Method and device for upgrading service component, computer equipment and storage medium
CN108132832B (en) Application program starting method and device
US11347533B2 (en) Enhanced virtual machine image management system
CN113032004A (en) Method, apparatus and program product for managing development jobs in a development environment
CN110580624B (en) Chain code upgrading method and device
CN114780123B (en) Grayscale upgrade method and device for smart contracts in blockchain, and electronic equipment
CN117931467A (en) Multi-terminal request processing method, device, server and readable storage medium
US10176062B2 (en) Cloud servers and methods for handling dysfunctional cloud services
WO2023151397A1 (en) Application program deployment method and apparatus, device, and medium
CN115599546A (en) Service orchestration management method, device, electronic device and readable storage medium
CN115033251A (en) Software deployment method and device, electronic equipment and storage medium
CN114936152A (en) Application testing method and device
CN112181802A (en) Test method and device

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