CN108509478B - Splitting and calling method of rule engine file, electronic device and storage medium - Google Patents

Splitting and calling method of rule engine file, electronic device and storage medium Download PDF

Info

Publication number
CN108509478B
CN108509478B CN201711186783.7A CN201711186783A CN108509478B CN 108509478 B CN108509478 B CN 108509478B CN 201711186783 A CN201711186783 A CN 201711186783A CN 108509478 B CN108509478 B CN 108509478B
Authority
CN
China
Prior art keywords
keyword
rule file
rule
judgment conditions
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711186783.7A
Other languages
Chinese (zh)
Other versions
CN108509478A (en
Inventor
刘开华
郑志华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201711186783.7A priority Critical patent/CN108509478B/en
Priority to PCT/CN2018/083085 priority patent/WO2019100646A1/en
Publication of CN108509478A publication Critical patent/CN108509478A/en
Application granted granted Critical
Publication of CN108509478B publication Critical patent/CN108509478B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/08Insurance

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a splitting and calling method of a rule engine file, and belongs to the technical field of networks. A splitting and calling method of a rule engine file comprises the following steps: s1, the rule engine server receives the information to be judged sent by the client; s2, extracting keywords in the information to be judged; s3, calling a corresponding rule file set from a preset rule file library according to the keywords, wherein the rule file set comprises a plurality of judgment conditions and results with directional relations; s4, sequentially loading judgment conditions contained in the rule file set according to a preset loading sequence and comparing the judgment conditions with the keywords; and S5, outputting a result corresponding to the rule file formed by the judgment conditions corresponding to the keywords. The invention ensures that only one smaller file is loaded and issued at a certain time point by a queue mechanism for classifying and sequentially loading the regular files, thereby effectively reducing the CPU load and achieving the aim of stable operation of the system.

Description

Splitting and calling method of rule engine file, electronic device and storage medium
Technical Field
The invention relates to the technical field of networks, in particular to a splitting and calling method of a rule engine file, an electronic device and a computer readable storage medium.
Background
The rule engine is a core technical component designed for responding to and processing complicated and changeable business rules, and the use scenarios of the rule engine include, but are not limited to, the following two scenarios: 1) large-batch flexible logic condition judgment; 2) frequently changing data calculation methods. By introducing the rule engine, the complex and changeable parts are dynamically defined and adjusted in a flexible configuration mode, so that the IT system can timely support the change of business requirements.
However, when the rule engine supports rule file loading, the rule file is too large (more than 10M), which may cause a host CPU to run violently, and affect the stability of system operation.
Analysis shows that the consumption of the CPU is completely consistent with the loading frequency of the rule file, so that the array dosing is urgently needed, the consumption of the CPU is reduced, and the stable operation of the system is ensured.
Disclosure of Invention
The technical problem to be solved by the invention is to overcome the problem of the prior art that a host CPU (central processing unit) is soared when a rule engine supports the loading of a large rule file, and provide a method for splitting and calling the rule engine file, an electronic device and a computer readable storage medium.
The invention solves the technical problems through the following technical scheme:
a splitting and calling method of a rule engine file comprises the following steps:
s1, the rule engine server receives the information to be judged sent by the client;
s2, extracting keywords in the information to be judged;
s3, calling a corresponding rule file set from a preset rule file library according to the keywords, wherein the rule file set comprises a plurality of judgment conditions and results with directional relations;
s4, sequentially loading judgment conditions contained in the rule file set according to a preset loading sequence and comparing the judgment conditions with the keywords;
and S5, outputting a result corresponding to the rule file formed by the judgment conditions corresponding to the keywords.
Preferably, step S1 is preceded by:
s0, presetting a rule file library: the rule file is divided into a plurality of judgment conditions and then is classified and stored in a rule file set, the judgment conditions are matched with a loading sequence with directivity, and the rule file consisting of the judgment conditions is associated with a corresponding result.
Preferably, step S0 specifically includes the following sub-steps:
s01, splitting the rule file into a combination of a plurality of judgment conditions according to semantics, and matching each judgment condition with a directional loading sequence;
s02, matching labels on one or more dimensions for each judgment condition;
s03, dividing all judgment conditions with labels according to preset classification dimensions and storing the judgment conditions into corresponding rule file sets, wherein the names of the rule file sets are labels matched with the judgment conditions in the classification dimensions;
s04, removing the duplication of the judgment conditions in the rule file set, and matching the ending direction and the starting direction of the loading sequence matched with the duplication-removing judgment conditions to the same judgment conditions;
and S05, associating the rule file consisting of a plurality of judgment conditions with the corresponding result.
Preferably, step S2 specifically includes the following sub-steps:
s21, splitting the information to be judged into a word sequence consisting of a plurality of words by using a word segmentation tool;
s22, generating a keyword sequence only containing keywords by removing stop words in the word sequence;
s23, extracting keywords corresponding to the classification dimensions in the keyword sequence, and arranging the keywords at the head of the keyword sequence;
and S24, outputting the sorted keyword sequence.
Preferably, step S3 specifically includes the following sub-steps:
s31, extracting a first keyword in the keyword sequence;
s32, comparing the first keyword with the names of the rule file sets in sequence;
s33, judging whether the first keyword is matched with the name of the rule file set, if so, executing a step S34, and if not, executing a step S32;
and S34, calling a rule file set with the name matched with the first keyword, and deleting the first keyword from the keyword sequence.
Preferably, step S4 specifically includes the following sub-steps:
s41, acquiring a plurality of judgment conditions parallel in the first hierarchy in the called rule file set as the current hierarchy;
s42, loading the first judgment condition in the current level as the current judgment condition;
s43, judging whether the current judgment condition is matched with any keyword in the keyword sequence, if so, executing a step S45, and if not, executing a step S44;
s44, temporarily storing the current judgment condition, then loading the judgment condition behind the current judgment condition as a new current judgment condition, and executing the step S43;
s45, deleting the matched keywords from the keyword sequence, and resetting the current level to the judgment condition corresponding to the end point of the loading sequence of the current judgment condition;
s46, judging whether the keyword sequence has any keyword, if yes, executing a step S42, and if no, executing a step S47;
and S47, judging whether the rule file consisting of the plurality of temporarily stored judging conditions has a corresponding result, if so, outputting the result, and if not, directly ending.
Preferably, the substep S43 specifically comprises the following substeps:
s431, acquiring a first keyword in the keyword sequence as a current comparison keyword;
s432, judging whether the current judgment condition is matched with the current comparison keyword, if so, executing the step S435, and if not, executing the step S433;
s433, judging whether the current comparison keyword is the last keyword in the keyword sequence, if so, executing the step S435, and if not, executing the step S434;
s434, acquiring a keyword positioned behind the current comparison keyword in the keyword sequence as a new current comparison keyword, and executing the step S432;
and S435, ending.
An electronic device comprising a memory and a processor, the memory having stored thereon a split call system of a rules engine file executable by the processor, the split call system of a rules engine file comprising:
the rule file library is used for storing a rule file set, and the rule file set comprises a plurality of judgment conditions and results with directional relations;
the receiving module is used for receiving information to be judged sent by the client;
the extraction module is used for extracting keywords in the information to be judged;
the calling module is used for calling a corresponding rule file set from a preset rule file library according to the keywords;
the loading comparison module is used for sequentially loading the judgment conditions contained in the rule file set and comparing the judgment conditions with the keywords according to a preset loading sequence;
and the output module is used for outputting a result corresponding to the rule file formed by the judgment conditions conforming to the keywords.
Preferably, the system for splitting and calling the rule engine file further comprises:
and the rule file splitting module is used for splitting the rule file into a plurality of judgment conditions, storing the judgment conditions into a rule file set in a classified manner, matching the judgment conditions with a directional loading sequence, and associating the rule file consisting of the judgment conditions with a corresponding result.
A computer readable storage medium having stored therein a split call system of a rules engine file executable by at least one processor to cause the at least one processor to perform the steps of the split call method of a rules engine file as set forth in any one of the preceding claims.
The positive progress effects of the invention are as follows: the invention ensures that only one smaller file is loaded and issued at a certain time point by a queue mechanism for classifying and sequentially loading the regular files, thereby effectively reducing the CPU load and achieving the aim of stable operation of the system.
Drawings
FIG. 1 is a diagram illustrating a hardware architecture of an embodiment of an electronic device according to the invention;
FIG. 2 is a schematic diagram showing program modules of a first embodiment of a system for splitting and calling a rule engine file in an electronic device according to the present invention;
FIG. 3 is a program module diagram of a second embodiment of a split call system for a rules engine file in an electronic device according to the present invention;
FIG. 4 is a flowchart of a first embodiment of a method for split calling of a rules engine file according to the present invention;
FIG. 5 is a flowchart of a second embodiment of a method for split invocation of a rules engine file in accordance with the present invention;
FIG. 6 is a flowchart illustrating a third embodiment of a method for splitting and calling a rule engine file according to the present invention to construct a rule file library;
FIG. 7 is a flowchart illustrating keyword extraction in information to be determined in a fourth embodiment of a method for splitting and calling a rule engine file according to the present invention;
FIG. 8 is a flowchart illustrating matching of rule file sets in a fifth embodiment of a method for splitting and invoking a rule engine file according to the present invention;
FIG. 9 is a flowchart illustrating result matching in a sixth embodiment of a method for split call of a rule engine file according to the present invention;
fig. 10 is a flowchart illustrating keyword comparison in a seventh embodiment of the method for splitting and calling a rule engine file according to the present invention.
Detailed Description
The invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
First, the present invention provides an electronic device.
Fig. 1 is a schematic diagram of a hardware architecture of an electronic device according to an embodiment of the invention. In the present embodiment, the electronic device 2 is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction. For example, the server may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including an independent server or a server cluster composed of a plurality of servers). As shown, the electronic device 2 includes, but is not limited to, at least a memory 21, a processor 22, a network interface 23, and a split call system 20 of a rules engine file communicatively coupled to each other via a system bus. Wherein:
the memory 21 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 21 may be an internal storage unit of the electronic device 2, such as a hard disk or a memory of the electronic device 2. In other embodiments, the memory 21 may also be an external storage device of the electronic apparatus 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the electronic apparatus 2. Of course, the memory 21 may also comprise both an internal memory unit of the electronic apparatus 2 and an external memory device thereof. In this embodiment, the memory 21 is generally used for storing an operating system installed in the electronic device 2 and various types of application software, such as program codes of the split call system 20 of the rule engine file. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 22 is generally configured to control the overall operation of the electronic apparatus 2, such as performing data interaction or communication related control and processing with the electronic apparatus 2. In this embodiment, the processor 22 is configured to run the program code stored in the memory 21 or process data, for example, run the split call system 20 of the rule engine file.
The network interface 23 may comprise a wireless network interface or a wired network interface, and the network interface 23 is generally used for establishing communication connection between the electronic device 2 and other electronic devices. For example, the network interface 23 is used to connect the electronic apparatus 2 to an external terminal through a network, establish a data transmission channel and a communication connection between the electronic apparatus 2 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), Wi-Fi, and the like.
It is noted that fig. 1 only shows the electronic device 2 with components 21-23, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
In this embodiment, the split call system 20 of the rules engine file stored in the memory 21 may be divided into one or more program modules, and the one or more program modules are stored in the memory 21 and executed by one or more processors (in this embodiment, the processor 22) to complete the present invention.
For example, fig. 2 shows a schematic diagram of program modules of a first embodiment of the splitting and calling system 20 of the rule engine file, in this embodiment, the splitting and calling system 20 of the rule engine file may be divided into a rule file library 201, a receiving module 202, an extracting module 203, a calling module 204, a load comparison module 205 and an output module 206. The program module referred to in the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable than a program for describing the execution process of the split call system 20 of the rule engine file in the electronic device 2. The following description will specifically describe the specific functions of the program module 201 and 206.
The rule file library 201 is configured to store a rule file set, where the rule file set includes a plurality of determination conditions and results having directional relationships;
the receiving module 202 is configured to receive information to be determined sent by a client;
the extraction module 203 is configured to extract a keyword in the information to be determined;
the calling module 204 is configured to call a corresponding rule file set from a preset rule file library according to the keyword;
the loading comparison module 205 is configured to sequentially load the judgment conditions included in the rule file set according to a preset loading sequence and compare the judgment conditions with the keywords;
the output module 206 is configured to output a result corresponding to a rule file composed of the determination conditions that are consistent with the keyword.
The following description will be made by taking an example of the case where the salesperson judges which activity the customer purchased the car insurance conforms to through the system:
1. the salesperson inputs the information of the customer into the client of the system according to the sales agreement which the salesperson will reach with the customer, and the client sends the information to the rule engine server to initiate the request on the assumption that the input information is' the customer belongs to the Buddha and has no risk in the last year, the amount of the commercial insurance policy is 5682 yuan;
2. the keyword sequence consisting of the keywords extracted by the rule engine server to the information is 'the Fushan commercial insurance amount 5682 has no online payment in the last year';
3. calling a rule file set with the name of Buddha according to a first keyword 'Buddha' in the keyword sequence;
4. according to a preset loading sequence, sequentially loading judgment conditions in a first level to obtain that the customer accords with a first judgment condition that the amount of a commercial insurance policy reaches 5000, then loading a plurality of judgment conditions pointed by the first judgment condition to obtain that the customer accords with a second judgment condition that no insurance is given in the last year, then loading a plurality of judgment conditions pointed by the second judgment condition to obtain that the customer accords with a third judgment condition that online payment is carried out, and finally obtaining a result corresponding to the three judgment conditions, namely giving 100-element telephone charges;
it should be noted that, here, the hierarchy is divided according to the loading order of the judgment condition; specifically, the first-level judgment condition refers to a set of first judgment conditions among all the judgment conditions having a directional relationship, and the second judgment conditions to which the first judgment conditions point are merged into the second-level judgment condition, and so on.
5. The system automatically outputs the result "give 100-dollar phone fee" as a gift that the customer can obtain by purchasing the car insurance.
For another example, fig. 3 shows a schematic diagram of program modules of a second embodiment of the splitting and calling system 20 for a rule engine file, in this embodiment, the splitting and calling system 20 for a rule engine file may be further divided into a rule file library 201, a receiving module 202, an extracting module 203, a calling module 204, a loading and comparing module 205, an outputting module 206, and a rule file splitting module 207.
The modules 201 and 206 are the same as those of the first embodiment, and are not described herein again.
The rule file splitting module 207 is configured to split the rule file into a plurality of determination conditions, store the determination conditions in a rule file set in a classified manner, match the determination conditions with a directional loading order, and associate the rule file composed of the determination conditions with corresponding results.
In the above example, the system determines the activities that the client can participate in based on a rule file library pre-stored in the rule engine server, the rule file library stores a plurality of rule file sets, each rule file set includes determination conditions obtained by splitting a plurality of rule files, a loading sequence of directivity between the determination conditions is set according to the rule files, and results corresponding to the rule files composed of the determination conditions are provided.
Secondly, the invention provides a splitting and calling method of a rule engine file.
In an embodiment, as shown in fig. 4, the method for split calling of a rule engine file includes the following steps:
s1, the rule engine server receives the information to be judged sent by the client;
s2, extracting keywords in the information to be judged;
s3, calling a corresponding rule file set from a preset rule file library according to the keywords, wherein the rule file set comprises a plurality of judgment conditions and results with directional relations;
s4, sequentially loading judgment conditions contained in the rule file set according to a preset loading sequence and comparing the judgment conditions with the keywords; the comparison is to judge whether the judgment condition is consistent with the keyword or not;
s5, outputting a result corresponding to a rule file consisting of judgment conditions conforming to the keyword; here, the result is a processing result corresponding to the information to be determined.
The following description will be made by taking the example of determining the gift that can be obtained by the Buddha mountain customer after purchasing the car insurance:
suppose that:
firstly, the vehicle insurance purchased by the customer meets the following conditions: the client belongs to the place of Buddha mountain, no insurance is provided in the last year, the amount of the commercial insurance policy in the vehicle insurance purchased at this time is 5682 yuan, and the payment is carried out on line.
And secondly, a rule file set named as 'Buddha mountain' is arranged in the rule file library, a plurality of judgment conditions are arranged in the rule file set according to a directional sequence to form a rule file, the amount of the business insurance policy reaches 5000, no insurance is given in the last year, online payment is realized, and a result related to the rule file is 'given 100-element telephone fee'.
1. The salesperson inputs the customer information into the client, and then the client sends the customer information to the rule engine server;
2. the rule engine server extracts keywords in the client information, specifically, "no online payment for the last year of the Foshan commercial insurance sum 5682";
3. according to the first keyword Buddha mountain, a rule file set named as 'Buddha mountain' is called;
4. according to a preset loading sequence, sequentially loading judgment conditions contained in a rule file set and the keywords for comparison, firstly loading the judgment conditions in a first level to obtain that the customer meets a first judgment condition that the amount of a commercial insurance policy reaches 5000, then loading a plurality of judgment conditions pointed by the first judgment condition to obtain that the customer meets a second judgment condition that no insurance is given in the last year, then loading a plurality of judgment conditions pointed by the second judgment condition to obtain that the customer meets a third judgment condition that online payment is given, and finally obtaining results corresponding to the three judgment conditions, namely 'giving 100-element telephone charge';
5. the result "give away 100-yuan phone fee" is output.
In the second embodiment, based on the first embodiment, as shown in fig. 5, the method for split calling of a rule engine file includes the following steps:
s0, presetting a rule file library: the rule file is divided into a plurality of judgment conditions and then is classified and stored in a rule file set, the judgment conditions are matched with a loading sequence with directivity, and the rule file consisting of the judgment conditions is associated with a corresponding result.
It should be noted that: the splitting of the rule file is only needed when the rule file library is first constructed and a new rule file is added subsequently.
S1-S5 are the same as those in the first embodiment and are not described herein.
In the third embodiment, based on the second embodiment, as shown in fig. 6, a specific construction process of the rule document library is disclosed, which includes the following sub-steps:
s01, splitting the rule file into a combination of a plurality of judgment conditions according to semantics, and matching each judgment condition with a directional loading sequence;
s02, matching labels on one or more dimensions for each judgment condition;
s03, dividing all judgment conditions with labels according to preset classification dimensions and storing the judgment conditions into corresponding rule file sets, wherein the names of the rule file sets are labels matched with the judgment conditions in the classification dimensions;
s04, removing the duplication of the judgment conditions in the rule file set, and matching the ending direction and the starting direction of the loading sequence matched with the duplication-removing judgment conditions to the same judgment conditions; the same judgment condition refers to a judgment condition which is reserved after all the same judgment conditions are subjected to deduplication;
and S05, associating the rule file consisting of a plurality of judgment conditions with the corresponding result.
In the above example, it is assumed that there are three rule files as follows, and the construction of the rule file library is specifically described:
a rule file I: when a Buddha mountain client buys the car insurance, if the amount of the commercial insurance policy of the client reaches 5000, no insurance is given in the last year and an online payment mode is adopted, 100-element telephone charges can be given;
and a second rule file: when a Buddha mountain customer buys car insurance, if the amount of the commercial insurance policy of the customer reaches 5000, the customer goes out of insurance in the last year and adopts an online payment mode, 2 car washing coupons can be given;
and a rule file III: when the Shanghai customer buys the car insurance, if the amount of the commercial insurance policy of the customer reaches 5000, no insurance is given in the last year and an online payment mode is adopted, the 100 Yuan transportation card can be given;
1. according to semantic rules, three rule files are respectively split into a combination of a plurality of judgment conditions: "the amount of the commercial insurance policy reaches 5000, no insurance was given in the last year, online payment", "the amount of the commercial insurance policy reaches 5000, no insurance was given in the last year, online payment"; the loading order of the directivity of each combination is as the aforementioned order;
2. labeling three groups of judgment conditions on the dimension of the attribution respectively: the first group and the second group of labels are all Buddha mountains, and the third group of labels are Shanghai;
3. dividing all judgment conditions according to the dimension of the attribution, wherein the first group of judgment conditions and the second group of judgment conditions are stored in a rule file set named as 'Buddha mountain', and the third group of judgment conditions are stored in a rule file set named as 'Shanghai';
4. removing the weight of the judgment condition in the rule file set named as ' Buddha mountain ', only keeping the judgment condition that the business insurance policy amount reaches 5000, no insurance in the last year, online payment and no insurance in the last year ', wherein the two ending directions of the loading sequence of the business insurance policy amount reaching 5000 in the judgment condition are ' no insurance in the last year ' and ' no insurance in the last year ' respectively, and the two starting directions of the loading sequence of the online payment in the judgment condition are ' no insurance in the last year ' and ' no insurance in the last year ' respectively; the rule file named as Shanghai is only one rule file in the rule file set, and duplication removal is not needed;
5. associating a rule file consisting of the judgment condition that the amount of the business insurance policy reaches 5000, no insurance is given in the last year and the online payment is carried out with the result of the donation of 100-element telephone charge; associating a rule file consisting of the judgment condition that the commercial insurance policy sum reaches 5000, the insurance is given in the last year and the online payment with the result of giving 2 car washing coupons; the rule file composed of the judgment condition that the commercial insurance policy amount reaches 5000, no insurance is given in the last year and online payment is associated with the result of giving 100-yuan transportation card.
In the fourth embodiment, based on the third embodiment, as shown in fig. 7, the step S2 specifically includes the following sub-steps:
s21, splitting the information to be judged into a word sequence consisting of a plurality of words by using a word segmentation tool;
s22, generating a keyword sequence only containing keywords by removing stop words in the word sequence;
the stop words refer to words that do not relate to a specific meaning, such as me, want, etc.
S23, extracting keywords corresponding to the classification dimensions in the keyword sequence, and arranging the keywords at the head of the keyword sequence;
and S24, outputting the sorted keyword sequence.
The following example specifically illustrates the process of extracting keywords from the information to be determined:
1. splitting information to be determined that the customer attribution is the Buddha mountain and no insurance is provided in the last year, the amount of the commercial insurance policy in the vehicle insurance purchased at this time is 5682 yuan, and the split information is split through online payment to form a word sequence that the amount of the commercial insurance policy in the vehicle insurance purchased at this time is 5682 yuan;
2. removing stop words in the word sequence, and generating a keyword sequence of 'no-risk business insurance policy amount 5682 yuan online payment in the last year of the Buddha';
3. extracting a keyword 'Buddha mountain' corresponding to the attribution dimension and arranging the keyword 'Buddha mountain' to the head of the keyword sequence; (in this assumption, the Buddha is originally ranked first, and if the Buddha is originally ranked non-first, it needs to be advanced to first);
4. the ordered keyword sequence 'no business insurance policy amount 5682 yuan online payment in the next year of Buddha mountain' is output.
In the fifth embodiment, based on the fourth embodiment, as shown in fig. 8, the step S3 specifically includes the following sub-steps:
s31, extracting a first keyword in the keyword sequence;
s32, comparing the first keyword with the names of the rule file sets in sequence;
s33, judging whether the first keyword is matched with the name of the rule file set, if so, executing a step S34, and if not, executing a step S32;
and S34, calling a rule file set with the name matched with the first keyword, and deleting the first keyword from the keyword sequence.
The following example specifically illustrates the matching process of the rule file set:
1. extracting a first keyword 'Buddha' in a keyword sequence '5682 yuan online payment of business insurance policy without insurance in the last year of Buddha';
2. comparing the keyword 'Buddha mountain' with the names of the rule file sets one by one;
3. a rule file set named 'foshan' is called out, and the keyword 'foshan' is deleted from the keyword sequence, namely the keyword sequence is changed into 'no-risk business insurance policy amount in the last year 5682 yuan online payment'.
In the sixth embodiment, based on the fifth embodiment, as shown in fig. 9, the step S4 specifically includes the following sub-steps:
s41, acquiring a plurality of judgment conditions parallel in the first hierarchy in the called rule file set as the current hierarchy;
s42, loading the first judgment condition in the current level as the current judgment condition;
s43, judging whether the current judgment condition is matched with any keyword in the keyword sequence, if so, executing a step S45, and if not, executing a step S44;
s44, temporarily storing the current judgment condition, then loading the judgment condition behind the current judgment condition as a new current judgment condition, and executing the step S43;
s45, deleting the matched keywords from the keyword sequence, and resetting the current level to the judgment condition corresponding to the end point of the loading sequence of the current judgment condition;
s46, judging whether the keyword sequence has any keyword, if yes, executing a step S42, and if no, executing a step S47;
and S47, judging whether the rule file consisting of the plurality of temporarily stored judging conditions has a corresponding result, if so, outputting the result, and if not, directly ending.
The following example specifically illustrates the matching process of the results:
1. acquiring a first judgment condition contained in a first hierarchy in a rule file set named as 'Buddha mountain', wherein only one judgment condition 'commercial insurance policy sum reaches 5000';
2. comparing the judgment condition that the business insurance policy amount reaches 5000 with each keyword in the keyword sequence that the business insurance policy amount which does not go out insurance in the last year is 5682 yuan online payment to obtain a matched keyword which is 'business insurance policy amount 5682 yuan';
3. deleting the keyword 'business insurance policy amount 5682 yuan' from the keyword sequence to obtain a new keyword sequence 'no online payment for the next year', and simultaneously obtaining a first judgment condition 'business insurance policy amount reaches 5000' in a rule file set named 'Buddha mountain', wherein the second judgment condition has two parallel conditions, namely 'no insurance for the next year' and 'insurance for the next year';
4. obtaining a judgment condition that the ranking in the second judgment condition is in front of the second judgment condition in parallel, and comparing the judgment condition that no risk exists in the last year with each keyword in a keyword sequence that no online payment exists in the last year to obtain a matched keyword which is 'no risk exists in the last year'; (the judgment condition 'dangerous in the last year' after the ranking in the second parallel judgment condition is not required to be obtained, and the judgment condition after the ranking is required to be obtained for matching if the judgment condition before the ranking is not matched with the keyword in the keyword sequence);
5. deleting the keyword 'no risk in the last year' from the keyword sequence to obtain a new keyword sequence 'online payment', and simultaneously obtaining a third judgment condition 'online payment' pointed by a second judgment condition 'no risk in the last year' in a rule file set named 'Buddha mountain';
6. comparing the third judgment condition 'online payment' with the remaining last keyword in the keyword sequence 'online payment' to obtain matched judgment;
7. according to the matching result, obtaining a result corresponding to a composition rule file, namely a result of giving 100-element telephone charge, wherein the composition rule file comprises a plurality of judgment conditions, namely that the commercial insurance policy sum reaches 5000, no insurance is given in the last year and online payment is carried out according to the directional loading sequence;
8. the output result "give 100-yuan phone fee", indicates that the customer has won a prize of 100-yuan phone fee.
In the seventh embodiment, based on the sixth embodiment, as shown in fig. 10, the substep S43 specifically includes the following substeps:
s431, acquiring a first keyword in the keyword sequence as a current comparison keyword;
s432, judging whether the current judgment condition is matched with the current comparison keyword, if so, executing the step S435, and if not, executing the step S433;
s433, judging whether the current comparison keyword is the last keyword in the keyword sequence, if so, executing the step S435, and if not, executing the step S434;
s434, acquiring a keyword positioned behind the current comparison keyword in the keyword sequence as a new current comparison keyword, and executing the step S432;
and S435, ending.
In addition, the present invention relates to a computer-readable storage medium, in which a split call system 20 of a rule engine file is stored, where the split call system 20 of the rule engine file can be executed by one or more processors to implement the split call method of the rule engine file or the operation of the electronic device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.

