Rule processing method and device, equipment and medium

Through the imaged rule configuration interface and reflection technology, the problem of difficulty in rules editing and deployment in the existing rule engine technology is solved, and the real-time dynamic effect of rules and the readability improvement of the rules is achieved.

CN118963904AInactive Publication Date: 2024-11-15TAIPING FINANCIAL SERVICE CENT (SHANGHAI) CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411441740.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2024-11-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing rule engine technology is difficult in terms of rule editing, logic conversion and deployment, especially the rule logic cannot be converted into Chinese, which makes it difficult for business personnel to understand and cannot take effect dynamically in real time.

Method used

Provide a rule processing method, which can obtain the tree structure rule configuration content through the imaged rule configuration interface, generate Chinese rule descriptions, and dynamically load the rules using reflection technology to avoid restarting the project, so that the configuration can take effect.

Benefits of technology

It reduces the difficulty of rule configuration and deployment, improves the readability of rules, enables business personnel to intuitively understand the content of rules, and achieves real-time dynamic effectiveness of rules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963904A_ABST
    Figure CN118963904A_ABST
Patent Text Reader

Abstract

The invention discloses a rule processing method and device, equipment and a medium. The method comprises the following steps: acquiring configuration content of a user on a tree structure rule in a graphical rule configuration interface at a front end; generating a Chinese rule description of the tree structure rule according to Chinese corresponding to the configuration content; determining whether a rule checking object passes through the tree structure rule or not through reflection; and if the rule check object does not pass through the tree structure rule, displaying a failure reason and a Chinese rule description of the tree structure rule. According to the embodiment of the invention, the configuration and deployment difficulty of the rule can be reduced, and the readability of the rule is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of rule processing, and in particular to a rule processing method, device, equipment and medium. Background Art

[0002] As business models evolve, business systems process content from simple to complex, and a large amount of judgment logic makes the system difficult to maintain. In order to separate rule judgment from business logic, the system generally has to go through three stages: extracting judgment methods at the code level, recording judgment rules in the database, and managing business rules in the rule engine. The first two are compromises for acceptable business complexity, and the latter is the ultimate solution after business complexity increases.

[0003] For the third stage, the rule engine technology that is currently widely used has the following problems: first, the editing of rules relies on specific syntax and requires the project to be redeployed to take effect; second, the rule logic cannot be converted into Chinese content, which is not easy for business personnel to understand; third, the rule must be redeployed in the project for it to take effect, and cannot take effect in real time and dynamically. Summary of the invention

[0004] The present invention provides a rule processing method, apparatus, device and medium to reduce the difficulty of configuring and deploying rules and improve the readability of rules.

[0005] According to one aspect of the present invention, a rule processing method is provided, comprising:

[0006] Obtain the configuration content of the tree structure rules in the graphical rule configuration interface on the front end;

[0007] Generate a Chinese rule description of the tree structure rule according to the Chinese corresponding to the configuration content;

[0008] Checking whether the object passes the tree structure rule by the reflection determination rule;

[0009] If the rule check object fails to pass the tree structure rule, the reason for failure and the Chinese rule description of the tree structure rule are displayed.

[0010] According to another aspect of the present invention, there is provided a rule processing device, comprising:

[0011] A language conversion unit, used to determine the Chinese language corresponding to the configuration content according to the rule object information and the preset Chinese conversion rule;

[0012] A language assembly unit, used to determine the Chinese description of the node relationship of the relationship node in the tree structure rule and the Chinese description of the rule content of the rule node according to the Chinese corresponding to the configuration content;

[0013] The description generating unit is used to generate the Chinese rule description of the tree structure rule according to the Chinese description of the node relationship of the relationship node and the Chinese description of the rule content of the rule node through a recursive method.

[0014] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the rule processing method according to any embodiment of the present invention.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the rule processing method described in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the rule processing method described in any embodiment of the present invention when executed.

[0020] The embodiment of the present invention provides a graphical rule configuration interface to the front end, which eliminates the need for rule configuration personnel to master complex programming syntax, thereby reducing the difficulty of rule configuration; dynamically loads rules through reflection technology, and visually configures and takes effect without restarting the project, thereby reducing the difficulty of rule deployment; displays Chinese rule descriptions to business personnel, allowing them to intuitively understand the rule content, thereby improving the readability of the rules.

