CN111381974A - Method for optimizing Drools response time in large-scale high-concurrency scene - Google Patents

Method for optimizing Drools response time in large-scale high-concurrency scene Download PDF

Info

Publication number
CN111381974A
CN111381974A CN201811617281.XA CN201811617281A CN111381974A CN 111381974 A CN111381974 A CN 111381974A CN 201811617281 A CN201811617281 A CN 201811617281A CN 111381974 A CN111381974 A CN 111381974A
Authority
CN
China
Prior art keywords
response time
drools
optimizing
scale high
scene
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811617281.XA
Other languages
Chinese (zh)
Inventor
王聪
郑高峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuxi Zhidao Anying Technology Co ltd
Original Assignee
Wuxi Zhidao Anying Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuxi Zhidao Anying Technology Co ltd filed Critical Wuxi Zhidao Anying Technology Co ltd
Priority to CN201811617281.XA priority Critical patent/CN111381974A/en
Publication of CN111381974A publication Critical patent/CN111381974A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server
    • 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
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0639Performance analysis of employees; Performance analysis of enterprise or organisation operations
    • G06Q10/06398Performance of employee with respect to a job function
    • 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
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/105Human resources
    • G06Q10/1053Employment or hiring

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method for optimizing Drools response time under a large-scale high-concurrency scene, which comprises the following steps of: s1: partitioning by using service units, and dividing the whole rule set into N from 1; s2: partitioning by using scene units, and dividing the whole rule set into N/M from N; s3: constant data are loaded in advance by using a data cache mechanism, and judgment and matching are carried out through the data constants loaded in advance; s4: in the matching stage, the rules are matched through basic operators such as greater than, less than or equal to, and built-in functions or custom functions are not used as much as possible; s5: and in the rule engine matching result collection stage, setting a result through assignment operation. The invention divides the knowledge set of the rule horizontally and vertically through the service scene, thereby reducing the scale of the rule set and greatly shortening the response time.

Description