Claims (8)

1. A split calling method of a rule engine file is characterized by comprising the following steps:
s0, when a new rule file is received, splitting the rule file into a plurality of judgment conditions and matching the judgment conditions with the same label, classifying the judgment conditions according to the label, storing the judgment conditions into a rule file set with a file name consistent with the label, matching the judgment conditions with a directional loading sequence, and associating the rule file consisting of the judgment conditions with a corresponding result;
s1, the rule engine server receives the information to be judged sent by the client;
s2, extracting keywords in the information to be judged;
s3, calling a corresponding rule file set from a preset rule file library according to the keywords, wherein the rule file set comprises a plurality of judgment conditions and results with directional relations; the corresponding rule file set is a rule file set with the name consistent with the keyword;
s4, sequentially loading judgment conditions contained in the rule file set according to a preset loading sequence and comparing the judgment conditions with the keywords;
and S5, outputting a result corresponding to the rule file formed by the judgment conditions corresponding to the keywords.
2. The method for split calling of a rule engine file according to claim 1, wherein step S0 specifically includes the following sub-steps:
s01, splitting the rule file into a combination of a plurality of judgment conditions according to semantics, and matching each judgment condition with a directional loading sequence;
s02, matching labels on one or more dimensions for each judgment condition;
s03, dividing all judgment conditions with labels according to preset classification dimensions and storing the judgment conditions into corresponding rule file sets, wherein the names of the rule file sets are labels matched with the judgment conditions in the classification dimensions;
s04, removing the duplication of the judgment conditions in the rule file set, and matching the ending direction and the starting direction of the loading sequence matched with the duplication-removing judgment conditions to the same judgment conditions;
and S05, associating the rule file consisting of a plurality of judgment conditions with the corresponding result.
3. The method for split calling of a rule engine file according to claim 2, wherein step S2 specifically includes the following sub-steps:
s21, splitting the information to be judged into a word sequence consisting of a plurality of words by using a word segmentation tool;
s22, generating a keyword sequence only containing keywords by removing stop words in the word sequence;
s23, extracting keywords corresponding to the classification dimensions in the keyword sequence, and arranging the keywords at the head of the keyword sequence;
and S24, outputting the sorted keyword sequence.
4. The method for split calling of a rule engine file according to claim 3, wherein step S3 specifically comprises the following sub-steps:
s31, extracting a first keyword in the keyword sequence;
s32, comparing the first keyword with the names of the rule file sets in sequence;
s33, judging whether the first keyword is matched with the name of the rule file set, if so, executing a step S34, and if not, executing a step S32;
and S34, calling a rule file set with the name matched with the first keyword, and deleting the first keyword from the keyword sequence.
5. The method for split calling of a rule engine file according to claim 4, wherein the step S4 specifically comprises the following sub-steps:
s41, acquiring a plurality of judgment conditions parallel in the first hierarchy in the called rule file set as the current hierarchy;
s42, loading the first judgment condition in the current level as the current judgment condition;
s43, judging whether the current judgment condition is matched with any keyword in the keyword sequence, if so, executing a step S45, and if not, executing a step S44;
s44, temporarily storing the current judgment condition, then loading the judgment condition behind the current judgment condition as a new current judgment condition, and executing the step S43;
s45, deleting the matched keywords from the keyword sequence, and resetting the current level to the judgment condition corresponding to the end point of the loading sequence of the current judgment condition;
s46, judging whether the keyword sequence has any keyword, if yes, executing a step S42, and if no, executing a step S47;
and S47, judging whether the rule file consisting of the plurality of temporarily stored judging conditions has a corresponding result, if so, outputting the result, and if not, directly ending.
6. The method for split calling of a rule engine file according to claim 5, wherein the substep S43 specifically comprises the following substeps:
s431, acquiring a first keyword in the keyword sequence as a current comparison keyword;
s432, judging whether the current judgment condition is matched with the current comparison keyword, if so, executing the step S435, and if not, executing the step S433;
s433, judging whether the current comparison keyword is the last keyword in the keyword sequence, if so, executing the step S435, and if not, executing the step S434;
s434, acquiring a keyword positioned behind the current comparison keyword in the keyword sequence as a new current comparison keyword, and executing the step S432;
and S435, ending.
7. An electronic device comprising a memory and a processor, wherein the memory has stored thereon a split call system of a rules engine file executable by the processor, the split call system of the rules engine file comprising:
the rule file splitting module is used for splitting a new rule file into a plurality of judgment conditions and matching the judgment conditions with the same label respectively when the new rule file is received, classifying the judgment conditions according to the label, storing the judgment conditions into a rule file set with the file name consistent with the label, matching the judgment conditions with a directional loading sequence, and associating the rule file consisting of the judgment conditions with a corresponding result;
the rule file library is used for storing a rule file set, and the rule file set comprises a plurality of judgment conditions and results with directional relations;
the receiving module is used for receiving information to be judged sent by the client;
the extraction module is used for extracting keywords in the information to be judged;
the calling module is used for calling a corresponding rule file set from a preset rule file library according to the keywords; the corresponding rule file set is a rule file set with the name consistent with the keyword;
the loading comparison module is used for sequentially loading the judgment conditions contained in the rule file set and comparing the judgment conditions with the keywords according to a preset loading sequence;
and the output module is used for outputting a result corresponding to the rule file formed by the judgment conditions conforming to the keywords.
8. A computer-readable storage medium having stored therein a split call system of a rules engine file, the split call system of a rules engine file executable by at least one processor to cause the at least one processor to perform the steps of the method of split call of a rules engine file as claimed in any one of claims 1 to 6.
CN201711186783.7A 2017-11-23 2017-11-23 Splitting and calling method of rule engine file, electronic device and storage medium Active CN108509478B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201711186783.7A CN108509478B (en) 2017-11-23 2017-11-23 Splitting and calling method of rule engine file, electronic device and storage medium
PCT/CN2018/083085 WO2019100646A1 (en) 2017-11-23 2018-04-13 Method, electronic device, and storage medium for splitting and calling rule engine file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711186783.7A CN108509478B (en) 2017-11-23 2017-11-23 Splitting and calling method of rule engine file, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN108509478A CN108509478A (en) 2018-09-07
CN108509478B true CN108509478B (en) 2021-04-27