[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1Ais a flow chart of a rule processing method provided according to an embodiment of the present invention;

[0024] Figure 1B is a schematic diagram of a graphical rule configuration interface provided according to an embodiment of the present invention;

[0025] Figure 2A is a flow chart of a rule processing method provided according to another embodiment of the present invention;

[0026] Figure 2B This is a schematic diagram of front-end and back-end interaction data provided according to an embodiment of the present invention;

[0027] Figure 3 is a structural schematic diagram of a rule processing method provided according to another embodiment of the present invention;

[0028] Figure 4 It is a schematic diagram of the structure of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] Figure 1AThis is a flow chart of a rule processing method provided by an embodiment of the present invention. This embodiment is applicable to the case where a rule configuration personnel configures a rule in a graphical rule configuration interface at the front end, and the back end saves and starts the rule. The method can be executed by a rule processing device, which can be implemented in the form of hardware and / or software. The device can be configured in an electronic device with corresponding data processing capabilities, such as a back end server. Figure 1A As shown, the method includes:

[0032] S110, obtaining the configuration content of the tree structure rule in the graphical rule configuration interface by the user at the front end.

[0033] S120: Generate a Chinese rule description of the tree structure rule according to the Chinese corresponding to the configuration content.

[0034] The configuration content may include variable encoding, matching value, matching method, node relationship, node type, negation flag, rule classification information, etc. The graphical rule configuration interface at the front end is used to configure and adjust the rules.

[0035] Specifically, a rule DTO object is predefined, and the object only has attributes and GET and SET methods.

[0036] Predefine the attribute annotations of the rule objects and annotate them on the rule DTO object attributes to indicate the Chinese description of the attributes. In the storage table of the database, set the parent node ID field to maintain the node relationship as a tree structure. When the project is initialized, the backend obtains all rule object Classes through reflection, reads all attribute types, annotation values, and attribute values ​​of the class, caches them as a rule object information list, and provides the cached rule object information in the cached object information list to the front end in the form of an interface. The front end provides a graphical rule configuration interface. With the help of the graphical rule configuration interface and rule object information, the rule configuration personnel configure the tree structure relationship of the nodes in the tree structure rules (add, delete, modify, and query). For example Figure 1B As shown in the figure, the user configures the node content in the tree structure rule. The front end will record the user's configuration content for each node in the tree structure rule and send these configuration contents to the back end.

[0037] All configuration contents other than numerical values ​​that are not in natural language form are converted into Chinese expressions according to the pre-set conversion logic, and these Chinese expressions are assembled according to the node relationship and node content of the tree structure rule to obtain the Chinese rule description of the tree structure rule. The tree structure rule and its Chinese rule description are associated and saved in the database for subsequent use.

[0038] S130 , checking whether the object passes the tree structure rule through reflection determination rule.

[0039] S140. If the rule check object fails to pass the tree structure rule, the reason for failure and the Chinese rule description of the tree structure rule are displayed.

[0040] Among them, the rule checking object can be specific business data, such as the business data of an insurance application. In programming languages, reflection is a powerful mechanism that allows programs to check and operate classes, interfaces, fields, and methods at runtime. Through reflection, programs can dynamically obtain class information, call class methods, access or modify class fields, etc., without having to determine the names and types of these elements at compile time. Through reflection, back-end programs can dynamically load and use rules at runtime. For example, reflection can be used to dynamically load different rule classes and execute these rules without having to determine which rules to use at compile time. Through reflection, back-end programs can dynamically adjust the behavior of rules. For example, reflection can be used to obtain and modify methods, fields, or annotations in rule classes to change the behavior of rules.

[0041] Specifically, when the project is running, the rule check object and the tree structure rule pre-stored in the database are obtained respectively. The attribute value of the rule check object is obtained through reflection, and the attribute value is compared with the rule content of the tree structure rule to determine whether the rule check object passes the tree structure rule.

[0042] If the rule check object passes the tree structure rule, the subsequent business process continues. If the rule check object does not pass the tree structure rule, the failure reason is generated according to the specific comparison result, and the Chinese rule description of the tree structure rule in the database is obtained, and the failure reason and the Chinese rule description of the tree structure rule are sent to the front end, and the front end displays both to the business personnel so that the business personnel can understand the specific situation.

[0043] The embodiment of the present invention provides a graphical rule configuration interface to the front end, which eliminates the need for rule configuration personnel to master complex programming syntax, thereby reducing the difficulty of rule configuration; dynamically loads rules through reflection technology, and visually configures and takes effect without restarting the project, thereby reducing the difficulty of rule deployment; displays Chinese rule descriptions to business personnel, allowing them to intuitively understand the rule content, thereby improving the readability of the rules.

[0044] Optionally, after generating the Chinese rule description of the tree structure rule according to the Chinese corresponding to the configuration content, the method further includes:

[0045] The Chinese rule description is sent to the front end to instruct the front end to display the Chinese rule description in the graphical rule configuration interface.

[0046] Specifically, while storing the Chinese rule description in the database, the backend also sends the Chinese rule description to the front end. The front end displays the received Chinese rule description in the graphical rule configuration interface so that the rule configurator can understand whether the rules they configured are incorrect.

[0047] Figure 2A As shown in the flowchart of a rule processing method provided by another embodiment of the present invention, this embodiment is optimized and improved on the basis of the above embodiment. As Figure 2A shown, the method includes:

[0048] S210. Obtain the configuration content of the tree - structured rules in the graphical rule configuration interface by the user at the front end.

[0049] S220. Determine the Chinese corresponding to the configuration content according to the rule object information and the preset Chinese conversion rules; according to the Chinese corresponding to the configuration content, determine the Chinese description of the node relationship of the relationship nodes and the Chinese description of the rule content of the rule nodes in the tree - structured rules.

[0050] S230. Generate the Chinese rule description of the tree - structured rules by a recursive method according to the Chinese description of the node relationship of the relationship nodes and the Chinese description of the rule content of the rule nodes.

[0051] Among them, the configuration content of the relationship nodes includes node type, node relationship, and negation flag; the configuration content of the rule nodes includes variable code, matching method, matching value, node type, and negation flag. For variable code and matching value, the rule configurator can choose to enter a fixed value, string, boolean value; or can choose the attribute code of the rule object. The relationship nodes include AND (and), OR (or) nodes, and the rule nodes include greater than (>), greater than or equal to (>=), less than (<), less than or equal to (<=), equal to (=), contains (in) nodes

[0052] Specifically, as Figure 2B shown, based on the preset Chinese conversion rules, determine the Chinese corresponding to some of the configuration content. For example, the Chinese corresponding to the matching method "≥" is "greater than or equal to". For the remaining configuration content, the Chinese it is converted to can be determined based on the rule object information. For example, the Chinese annotation of the variable code "policyFee" in the rule object is "premium". For the configuration content of pure numerical values, no processing is done.

[0053] For each relationship node, generate the Chinese description of the node relationship of the relationship node according to the Chinese corresponding to the node relationship configured by the user and the Chinese corresponding to the negation flag.

[0054] For each rule node, a Chinese description of the rule content of the relationship node is generated according to the Chinese corresponding to the variable code configured by the user, the Chinese corresponding to the matching method, the Chinese corresponding to the matching value, and the Chinese corresponding to the negated flag.

[0055] Finally, a recursive function is used to assemble the Chinese description of node relationships and the Chinese description of rule content in the order from parent nodes to child nodes to obtain the Chinese rule description of the tree structure rule.

[0056] For example, some Chinese conversion rules are as follows:

[0057] The node relationship "And" is converted to "and";

[0058] The node relationship "or" is converted to "or";

[0059] The matching mode “>” is converted to “greater than or equal to”;

[0060] The matching method "=" is converted to "equal to";

[0061] The match mode "in" is converted to "contains".

[0062] The following is an example of generating Chinese rule descriptions:

[0063] Tree structure rule: And [policyFee > 1000 , negated flag policyLimit <= 10000].

[0064] Relationship nodes of tree structure rules: and.

[0065] Rule node 1 of the tree structure rule: policyFee > 1000.

[0066] Rule node 2 of the tree structure rule: negate the flag policyLimit <= 10000.

[0067] policyFee and policyLimit are variable codes. The corresponding Chinese characters can be obtained by returning the "rule object" information from the backend, namely "premium" and "insurance amount".

[0068] Since the Chinese characters in the first-layer nodes are not processed, the Chinese rules recursively generated by the tree structure rules are described as follows:

[0069] The premium is greater than 1000 and the insured amount is less than or equal to 10000.

[0070] S240: For each rule node in the tree structure rule, determine the matching value and matching relationship of the variable encoding in the rule node; and obtain the attribute value of the variable encoding in the rule check object through reflection.

[0071] S250, determining the comparison result of the rule node according to the attribute value, the matching value and the matching relationship; through a recursive method, determining whether the rule check object passes the target tree structure rule according to the comparison result of each rule node in the tree structure rule, the node relationship of each relationship node and the negation mark of each node.

[0072] For details, please refer to Figure 2B , query the database rule data according to the tree structure, and obtain the configuration content of each node of the tree structure rule.

[0073] For rule nodes, the attribute values ​​of the variables in the rule nodes encoded in the rule check object are obtained through reflection. The obtained attribute values, pre-configured matching relationships and matching values ​​are reflected to determine the comparison results.