Method for optimizing Drools response time in large-scale high-concurrency scene
Technical Field
The invention mainly relates to the field of open source business rule engines, in particular to a method for optimizing Drools response time under a large-scale high-concurrency scene.
Background
Drools (jboss rules) is an open source business rules engine with easy access to enterprise policies, easy tuning, and easy management, and meets industry standards with high speed and efficiency.
The predecessor of Drools is an open source item of Codehaus, and is an implementation of the rules engine based on charles forgy' RETE algorithm tailored for JAVA volume. RETE with OO interfaces allows for a more natural expression of business rules. And native languages such as Java and Groovy are used for judging and executing statements, so that a programmer can easily transit and transplant, and a learning curve is low. However, in an actual business scenario, it is found that the response time of a rule set of a rule engine is rapidly increased on occasions larger than a certain scale, so that the TPS and the response time of a service are affected.
The published Chinese invention patent, application number CN201710414953.6, patent name: a method and a system for realizing a business rule engine are disclosed, which are applied for the day: 20170605, the invention relates to a method and a system for implementing a business rule engine, and belongs to the technical field of computer application. The method comprises the following steps: monitoring the operation of a special web platform, determining a new receiving event, performing matching operation on the new receiving event and rule conditions in the business rules aiming at each business rule in a business rule base, determining the rule conditions matched with the new receiving event, and performing multi-process execution on rule actions corresponding to the rule conditions. In addition, an implementation system of the business rule engine is also provided. The method and the system for realizing the business rule engine can shorten the response time for realizing the business rule engine.
Disclosure of Invention
The invention provides a method for optimizing Drools response time in a large-scale high-concurrency scene, aiming at the defects of the prior art, and the method for optimizing Drools response time in the large-scale high-concurrency scene comprises the following steps:
s1: partitioning by using service units, and dividing the whole rule set into N from 1;
s2: partitioning by using scene units, and dividing the whole rule set into N/M from N;
s3: constant data are loaded in advance by using a data cache mechanism, and judgment and matching are carried out through the data constants loaded in advance;
s4: in the matching stage, the rules are matched through basic operators such as greater than, less than or equal to, and built-in functions or custom functions are not used as much as possible;
s5: and in the rule engine matching result collection stage, setting a result through assignment operation.
Preferably, the overall rule set includes rules of a hundred thousand size.
Preferably, each rule performs at least 10 to 20 basic operations.
Preferably, N in step S1 denotes the number of organization clients.
Preferably, M in step S2 denotes the number of scenes.
Preferably, M equals 6 in step S2, 1-agency balance commission, 2-clerk balance commission, 3-clerk score, 4-recommendation reward, 5-superior league performance, 6-superior league performance, respectively.
Preferably, after the steps S1-S5, the response time is shortened to 100-200 ms.
The invention has the beneficial effects that: and through a service scene, the knowledge set of the rule is horizontally and vertically split, and a constant judgment statement is used in a rule file, so that the scale of the rule set is reduced, and the response time is greatly shortened.
Drawings
FIG. 1 is a block diagram of the present invention;
Detailed Description
The invention comprises the following steps:
s1: partitioning by using service units, and dividing the whole rule set into N from 1;
in this embodiment, the service unit is an insurance agency client of a cloud product, and the current cloud product client is approximately 500. The meta-business method is to put all rule sets of all organization clients into one knowledge set, and to reduce the size of the set by separating the set by the organization clients. Where N is the number of organization clients, equal to 500.
S2: partitioning by using scene units, and dividing the whole rule set into N/M from N;
in this embodiment, the service scenario includes: 1-agency settlement commission, 2-clerk settlement commission, 3-clerk score, 4-recommendation reward, 5-superior peer performance, 6-superior peer performance, etc. The meta-business method is to put all rule sets of scenes into a knowledge set, and further reduce the scale of the set by partitioning the knowledge set in an organization client again by using scene units, wherein M is the number of scenes and is equal to 6.
S3: constant data are loaded in advance by using a data cache mechanism, and judgment and matching are carried out through the data constants loaded in advance;
s4: in the matching stage, the rules are matched through basic operators such as greater than, less than or equal to, and built-in functions or custom functions are not used as much as possible;
s5: a rule engine matching result collection stage, wherein a result is set through assignment operation;
in use, the steps S1 and S2 can avoid the problem of low matching efficiency caused by overlarge rule set, and the efficiency of the java rule engine in matching is improved.
In use, the step S3 is implemented in a mode of using the pre-loaded constants, a variable utilization mode is avoided, java needs to newly apply for a variable space, and after the variable space is used, the variable space is destroyed and garbage is recycled, and the space is used for replacing time, so that the efficiency is improved.
In use, the step S4 can avoid using contacts, equials and even embedded functions in the drools drl, reduce the unnecessary overhead of function call, and improve the execution efficiency of the java rule engine during matching.
Through the optimization of the points, the response time of rule matching is improved from about 2 seconds to about 100-200 ms.
Preferably in this implementation, the overall rule set includes rules of a hundred thousand size. Wherein, each customer generally uses about 5 scenes of the cloud service on average, and each scene has 50 rules on average. Cloud services currently have 500 institutional customers.
According to steps S1 and S2, the number of rule sets is first divided into 500 × 5 to 2500 rules on a scale of 50 rules from a hundred thousand. Although there is no change in the total amount and the number of rule sets that need to be maintained increases, the size of matching of each rule changes from a size of one hundred thousand to a size of 50. And the matching efficiency of the rule is greatly improved by optimizing on the single matching scale.
In this embodiment, each rule preferably performs at least 10 to 20 basic operations.
Under the combined action of the S3 and the S4, although the memory overhead of the application is increased (a plurality of constants are increased), the function call overhead is reduced, and the matching efficiency of the rule is greatly improved by optimizing the word matching time.
The above-described embodiments are merely illustrative of the principles and utilities of the present patent application and are not intended to limit the present patent application. Modifications and variations can be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of this patent application. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical concepts disclosed in the present application shall be covered by the claims of this patent application.

Claims (7)

1. A method for optimizing Drools response time in a large-scale high-concurrency scene is characterized by comprising the following steps:
s1: partitioning by using service units, and dividing the whole rule set into N from 1;
s2: partitioning by using scene units, and dividing the whole rule set into N/M from N;
s3: constant data are loaded in advance by using a data cache mechanism, and judgment and matching are carried out through the data constants loaded in advance;
s4: in the matching stage, the rules are matched through basic operators such as greater than, less than or equal to, and built-in functions or custom functions are not used as much as possible;
s5: and in the rule engine matching result collection stage, setting a result through assignment operation.
2. The method for optimizing Drools response time in large-scale high-concurrency scene as claimed in claim 1, wherein: the overall rule set includes rules of a hundred thousand size.
3. The method for optimizing Drools response time in large-scale high-concurrency scene as claimed in claim 2, wherein: each rule performs at least 10 to 20 basic operations.
4. The method for optimizing Drools response time in large-scale high-concurrency scene as claimed in claim 3, wherein: n in the step S1 denotes the organization client number.
5. The method for optimizing Drools response time in large-scale high-concurrency scene according to claim 4, wherein: m in the step S2 denotes the number of scenes.
6. The method for optimizing Drools response time in large-scale high-concurrency scenario according to claim 5, wherein: m equals 6 in said step S2, 1-agency balance commission, 2-clerk balance commission, 3-clerk score, 4-recommendation award, 5-superior league performance, 6-superior league performance, respectively.
7. The method for optimizing Drools response time in large-scale high-concurrency scenario according to claim 6, wherein: after the steps S1-S5, the response time is shortened to 100 and 200 ms.
CN201811617281.XA 2018-12-28 2018-12-28 Method for optimizing Drools response time in large-scale high-concurrency scene Pending CN111381974A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811617281.XA CN111381974A (en) 2018-12-28 2018-12-28 Method for optimizing Drools response time in large-scale high-concurrency scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811617281.XA CN111381974A (en) 2018-12-28 2018-12-28 Method for optimizing Drools response time in large-scale high-concurrency scene