Family

ID=63374724

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711186783.7A Active CN108509478B (en) 2017-11-23 2017-11-23 Splitting and calling method of rule engine file, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN108509478B (en)
WO (1) WO2019100646A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110737439B (en) * 2019-10-18 2022-07-22 四川长虹电器股份有限公司 Equipment control system and method based on rule file

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002073721A (en) * 2000-09-05 2002-03-12 Nec Microsystems Ltd Device and method for parallel processiang for layout verification, and recording medium
US8799448B2 (en) * 2006-12-20 2014-08-05 Microsoft Corporation Generating rule packs for monitoring computer systems
CN101582064B (en) * 2008-05-15 2011-12-21 阿里巴巴集团控股有限公司 Method and system for processing enormous data
CN102236664B (en) * 2010-04-28 2016-04-13 百度在线网络技术(北京)有限公司 Based on the normalized searching system of semanteme, search method and information processing method
CN103473696A (en) * 2013-09-03 2013-12-25 周吉 Method and system for collecting, analyzing and distributing internet business information
US11182350B2 (en) * 2014-12-09 2021-11-23 International Business Machines Corporation Intelligent XML file fragmentation
JP2016170745A (en) * 2015-03-16 2016-09-23 株式会社リコー Terminal device, program, output system, and output method
CN105447166A (en) * 2015-12-03 2016-03-30 沈文策 Keyword based information search method and system
CN105630617A (en) * 2015-12-28 2016-06-01 山东中创软件工程股份有限公司 Business processing method and system based on rule engine
CN105786950A (en) * 2015-12-30 2016-07-20 北京锐安科技有限公司 Method and device for processing data
CN107203557A (en) * 2016-03-17 2017-09-26 伊姆西公司 The method and device of object to be searched for handling
CN107346312A (en) * 2016-05-05 2017-11-14 中国移动通信集团内蒙古有限公司 A kind of big data processing method and system
CN106980636B (en) * 2016-07-22 2020-04-03 平安科技(深圳)有限公司 Policy data processing method and device
CN106445626B (en) * 2016-09-30 2020-03-06 北京奇虎科技有限公司 Data analysis method and device
CN106547896A (en) * 2016-11-04 2017-03-29 广州唯品会信息科技有限公司 Rules engine service processing system and method