[0074] Finally, through a recursive method, taking into account the inverted flag of each node, according to the comparison results of each rule node in the tree structure rule and the node relationship of each relationship node, it is determined whether the rule check object passes the target tree structure rule.

[0075] Optionally, determining the comparison result of the rule node according to the attribute value, the matching value and the matching relationship includes:

[0076] If the attribute value and the matching value conform to the matching relationship, determining that the comparison result of the rule node is true;

[0077] If the attribute value and the matching value conform to the matching relationship, it is determined that the comparison result of the rule node is false.

[0078] Specifically, the matching value and the attribute value are compared to determine whether the two have a matching relationship. If the matching relationship is satisfied, when it indicates that the rule check object passes the current rule node, the comparison result is true. If the matching relationship is not satisfied, when it indicates that the rule check object does not pass the current rule node, the comparison result is false.

[0079] For example, the business prepares the rule check object in advance for rule checking:

[0080] RuleDTO{

[0081] policyFee=1200;

[0082] policyAmount = 9000;

[0083] }

[0084] Description of rule check execution method:

[0085] 1. Query database rule data according to the tree structure (briefly represented by the primary key): {1001:[{1002},{1003}]}.

[0086] 2. The first layer judges 1001, judging that it is a relationship node, and recursively judges the second layer 1002, 1003

[0087] 3. 1002 gets the variable code as policyFee, the matching value is 1000, and the value of the RuleDTO attribute policyFee is 1200 through reflection. It is judged that 1200>1000=true, and true is returned.

[0088] 4. 1003 gets the variable code as policyAmount, the matching value is 10000, and the value of the RuleDTO attribute policyAmount is 9000 through reflection. It is judged that !9000<=10000=false, and false is returned.

[0089] 5. Return to the first layer: judge: 1002 (true) && 1003 (false) = false, return false;

[0090] 6. If the rules are not met, intercept.

[0091] 7. Send the failure reason and Chinese rule description to the front end.

[0092] S260: If the rule check object fails the tree structure rule, the reason for failure and the Chinese rule description of the tree structure rule are displayed.

[0093] The embodiment of the present invention configures, saves and loads rules through a tree structure, thereby improving the processing efficiency of the rules.

[0094] Figure 3 A schematic diagram of a structure of a rule processing device provided by another embodiment of the present invention. Figure 3 As shown, the device comprises:

[0095] The configuration acquisition module 310 is used to acquire the configuration content of the tree structure rule in the graphical rule configuration interface by the user at the front end;

[0096] A description generating module 320, configured to generate a Chinese rule description of the tree structure rule according to the Chinese corresponding to the configuration content;

[0097] A rule checking module 330, used to determine whether a rule checking object passes the tree structure rule by reflection;

[0098] The description display module 340 is used to display the reason for failure and the Chinese rule description of the tree structure rule if the rule check object fails to pass the tree structure rule.

[0099] The rule processing device provided in the embodiment of the present invention can execute the rule processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0100] Optionally, the description generating module 320 includes:

[0101] A language conversion unit, used to determine the Chinese language corresponding to the configuration content according to the rule object information and the preset Chinese conversion rule;

[0102] A language assembly unit, used to determine the Chinese description of the node relationship of the relationship node in the tree structure rule and the Chinese description of the rule content of the rule node according to the Chinese corresponding to the configuration content;

[0103] The description generating unit is used to generate the Chinese rule description of the tree structure rule according to the Chinese description of the node relationship of the relationship node and the Chinese description of the rule content of the rule node through a recursive method.

[0104] Optionally, the configuration content of the relationship node includes node type, node relationship and negation flag; the configuration content of the rule node includes variable encoding, matching method, matching value, node type and negation flag.

[0105] Optionally, the rule checking module 330 includes:

[0106] A matching content determination unit, configured to determine, for each rule node in the tree structure rule, a matching value and a matching relationship of a variable encoding in the rule node;

[0107] An attribute value acquisition unit is used to acquire the attribute value of the variable encoding in the rule checking object through reflection;

[0108] A comparison result determination unit, configured to determine a comparison result of the rule node according to the attribute value, the matching value and the matching relationship;

[0109] The rule checking unit is used to determine whether the rule checking object passes the tree structure rule by a recursive method according to the comparison results of each rule node in the tree structure rule, the node relationship of each relationship node and the negation mark of each node.

[0110] Optionally, the comparison result determination unit is specifically used to: if the attribute value and the matching value conform to the matching relationship, determine that the comparison result of the rule node is true; if the attribute value and the matching value conform to the matching relationship, determine that the comparison result of the rule node is false.

