Rule generation method, device, computer equipment and storage medium
By displaying candidate controls and initialization rule templates, users can simply edit and generate complex rules, solving the problem of low efficiency in traditional business rule generation and improving rule generation efficiency.
Patent Information
- Application Number
- CN201811123620.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-09-26
- Publication Date
- 2024-08-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the traditional method, the generation of business rules is highly complex and difficult to master quickly. It takes a long time to edit business rules, and the efficiency of business rule generation is low.
By obtaining rule generation instructions, display candidate controls and initialization rule templates corresponding to business type identifiers, perform editing operations to determine target controls, and generate target rules based on initialization rule templates and target controls, providing pre-encapsulated data or methods to enable users to Complex rules can be generated with simple edits.
It improves the efficiency of rule generation, enables users to easily edit rules, and simplifies the creation and maintenance process of business rules.
Smart Images

Figure CN109445842B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a rule generation method, apparatus, computer device and storage medium. Background Art
[0002] With the development of computer technology, the business logic processed by computers is usually extracted from program codes and converted into corresponding business rules. In the traditional way, business rules can be run in the package of Oracle database. The generation of business rules involves a large number of SQL query statements and function calls. The creation and maintenance of business rules are very complex, making it difficult for business personnel to quickly master them. Editing business rules takes a long time, and the efficiency of business rule generation is low. Summary of the invention
[0003] Based on this, it is necessary to provide a rule generation method, apparatus, computer device and storage medium that can improve the efficiency of rule generation in order to solve the above technical problems.
[0004] A rule generation method, the method comprising: obtaining a rule generation instruction; the rule generation instruction carries a business type identifier; in response to the rule generation instruction, displaying candidate controls and an initialization rule template corresponding to the business type identifier; when a trigger instruction acting on the candidate control is detected, performing an editing operation on the initialization rule template; determining a target control among the candidate controls according to the editing operation; and generating a target rule according to the initialization rule template and the target control.
[0005] In one of the embodiments, the candidate controls include business object controls, and the initialization rule template includes initialization conditions; after performing an editing operation on the initialization rule template, it also includes: adding a business object control to the initialization condition according to the editing operation; and determining business attribute data corresponding to each of the business object controls.
[0006] In one of the embodiments, the candidate controls also include logic controls, and the method also includes: adding logic controls to the initialization conditions according to the editing operation; when the logic control corresponds to a business attribute data, determining an operation function based on the corresponding business attribute data according to the logic control; when the logic control corresponds to multiple business attribute data, determining an association relationship between the corresponding multiple business attribute data according to the logic control.
[0007] In one of the embodiments, the initialization rule template includes an initialization action, and the method further includes: determining action attribute data corresponding to the initialization action; generating the target rule based on the initialization rule template and the target control, including: determining the edited target condition based on at least one of the operation function and the association relationship; determining the edited target action based on the action attribute data; generating the target rule based on the target condition and the target action.
[0008] In one of the embodiments, after generating the target rule according to the initialization rule template and the target control, it also includes: storing the target rule in a first database; reading the target rule from the first database, and performing format conversion processing on the target rule to obtain a rule file; storing the rule file in a second database; and loading the rule file from the second database into the memory.
[0009] In one of the embodiments, after the rule file is loaded from the second database into the memory, it also includes: obtaining a rule execution request; the rule execution request carries business data and a rule identifier to be matched; searching for a rule file that matches the rule identifier to be matched; when it is detected that the second database storing the rule file is normal, based on the business data, calling a rule engine to execute the rule file; when it is detected that the second database storing the rule file fails, reading the target rule from the first database, performing format conversion processing on the target rule to obtain a rule file; loading the rule file into the memory; based on the business data, calling a rule engine to execute the rule file.
[0010] A rule generation device, the device comprising: an acquisition module, used to acquire a rule generation instruction; the rule generation instruction carries a business type identifier; a display module, used to display candidate controls and an initialization rule template corresponding to the business type identifier in response to the rule generation instruction; a detection module, used to perform an editing operation on the initialization rule template when a trigger instruction acting on the candidate control is detected; a generation module, used to determine a target control among the candidate controls according to the editing operation; and generate a target rule according to the initialization rule template and the target control.
[0011] In one embodiment, the candidate controls include business object controls, and the initialization rule template includes initialization conditions; the detection module is also used to add business object controls to the initialization conditions according to the editing operation; and determine the business attribute data corresponding to each of the business object controls.
[0012] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the rule generation method described in the above embodiments when executing the computer program.
[0013] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the rule generation method described in each of the above embodiments.
[0014] The above rule generation method, apparatus, computer equipment and storage medium, after receiving the rule generation instruction, the terminal can display the candidate control and the initialization rule template corresponding to the business type identifier according to the business type identifier carried in the rule generation instruction, and the user can conveniently edit the rule according to the displayed content. When the terminal detects a trigger instruction acting on the candidate control, after executing the editing operation on the initialization rule template, the target control in the candidate control can be determined according to the editing operation, and the target rule can be generated according to the initialization rule template and the target control. By providing candidate controls and initialization rule templates that pre-encapsulate data or methods, users only need to perform simple editing operations to generate complex target rules, thereby improving the efficiency of rule generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 An application scenario diagram of a rule generation method in an embodiment;
[0016] Figure 2 A schematic diagram of a flow chart of a rule generation method in an embodiment;
[0017] Figure 3 A schematic diagram of a rule generation interface in one embodiment;
[0018] Figure 4 A schematic diagram of the mapping relationship between business types, business objects and their attributes in one embodiment;
[0019] Figure 5 A schematic diagram of a flow chart of a rule generation method in another embodiment;
[0020] Figure 6 is a structural block diagram of a rule generating device in an embodiment;
[0021] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0023] It is understood that the terms "first", "second", etc. used in the present invention may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of the present invention, a first database may be referred to as a second database, and similarly, a second database may be referred to as a first database. Both the first database and the second database are databases, but they are not the same database.
[0024] The rule generation method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. Among them, the terminal 102 can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented with an independent server or a server cluster composed of multiple servers. The user can input a rule generation instruction based on the terminal 102, and the terminal 102 can obtain a candidate control from the server 104, as well as an initialization rule template corresponding to the business type identifier carried by the rule generation instruction. After the terminal 102 displays the initialization rule template, the user's editing operation on the initialization rule template based on the candidate control can be detected. The terminal 102 can determine the target control in the candidate control based on the editing operation, and the terminal 102 can generate a target rule according to the initialization rule template and the target control. The terminal 102 can also send the generated target rule to the server 104 for storage and execution.
[0025] In one embodiment, Figure 2 As shown, a rule generation method is provided, which is applied to Figure 1 The terminal 102 in the example is used as an example to illustrate, and the following steps are included:
[0026] Step 202, obtain a rule generation instruction; the rule generation instruction carries a business type identifier.
[0027] The rule generation instruction refers to an instruction triggered by a user for generating a rule. The business type identifier can be a string consisting of one or more of letters, numbers, punctuation marks, etc.
[0028] In one embodiment, the terminal provides a rule generation interface including multiple optional business type controls. When a click operation on a business type control is detected, it is determined that the terminal has received a rule generation instruction, and the terminal can also obtain a business type identifier corresponding to the clicked business type control.
[0029] In one embodiment, before creating a rule, the user needs to add a business type identifier and rule attributes to facilitate subsequent search and understanding. The business type identifier includes: business rule number, business rule name and business logic description. You can also select the corresponding business type, such as self-verification rules, insurance rules, and contract rules. You can also select the execution mode of the rule, including: compatible mode, execute all sub-rules; if there are multiple sub-rules, and the execution agencies of multiple sub-rules are the same, the execution mode should be compatible; mutually exclusive mode, only the one with a matching execution agency; if the execution agencies of multiple sub-rules are completely different, the execution mode should be mutually exclusive. You can also set rule tags, and you can filter related rules through rule tags later.
[0030] Step 204, in response to the rule generation instruction, display the candidate controls and the initialization rule template corresponding to the business type identifier.
[0031] The terminal can obtain multiple candidate controls and an initialization rule template corresponding to the business type identifier from a local database or a remote database. A candidate control refers to a control used to generate a rule. The control encapsulates data or methods and can be used for repeated use. For example, the candidate controls include but are not limited to logical symbol controls, operator controls, constant variable controls, time operation controls, maximum value controls, minimum value controls, etc. An initialization rule template refers to a rule template that contains a common part of the rule corresponding to the business type identifier. A rule usually contains condition items and action items, and both condition items and action items can be multiple. The common part of the rule can be a condition item part or an action item part. For example, the rules of the underwriting type all have an action item part for the customer number, customer type and insurance type submitted for underwriting, then the action item part of the initialization rule template can be preset with the customer number, customer type and insurance type submitted for underwriting.
[0032] In one embodiment, the terminal can convert the rule generation instruction into a rule generation request and send it to the server. The server will search for the corresponding initialization rule template based on the business type identifier and return the found initialization rule template to the terminal so that the terminal can display the initialization rule template.
[0033] Step 206: When a trigger instruction acting on a candidate control is detected, an editing operation on the initialization rule template is performed.
[0034] The trigger instruction may be an instruction generated by a user performing a trigger operation on a candidate control. An editing operation refers to a corresponding operation performed by the terminal on the initialization rule template in response to a trigger instruction. Trigger operations include, but are not limited to, click operations, double-click operations, input operations, select and drag operations, and the like. The user can select the increase and decrease controls in the initialization rule template by clicking operations to increase or decrease condition items or action items in the initialization rule template. The user can also select and drag a candidate control by selecting and dragging operations to select a target control from the candidate controls and drag it to the initialization rule template. The user can also double-click the target control by double-clicking operations to edit the candidate attribute data of the target control. The user can also search for attribute data by input operations, and the like.
[0035] In one embodiment, Figure 3 As shown, a schematic diagram of the rule generation interface is provided. The rule generation interface can be mainly divided into three areas, namely the candidate control area, the condition item area, and the action item area. The user can select the candidate control in the candidate control area and drag it to the condition item area. The user can also increase or decrease the condition items in the condition item area. The rule generation interface may also include a save control for generating the rules currently displayed in the rule generation interface; it may also include a clear control for clearing all condition items or action items in the current rule generation interface for quick re-editing.
[0036] Step 208: Determine a target control among the candidate controls according to the editing operation.
[0037] The target control refers to the candidate control selected according to the editing operation and used to be added to the initialization rule template. The target control can be used to combine the condition items of the generated rule, and can also be used to combine the action items of the generated rule. The combination of multiple target controls can form the rule logic.
[0038] Step 210, generating a target rule according to the initialization rule template and the target control.
[0039] By assembling and combining multiple target controls in the initialization rule template, a target rule with business logic can be formed. According to the data or methods encapsulated in the target control, the business logic formed between the target controls, and the corresponding content of the initialization rule template, the corresponding target rule can be generated.
[0040] In the above rule generation method, after receiving the rule generation instruction, the terminal can display the candidate controls and the initialization rule template corresponding to the business type identifier according to the business type identifier carried by the rule generation instruction, and the user can conveniently edit the rules according to the displayed content. After the terminal performs the editing operation on the initialization rule template, it can determine the target control in the candidate controls according to the editing operation, and generate the target rule according to the initialization rule template and the target control. By providing candidate controls and initialization rule templates that pre-encapsulate data or methods, users only need to perform simple editing operations to generate complex target rules, thereby improving the efficiency of rule generation.
[0041] In one embodiment, the candidate controls include business object controls, and the initialization rule template includes initialization conditions; after performing an editing operation on the initialization rule template, it also includes: adding business object controls to the initialization conditions according to the editing operation; and determining business attribute data corresponding to each business object control.
[0042] The initialization condition refers to the general part of the rule condition corresponding to the business type identifier contained in the initialization rule template. Figure 3 As shown, the condition items corresponding to "Insured 1" and "Protection Plan 1" in the condition item area can be initialization conditions. By directly displaying the common initialization conditions, the time for users to edit condition items can be reduced. Business object controls refer to controls used to define business objects. For example, in underwriting rules, business object controls can correspond to business objects such as policyholders, insured persons, protection plans, and salesmen. For another example, in risk control rules, business object controls can correspond to business objects such as investment accounts and risk factors. For each business object control, corresponding attribute conditions can be set. According to the user's editing operation on the business object control in the rule template, the business attribute data corresponding to each business object control can be determined. For example, for the business object salesman, business attribute data such as salesman code, salesman type, whether there is a formal rank or above, and whether the qualification certificate is expired can be set. Each salesman attribute data corresponds to a member variable in a business object.
[0043] like Figure 4 As shown, a schematic diagram of the mapping relationship between business types, business objects and their attributes is provided. For the underwriting business rule type, multiple business objects such as the insured, the policyholder, the salesperson, and historical policy information are involved, and each business object can correspond to one or more editable attributes. The target rule selects the attribute of whether the salesperson in the salesperson object has a formal rank or above. The attribute name is salesmanOfficialRank, which corresponds to a member variable in the salesperson object. Then the terminal can assign a value to salesmanOfficialRank according to the specific business logic.
[0044] In one embodiment, the candidate controls also include logical controls, and the method also includes: adding logical controls to the initialization conditions according to the editing operation; when the logical control corresponds to a business attribute data, determining an operation function based on the corresponding business attribute data according to the logical control; when the logical control corresponds to multiple business attribute data, determining the association relationship between the corresponding multiple business attribute data according to the logical control.
[0045] A logic control is a control used to build an association relationship between business object controls or between business attribute data corresponding to business object controls. A logic control may correspond to multiple business attribute data, for example, a logic control may be a relational symbol, a bracket symbol, an operator, a logical symbol, etc. Relational symbols include but are not limited to greater than symbol, less than symbol, equal to symbol, etc. Operators include but are not limited to plus sign, minus sign, multiplication sign, etc. Logical symbols include but are not limited to and, or, not, etc. A logic control may also correspond to a business attribute data, for example, a logic control may be a constant, a time operation, a maximum value, a minimum value, etc. When a logic control corresponds to a business attribute data, it means that the logic control is a control for performing an operation on a corresponding business attribute data, and then the operation function corresponding to the logic control may be obtained, and the business attribute data may be operated based on the operation function. When a logic control corresponds to multiple business attribute data, it means that the logic control is used to build an association relationship between business object controls or between business attribute data corresponding to business object controls. For example, the premium calculation rules are constructed through bracket symbols and operators. By providing controls that encapsulate functions, users only need to select and drag business object controls and logic controls to generate target rules. The target rule generation process is separated from the code itself, making it easy for business personnel to edit rules based on business logic.
[0046] In one embodiment, the initialization rule template includes an initialization action, and the method further includes: determining action attribute data corresponding to the initialization action; generating target rules based on the initialization rule template and the target control, including: determining the edited target condition based on at least one of the operation function and the association relationship; determining the edited target action based on the action attribute data; generating the target rule based on the target condition and the target action.
[0047] The initialization action refers to the general part of the rule action corresponding to the business type identifier contained in the initialization rule template. The rule action refers to the action to be performed after the verified data is judged to meet the rule conditions. For example, the target rule can be "If the protection plan is 978 insurance type, and the calculated cumulative accidental hospitalization days of the insured exceed 500, then send a prompt message", where "the protection plan is 978 insurance type" and "the calculated cumulative accidental hospitalization days of the insured exceed 500" are the rule conditions, and "send prompt message" is the action to be performed. The rule conditions contain two business objects, the protection plan and the insured, and the corresponding operation function can be called through the time operation control to calculate the cumulative accidental hospitalization days of the insured. The rule conditions contain two condition items, "the protection plan is 978 insurance type" and "the cumulative accidental hospitalization days of the insured exceed 500", and the two condition items can be used as a parallel relationship through the logical operator "and" to obtain the edited target condition. For the rule item "whether to send prompt information", select the action attribute data "send prompt information" to obtain the edited target action. The target rule can be automatically generated through the target condition and target action.
[0048] In one embodiment, after generating the target rules according to the initialization rule template and the target control, it also includes: storing the target rules in a first database; reading the target rules from the first database, and performing format conversion processing on the target rules to obtain a rule file; storing the rule file in a second database; and loading the rule file from the second database into the memory.
[0049] For example, after generating the target rules, the target rules can be stored in the Database. After reading the target rules from the Database, a rule file in DRL (a data format of a file that can be run through Drools) or XLS (a spreadsheet format) format can be generated according to the target rules. After writing the rule file to NAS (Network Attached Storage) space, the rule file in DRL or XLS format is loaded from the NAS space into the memory.
[0050] In one embodiment, converting the target rule to obtain a rule file includes: generating an XML format file from the target rule, saving it to a NAS space, parsing the XML format file into a DRL file and packaging it when packaging. After the DRL rule file is loaded into the memory, the DRL rule file is executed by DROOLS (a rule engine).
[0051] In one embodiment, after loading the rule file from the second database into the memory, it also includes: obtaining a rule execution request; the rule execution request carries business data and a rule identifier to be matched; searching for a rule file that matches the rule identifier to be matched; when it is detected that the second database storing the rule file is normal, based on the business data, calling the rule engine to execute the rule file; when it is detected that the second database storing the rule file is faulty, reading the target rule from the first database, performing format conversion processing on the target rule to obtain the rule file; loading the rule file into the memory; based on the business data, calling the rule engine to execute the rule file.
[0052] By automatically switching the database when a failure of the second database is detected, the situation of stopping response can be avoided. In addition, the rule files in the second database can be backed up regularly for quick recovery. The generated target rules can be verified in time through business data, and the wrong rules can be corrected quickly. A verification log can also be generated according to the verification results.
[0053] In one embodiment, after a rule is modified and carries an effective time, the modified rule to be updated can be saved in a database, and whether the rule to be updated is effective immediately can be determined based on the effective time. If it is effective immediately, a thread is created for each preset time, such as five minutes, to process the rule to be updated that is effective immediately, generate a rule file in DRL or XLS format for the rule to be updated, and load the rule file into the memory. If it is not effective immediately, the rules to be updated can be batch processed one day before the effective time, generate a rule file in DRL or XLS format for the rules to be updated, and load the rule file into the memory.
[0054] In one embodiment, business sub-rules under the target rule can also be set. Since the scope of each rule can be further refined, more comprehensive business sub-rules can be set to prevent rule loopholes. For example, under the rule "When the insured's occupation is a rejected occupation, insurance needs to be rejected", new business sub-rules can be added, such as "When the insured's occupation is risk level 7, insurance needs to be rejected." and "When the insured's occupation is risk level 6 and the insured's length of service exceeds ten years, insurance needs to be rejected."
[0055] In one embodiment, text rules can be automatically converted to target rules through text import. For example, when a large number of rules need to be created, it takes a long time to create them one by one. Therefore, the text containing the required rules can be imported, the text can be segmented into Chinese words, and the target control corresponding to each keyword after the segmentation can be determined. Through automatic conversion and splicing, the corresponding target rules are displayed and generated, so that users can directly check and modify them based on this, thereby saving time in selecting controls and editing rules one by one.
[0056] In one embodiment, Figure 5 As shown, another rule generation method is provided, which is applied to Figure 1 The terminal 102 in the example is used as an example to illustrate, and the following steps are included:
[0057] Step 502, obtain a rule generation instruction; the rule generation instruction carries a business type identifier.
[0058] Step 504: In response to the rule generation instruction, display the candidate controls and the initialization rule template corresponding to the business type identifier.
[0059] Step 506, when a trigger instruction acting on a candidate control is detected, an editing operation on the initialization rule template is performed; the candidate control also includes a business object control and a logic control; the initialization rule template includes an initialization condition and an initialization action.
[0060] Step 508: Add a business object control to the initialization condition according to the editing operation.
[0061] Step 510: Determine the business attribute data corresponding to each business object control.
[0062] Step 512: Add logic controls to the initialization conditions according to the editing operation.
[0063] Step 514: When the logic control corresponds to a piece of business attribute data, a calculation function based on the corresponding business attribute data is determined according to the logic control.
[0064] Step 516: When the logic control corresponds to a plurality of business attribute data, the association relationship between the corresponding plurality of business attribute data is determined according to the logic control.
[0065] Step 518, determining the edited target condition according to at least one of the operation function and the association relationship;
[0066] Step 520, determining action attribute data corresponding to the initialization action.
[0067] Step 522, determining the edited target action according to the action attribute data.
[0068] Step 524, generating target rules according to the target conditions and target actions.
[0069] In the above rule generation method, after receiving the rule generation instruction, the terminal can display the candidate control and the initialization rule template corresponding to the business type identifier according to the business type identifier carried by the rule generation instruction, and the user can conveniently add business object controls and logic controls to the initialization rule template according to the displayed content. After the terminal detects the editing operation on the initialization rule template, it can determine the business object, business attribute data, operation function or associated object in the candidate control according to the editing operation, thereby obtaining the target condition, and obtain the target action after determining the action attribute data, and automatically generate the target rule according to the target condition and the target action. By providing candidate controls and initialization rule templates that pre-encapsulate data or methods, users only need to perform simple and flexible editing operations to generate complex target rules, thereby improving the efficiency of rule generation.
[0070] It should be understood that although Figure 2 and 5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 and 5 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0071] In one embodiment, Figure 6 As shown, a rule generation device 600 is provided, including: an acquisition module 602, used to acquire a rule generation instruction; the rule generation instruction carries a business type identifier; a display module 604, used to display candidate controls and an initialization rule template corresponding to the business type identifier in response to the rule generation instruction; a detection module 606, used to execute an editing operation on the initialization rule template when a trigger instruction acting on the candidate control is detected; a generation module 608, used to determine a target control among the candidate controls according to the editing operation; and generate a target rule according to the initialization rule template and the target control.
[0072] In one embodiment, the candidate controls include business object controls, and the initialization rule template includes initialization conditions; the detection module 606 is further used to add business object controls to the initialization conditions according to the editing operation; and determine the business attribute data corresponding to each business object control.
[0073] In one embodiment, the candidate controls also include logic controls, and the generation module 608 is further used to add logic controls to the initialization conditions according to the editing operation; when the logic control corresponds to a business attribute data, the operation function based on the corresponding business attribute data is determined according to the logic control; when the logic control corresponds to multiple business attribute data, the association relationship between the corresponding multiple business attribute data is determined according to the logic control.
[0074] In one embodiment, the initialization rule template includes an initialization action, and the generation module 608 is also used to determine the action attribute data corresponding to the initialization action; determine the edited target condition based on at least one of the operation function and the association relationship; determine the edited target action based on the action attribute data; and generate the target rule based on the target condition and the target action.
[0075] In one embodiment, the device also includes a loading module for storing target rules in a first database; reading target rules from the first database, performing format conversion processing on the target rules to obtain a rule file; storing the rule file in a second database; and loading the rule file from the second database into memory.
[0076] In one embodiment, the loading module is also used to obtain a rule execution request; the rule execution request carries business data and a rule identifier to be matched; a rule file matching the rule identifier to be matched is searched; when it is detected that the second database storing the rule file is normal, based on the business data, a rule engine is called to execute the rule file; when it is detected that the second database storing the rule file fails, a target rule is read from the first database, and the target rule is formatted to obtain a rule file; the rule file is loaded into memory; based on the business data, a rule engine is called to execute the rule file.
[0077] For the specific definition of the rule generation device, please refer to the definition of the rule generation method above, which will not be repeated here. Each module in the above rule generation device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0078] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a rule generation method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0079] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0080] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the rule generation method in each of the above embodiments when executing the computer program.
[0081] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the rule generation method in the above-mentioned various embodiments are implemented.
[0082] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0083] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0084] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A rule generation method, the method comprising: Get rule generation instructions; The rule generation instruction carries a business type identifier; the business types corresponding to the business type identifier include self-verification rules, insurance rules and contract rules; In response to the rule generation instruction, displaying candidate controls and an initialization rule template corresponding to the business type identifier; When a trigger instruction acting on the candidate control is detected, an editing operation on the initialization rule template is performed; the editing operation is performed based on a rule generation interface, and the rule generation interface includes a candidate control area, a condition item area, and an action item area; The editing operation of the rule generation interface includes: selecting and dragging a candidate control in the candidate control area to the condition item area, and increasing or decreasing the condition items in the condition item area; the rule generation interface also includes a save control and a clear control, the save control is used to generate the rule currently displayed in the rule generation interface; the clear control is used to clear all condition items or action items in the current rule generation interface; the editing operation of the candidate control includes a click operation, a double-click operation, an input operation, and a select and drag operation; Determine a target control among the candidate controls according to the editing operation; Generate a target rule according to the initialization rule template and the target control; The candidate controls include business object controls, and the initialization rule template includes initialization conditions; after performing the editing operation on the initialization rule template, the method further includes: adding business object controls to the initialization conditions according to the editing operation; determining business attribute data corresponding to each of the business object controls; The candidate controls also include logic controls, and the method further includes: adding a logic control to the initialization condition according to the editing operation; when the logic control corresponds to one business attribute data, determining a calculation function based on the corresponding business attribute data according to the logic control; when the logic control corresponds to multiple business attribute data, determining an association relationship between the multiple corresponding business attribute data according to the logic control; The initialization rule template includes an initialization action, and the method further includes: determining action attribute data corresponding to the initialization action; The generating of the target rule according to the initialization rule template and the target control includes: determining the edited target condition according to at least one of the operation function and the association relationship; determining the edited target action according to the action attribute data; and generating the target rule according to the target condition and the target action.
2. The method according to claim 1, characterized in that The business object control is a control used to define business objects; in underwriting rules, the business objects corresponding to the business object control include policyholders, insured persons, protection plans, and salesmen; in risk control rules, the business objects corresponding to the business object control include investment accounts and risk factors.
3. The method according to claim 1, characterized in that When the logic control corresponds to multiple business attribute data, the logic control includes relational symbols, bracket symbols, operators, and logical symbols; wherein the relational symbols include greater than, less than, and equal to symbols; the operators include plus, minus, and multiplication; and the logical symbols include AND, OR, and NOT.
4. The method according to claim 1, characterized in that: When the logic control corresponds to a business attribute data, the logic control includes a constant, a time operation, a maximum value, and a minimum value.
5. The method according to claim 1, characterized in that After generating the target rule according to the initialization rule template and the target control, the method further includes: storing the target rule in a first database; Read the target rule from the first database, and perform format conversion processing on the target rule to obtain a rule file; Storing the rule file in a second database; The rule file is loaded from the second database into the memory.
6. The method according to claim 5, characterized in that After loading the rule file from the second database into the memory, the method further includes: Obtain a rule execution request; the rule execution request carries business data and an identifier of a rule to be matched; Searching for a rule file that matches the rule identifier to be matched; When it is detected that the second database storing the rule file is normal, based on the business data, calling the rule engine to execute the rule file; When a failure of the second database storing the rule file is detected, the target rule is read from the first database, and the target rule is formatted to obtain a rule file; the rule file is loaded into the memory; and based on the business data, a rule engine is called to execute the rule file.
7. A rule generating device, characterized in that: The device comprises: An acquisition module, used for acquiring a rule generation instruction; the rule generation instruction carries a business type identifier; the business type corresponding to the business type identifier includes a self-verification rule, an insurance rule, and a contract rule; A display module, configured to display candidate controls and an initialization rule template corresponding to the business type identifier in response to the rule generation instruction; A detection module, for executing an editing operation on the initialization rule template when a trigger instruction acting on the candidate control is detected; the editing operation is performed based on a rule generation interface, the rule generation interface includes a candidate control area, a condition item area and an action item area; the editing operation on the rule generation interface includes: selecting and dragging a candidate control in the candidate control area to the condition item area, and increasing or decreasing the condition items in the condition item area; the rule generation interface also includes a save control and a clear control, the save control is used to generate the rule currently displayed in the rule generation interface; the clear control is used to clear all condition items or action items in the current rule generation interface; the editing operation on the candidate control includes a click operation, a double-click operation, an input operation and a select and drag operation; A generating module, configured to determine a target control among the candidate controls according to the editing operation; and to generate a target rule according to the initialization rule template and the target control; The candidate controls include business object controls, the initialization rule template includes initialization conditions, and the detection module is further used to: add business object controls to the initialization conditions according to the editing operation; determine the business attribute data corresponding to each of the business object controls; The candidate controls also include logic controls, and the generation module is further used to: add logic controls to the initialization conditions according to the editing operation; when the logic control corresponds to one business attribute data, determine the operation function based on the corresponding business attribute data according to the logic control; when the logic control corresponds to multiple business attribute data, determine the association relationship between the multiple corresponding business attribute data according to the logic control; The initialization rule template includes an initialization action, and the generation module is further used to: determine action attribute data corresponding to the initialization action; determine the edited target condition based on at least one of the operation function and the association relationship; determine the edited target action based on the action attribute data; and generate a target rule based on the target condition and the target action.
8. The device according to claim 7, characterized in that The device further comprises a loading module, wherein the loading module is used for: The target rule is stored in a first database; the target rule is read from the first database, and the target rule is converted into a rule file; the rule file is stored in a second database; and the rule file is loaded from the second database into a memory.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