Also Published As

Publication number Publication date
CN108509478A (en) 2018-09-07
WO2019100646A1 (en) 2019-05-31

Similar Documents

Publication Publication Date Title
CN111831920A (en) User demand analysis method and device, computer equipment and storage medium
CN113360043A (en) Service processing method and device
CN110377276B (en) Source code file management method and device
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium
CN108509478B (en) Splitting and calling method of rule engine file, electronic device and storage medium
CN112363814A (en) Task scheduling method and device, computer equipment and storage medium
CN112286968A (en) Service identification method, equipment, medium and electronic equipment
CN114841267B (en) Real-time prediction method, device, electronic equipment and computer program product
CN113792232B (en) Page feature calculation method, page feature calculation device, electronic equipment, page feature calculation medium and page feature calculation program product
CN114896298A (en) Same type label data prediction method, terminal device and storage medium
CN111585897B (en) Request route management method, system, computer system and readable storage medium
CN113722321A (en) Data export method and device and electronic equipment
CN112257106A (en) Data detection method and device
CN112000462A (en) Data processing method and device based on shared peripheral resources
CN116755805B (en) Resource optimization method and device applied to C++, and resource optimization device applied to C++
CN111414162B (en) Data processing method, device and equipment thereof
CN111078714B (en) Data processing method and device
CN111191473B (en) Method and device for acquiring translation text file
CN115270757A (en) Text recognition method and device, electronic equipment and storage medium
CN117278641A (en) Service request processing method, device, server and storage medium
CN115951901A (en) Software deployment method and device
CN115526731A (en) Task batch processing method and device, computer equipment and storage medium
CN118587074A (en) User value identification method, device, equipment and storage medium
CN117689132A (en) Processing method and device of flow form, electronic equipment and storage medium
CN113515592A (en) Text prediction method and device, electronic equipment and storage medium

Legal Events

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