[0111] Optionally, the device further comprises:

[0112] A description feedback module is used to send the Chinese rule description to the front end, and to instruct the front end to display the Chinese rule description in the graphical rule configuration interface.

[0113] The rule processing device further described can also execute the rule processing method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0114] Figure 4 A schematic diagram of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0115] like Figure 4 As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0116] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0117] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as a rule processing method.

[0118] In some embodiments, the rule processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the rule processing method described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to execute the rule processing method in any other appropriate manner (e.g., by means of firmware).

[0119] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0120] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0121] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0122] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0123] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0124] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0125] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0126] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A rule processing method, characterized in that: Applied to the backend, the method includes: Obtain the configuration content of the tree structure rules in the graphical rule configuration interface on the front end; Generate a Chinese rule description of the tree structure rule according to the Chinese corresponding to the configuration content; Checking whether the object passes the tree structure rule by the reflection determination rule; If the rule check object fails to pass the tree structure rule, the reason for failure and the Chinese rule description of the tree structure rule are displayed.

2. The method according to claim 1, characterized in that The Chinese rule description for generating the tree structure rule according to the Chinese corresponding to the configuration content includes: Determine the Chinese corresponding to the configuration content according to the rule object information and the preset Chinese conversion rules; Determine the Chinese description of the node relationship of the relationship node and the Chinese description of the rule content of the rule node in the tree structure rule according to the Chinese corresponding to the configuration content; The Chinese rule description of the tree structure rule is generated according to the Chinese description of the node relationship of the relationship node and the Chinese description of the rule content of the rule node through a recursive method.

3. The method according to claim 2, characterized in that The configuration content of the relationship node includes node type, node relationship and negation mark; the configuration content of the rule node includes variable encoding, matching mode, matching value, node type and negation mark.

4. The method according to claim 3, characterized in that The checking of whether the object passes the tree structure rule by the reflection determination rule comprises: For each rule node in the tree structure rule, determining a matching value and a matching relationship of a variable encoding in the rule node; Obtaining the attribute value of the variable encoding in the rule checking object through reflection; Determining a comparison result of the rule node according to the attribute value, the matching value and the matching relationship; By recursive method, it is determined whether the rule check object passes the tree structure rule according to the comparison results of each rule node in the tree structure rule, the node relationship of each relationship node and the negation mark of each node.

5. The method according to claim 4, characterized in that The determining the comparison result of the rule node according to the attribute value, the matching value and the matching relationship includes: If the attribute value and the matching value conform to the matching relationship, determining that the comparison result of the rule node is true; If the attribute value and the matching value conform to the matching relationship, it is determined that the comparison result of the rule node is false.

6. The method according to claim 1, characterized in that After generating the Chinese rule description of the tree structure rule according to the Chinese corresponding to the configuration content, the method further includes: The Chinese rule description is sent to the front end to instruct the front end to display the Chinese rule description in the graphical rule configuration interface.

7. A rule processing device, characterized in that: Deployed at the back end, the device includes: The configuration acquisition module is used to obtain the configuration content of the tree structure rules in the graphical rule configuration interface by the user on the front end; A description generation module, used to generate a Chinese rule description of the tree structure rule according to the Chinese corresponding to the configuration content; A rule checking module, used for determining whether a rule checking object passes the tree structure rule by reflection; The description display module is used to display the reason for failure and the Chinese rule description of the tree structure rule if the rule check object fails to pass the tree structure rule.

8. The device according to claim 7, characterized in that The description generation module comprises: A language conversion unit, used to determine the Chinese language corresponding to the configuration content according to the rule object information and the preset Chinese conversion rule; A language assembly unit, used to determine the Chinese description of the node relationship of the relationship node in the tree structure rule and the Chinese description of the rule content of the rule node according to the Chinese corresponding to the configuration content; The description generating unit is used to generate the Chinese rule description of the tree structure rule according to the Chinese description of the node relationship of the relationship node and the Chinese description of the rule content of the rule node through a recursive method.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the rule processing method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the rule processing method according to any one of claims 1 to 6 when the processor executes the computer instructions.

Citation Information

Patent Citations

  • Insurance policy checking verification method and apparatus, storage medium, and terminal

    CN108460688A

  • Rule storage method and device

    CN110019177A

  • Rule processing method, device and equipment and storage medium

    CN112069214A

  • Rule engine configuration method and device, server and readable storage medium

    CN113065656A

  • Timing sequence rule detection result visualization method based on tree reasoning

    CN115271073A