Publications (1)

Publication Number Publication Date
CN111381974A true CN111381974A (en) 2020-07-07

Family

ID=71214664

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811617281.XA Pending CN111381974A (en) 2018-12-28 2018-12-28 Method for optimizing Drools response time in large-scale high-concurrency scene

Country Status (1)

Country Link
CN (1) CN111381974A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112990863A (en) * 2021-03-09 2021-06-18 北京思特奇信息技术股份有限公司 Real-time reward settlement system and method based on Drools rule

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777142A (en) * 2009-09-01 2010-07-14 厦门东南融通系统工程有限公司 Method for converting rules and regulations of enterprises and public institutions into computer-recognizable programs
US20130132326A1 (en) * 2011-11-22 2013-05-23 International Business Machines Corporation Rules engine ecosystem
CN107644323A (en) * 2017-09-30 2018-01-30 成都莲合软件科技有限公司 A kind of intelligent checks system of service-oriented stream

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777142A (en) * 2009-09-01 2010-07-14 厦门东南融通系统工程有限公司 Method for converting rules and regulations of enterprises and public institutions into computer-recognizable programs
US20130132326A1 (en) * 2011-11-22 2013-05-23 International Business Machines Corporation Rules engine ecosystem
CN107644323A (en) * 2017-09-30 2018-01-30 成都莲合软件科技有限公司 A kind of intelligent checks system of service-oriented stream

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112990863A (en) * 2021-03-09 2021-06-18 北京思特奇信息技术股份有限公司 Real-time reward settlement system and method based on Drools rule

Similar Documents

Publication Publication Date Title
US20180253676A1 (en) Automatic analysis of a technical capability
US20220391260A1 (en) Method and Apparatus for Creating Container, Device, Medium, and Program Product
US20190324809A1 (en) Method, apparatus, and computer program product for processing computing task
CN113342345A (en) Operator fusion method and device of deep learning framework
US11677877B2 (en) Utilizing machine learning with call histories to determine support queue positions for support calls
US10838798B2 (en) Processing system for performing predictive error resolution and dynamic system configuration control
US10963298B2 (en) Method, device and computer-readable for managing virtual machines
US20210216308A1 (en) Utilizing machine learning to identify and correct differences in application programming interface (api) specifications
CN110858172A (en) Automatic test code generation method and device
US20140195683A1 (en) Predicting resource provisioning times in a computing environment
CN112015402A (en) Method and device for quickly establishing service scene and electronic equipment
US20240112229A1 (en) Facilitating responding to multiple product or service reviews associated with multiple sources
US20230043882A1 (en) Method for assisting launch of machine learning model
US11238363B2 (en) Entity classification based on machine learning techniques
CN114911492A (en) Inference service deployment method, device, equipment and storage medium
US10757190B2 (en) Method, device and computer program product for scheduling multi-cloud system
CN112783508B (en) File compiling method, device, equipment and storage medium
CN113220367A (en) Applet running method and device, electronic equipment and storage medium
CN111381974A (en) Method for optimizing Drools response time in large-scale high-concurrency scene
CN113608751A (en) Operation method, device and equipment of reasoning service platform and storage medium
CN111951112A (en) Intelligent contract execution method based on block chain, terminal equipment and storage medium
US10768901B2 (en) Converting code of a first code type on a mainframe device in phases to code of a second code type
CN104317660A (en) Bank parameter managing system
CN115277840A (en) Data migration method and device, electronic equipment and computer readable medium
CN111798309A (en) Wind-controlled variable processing system, method and readable 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200707

RJ01 Rejection of invention patent application after publication