WO2020155735A1 - Rule update method and apparatus for rule engine system, and computer device - Google Patents

Rule update method and apparatus for rule engine system, and computer device Download PDF

Info

Publication number
WO2020155735A1
WO2020155735A1 PCT/CN2019/116334 CN2019116334W WO2020155735A1 WO 2020155735 A1 WO2020155735 A1 WO 2020155735A1 CN 2019116334 W CN2019116334 W CN 2019116334W WO 2020155735 A1 WO2020155735 A1 WO 2020155735A1
Authority
WO
WIPO (PCT)
Prior art keywords
executable file
rule
update
file
business
Prior art date
Application number
PCT/CN2019/116334
Other languages
French (fr)
Chinese (zh)
Inventor
宋杰
Original Assignee
平安科技(深圳)有限公司
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
Priority to CN201910101290.1A priority Critical patent/CN109918079B/en
Priority to CN201910101290.1 priority
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020155735A1 publication Critical patent/WO2020155735A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

Provided are a rule update method and apparatus for a rule engine system, and a computer device and a storage medium. The method comprises: acquiring an update instruction for updating a service rule in a rule engine system; reading, according to the update instruction and from a specified database, a target executable file of the latest version; acquiring, according to the target executable file, a first service type corresponding to the service rule; calculating an importance coefficient corresponding to the first service type according to weights corresponding to all the services in the first service type and a usage amount corresponding to each service in the first service type; determining whether the importance coefficient is greater than a preset threshold value; and if so, updating the target executable file in an independent server environment, and if not, updating the target executable file in a public server environment. The method is convenient and fast, and there is no need to manually deploy service rules relying on experience, and the cross influence of important service rules can be prevented while resources can be economized.

Description

规则引擎系统的规则更新方法、装置和计算机设备Rule update method, device and computer equipment of rule engine system
本申请要求于2019年1月31日提交中国专利局、申请号为201910101290.1,申请名称为“规则引擎系统的规则更新方法、装置和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on January 31, 2019, the application number is 201910101290.1, and the application title is "Rule Update Method, Apparatus and Computer Equipment of the Rule Engine System", the entire content of which is by reference Incorporated in this application.
技术领域Technical field
本申请涉及到数据处理的技术领域,特别是涉及到一种规则引擎系统的规则更新方法、装置、计算机设备和存储介质。This application relates to the technical field of data processing, in particular to a rule update method, device, computer equipment and storage medium of a rule engine system.
背景技术Background technique
规则引擎是一个将业务决策从应用程序代码中分离出来,并使用预定义的语义模块编写业务决策的组件,它接受数据输入,解释业务规则,并根据业务规则做出业务决策,规则引擎可应用在各种业务中,但是对于不同业务,其业务规则代码编写完成后,再次进行更新会较为麻烦。The rule engine is a component that separates business decisions from application code and uses predefined semantic modules to write business decisions. It accepts data input, interprets business rules, and makes business decisions based on business rules. The rules engine can be applied In various businesses, but for different businesses, it will be more troublesome to update again after the business rule code is written.
现有的规则引擎系统更新业务规则时,首先需要导出规则集,然后线下修改规则集,再将修改后的规则集打成压缩包,然后上传到规则编译平台,通过人工触发编译进而生成可执行的包,最后下载可执行包来部署才能实现更新,不但步骤繁琐,耗时耗力,还不能实时更新,对于业务市场变化,对应业务规则调整响应较慢,对于不同业务,只能人为地依据经验将对应的业务规则部署更新到适应的服务器环境中,效率慢且容易出错。When the existing rule engine system updates business rules, it first needs to export the rule set, then modify the rule set offline, and then zip the modified rule set into a compressed package, then upload it to the rule compilation platform, and manually trigger the compilation to generate the The executable package is downloaded and the executable package is finally deployed to achieve the update. Not only is the steps cumbersome, time-consuming and labor-intensive, but also cannot be updated in real time. For business market changes, the response to business rules adjustment is slow. For different businesses, it can only be artificially Deploying and updating the corresponding business rules to an adapted server environment based on experience is slow and error-prone.
发明内容Summary of the invention
本申请的主要目的为提供一种提高效率的规则引擎系统的规则更新方法、装置、计算机设备和存储介质,旨在解决现有规则引擎系统中业务规则更新效率慢的问题。The main purpose of this application is to provide a rule updating method, device, computer equipment, and storage medium of a rule engine system that improves efficiency, and aims to solve the problem of slow update efficiency of business rules in the existing rule engine system.
基于上述发明目标,本申请提出一种规则引擎系统的规则更新方法,包括:Based on the foregoing invention objectives, this application proposes a rule update method for a rule engine system, including:
获取对规则引擎系统中的业务规则进行更新的更新指令;Obtain update instructions for updating business rules in the rule engine system;
依据所述更新指令从指定数据库中读取最新版本的目标可执行文件,所述目标可执行文件为预设业务规则集生成的且可在服务器中运行的文件;Reading the latest version of the target executable file from a designated database according to the update instruction, where the target executable file is a file that is generated by a preset business rule set and can be run on the server;
依据所述目标可执行文件获取对应所述业务规则的业务类型,并记为第一业务类型,其中,同一种业务类型中包括有多个不同的业务;Obtain the business type corresponding to the business rule according to the target executable file, and record it as the first business type, where the same business type includes multiple different businesses;
依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务 对应的使用量计算出对应所述第一业务类型的重要系数;Calculating an important coefficient corresponding to the first service type according to the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type;
判断所述重要系数是否大于预设阀值;Judging whether the important coefficient is greater than a preset threshold;
若是,则将所述目标可执行文件在独立服务器环境中进行更新,若否,则将所述目标可执行文件在公共服务器环境中进行更新。If yes, update the target executable file in a standalone server environment, if not, update the target executable file in a public server environment.
本申请还提供一种规则引擎系统的规则更新装置,包括:This application also provides a rule update device of the rule engine system, including:
获取指令单元,用于获取到对规则引擎系统中的业务规则进行更新的更新指令;The obtaining instruction unit is used to obtain the update instruction for updating the business rules in the rule engine system;
读取文件单元,用于依据所述更新指令从指定数据库中读取最新版本的目标可执行文件,所述目标可执行文件为预设业务规则集生成的且可在服务器中运行的文件;The file reading unit is configured to read the latest version of the target executable file from the designated database according to the update instruction, where the target executable file is a file that is generated by a preset business rule set and can be run on the server;
获取类型单元,用于依据所述目标可执行文件获取对应所述业务规则的业务类型,并记为第一业务类型,其中,同一种业务类型中包括有多个不同的业务;The obtaining type unit is used to obtain the service type corresponding to the business rule according to the target executable file and record it as the first service type, wherein the same service type includes multiple different services;
计算系数单元,用于依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数;The calculation coefficient unit is configured to calculate the important coefficient corresponding to the first service type according to the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type;
判断系数单元,用于判断所述重要系数是否大于预设阀值;The judgment coefficient unit is used to judge whether the important coefficient is greater than a preset threshold;
更新文件单元,用于判断所述重要系数大于预设阀值时,则将所述目标可执行文件在独立服务器环境中进行更新,若否,则将所述目标可执行文件在公共服务器环境中进行更新。The update file unit is used to update the target executable file in a stand-alone server environment when it is determined that the important coefficient is greater than a preset threshold; if not, then update the target executable file in a public server environment Update.
本申请还提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机可读指令,所述处理器执行所述计算机可读指令时实现上述方法的步骤。The present application also provides a computer device including a memory and a processor, the memory stores computer readable instructions, and the processor implements the steps of the above method when the computer readable instructions are executed.
本申请还提供了一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现上述方法的步骤。The present application also provides a computer-readable storage medium on which computer-readable instructions are stored, and when the computer-readable instructions are executed by a processor, the steps of the foregoing method are implemented.
本申请的有益效果为:在更新规则时直接读取可执行文件,然后依据计算出的规则系统的重要系数,将该可执行文件部署在对应的服务器环境中,方便快捷,无需人为地依靠经验去部署业务规则,且有针对性部署,节约资源的同时还可以避免重要的业务规则被交叉影响,另外还可以实时修改业务规则,快速响应业务市场的变化。The beneficial effects of this application are: directly read the executable file when updating the rules, and then deploy the executable file in the corresponding server environment according to the calculated important coefficients of the rule system, which is convenient and fast, without artificially relying on experience To deploy business rules and deploy them in a targeted manner, which saves resources while avoiding cross-influence of important business rules. In addition, business rules can be modified in real time to quickly respond to changes in the business market.
附图说明Description of the drawings
图1为本申请一实施例中规则引擎系统的规则更新方法的步骤示意图;FIG. 1 is a schematic diagram of the steps of a rule update method of a rule engine system in an embodiment of this application;
图2为本申请一实施例中规则引擎系统的规则更新装置的结构示意框图;2 is a schematic block diagram of the structure of a rule updating device of a rule engine system in an embodiment of the application;
图3为本申请一实施例的计算机设备的结构示意框图。FIG. 3 is a schematic block diagram of the structure of a computer device according to an embodiment of the application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the drawings.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the application, and not to limit the application.
参照图1,本实施例中的规则引擎系统的规则更新方法,包括:1, the rule update method of the rule engine system in this embodiment includes:
步骤S1:获取对规则引擎系统中的业务规则进行更新的更新指令;Step S1: Obtain an update instruction for updating the business rules in the rule engine system;
步骤S2:依据所述更新指令从指定数据库中读取最新版本的目标可执行文件,所述目标可执行文件为预设业务规则集生成的且可在服务器中运行的文件;Step S2: Read the latest version of the target executable file from the designated database according to the update instruction, where the target executable file is a file that is generated by a preset business rule set and can be run on the server;
步骤S3:依据所述目标可执行文件获取对应所述业务规则的业务类型,并记为第一业务类型,其中,同一种业务类型中包括有多个不同的业务;Step S3: Obtain the business type corresponding to the business rule according to the target executable file, and record it as the first business type, where the same business type includes multiple different businesses;
步骤S4:依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数;Step S4: Calculate the important coefficient corresponding to the first service type according to the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type;
步骤S5:判断所述重要系数是否大于预设阀值;Step S5: Determine whether the important coefficient is greater than a preset threshold;
步骤S6:若是,则将所述目标可执行文件部在独立服务器环境中进行更新,若否,则将所述目标可执行文件在公共服务器环境中进行更新。Step S6: If yes, update the target executable file part in an independent server environment, if not, update the target executable file in a public server environment.
如上述步骤S1所述,当获取到对规则引擎系统的业务规则进行更新的更新指令时,可依据更新指令对当前的业务规则进行更新,上述业务规则即为对应某一业务类型的规则数据,这些规则数据包括规则代码。上述更新指令可以依据用户发起的更新请求而生成,也可以是在规则引擎系统重启时自动触发而产生。As described in step S1 above, when an update instruction to update the business rules of the rule engine system is obtained, the current business rules can be updated according to the update instructions. The business rules are rule data corresponding to a certain business type. These rule data include rule codes. The aforementioned update instruction can be generated based on an update request initiated by a user, or can be automatically triggered when the rule engine system restarts.
如上述步骤S2所述,上述目标可执行文件为由预设的业务规则集生成的且可在服务器中运行的文件,如上述文件为可进行运行部署的jar包,该目标可执行文件由系统依据用户输入的规则参数生成,并存储在指定的数据库中,如存储在MongoDB数据库。As described in step S2 above, the target executable file is a file that is generated by a preset business rule set and can be run on the server. For example, the file is a jar package that can be run and deployed, and the target executable file is generated by the system It is generated according to the rule parameters entered by the user and stored in a specified database, such as a MongoDB database.
如上述步骤S3所述,上述规则引擎系统的业务规则应用到不同的业务,而不同的业务当中部分业务可采用同一种业务规则,故而可将这些不同的业务分类,得到多个业务类型,且每种业务类型包括有多个不同的业务,每个业务类型均对应一种业务规则。由于目标可执行文件由用户输入的规则参数生成,而规则参数中包含有业务信息,从该信息中可得到对应的业务类型,故而依据目标可执行文件可获取得到对应的该业务规则的业务类型,本实施例中为了便于表述将该业务类型记为第一业务类型。As mentioned in step S3 above, the business rules of the rule engine system are applied to different businesses, and some businesses in different businesses can use the same business rules, so these different businesses can be classified to obtain multiple business types, and Each business type includes multiple different businesses, and each business type corresponds to a business rule. Since the target executable file is generated by the rule parameters entered by the user, and the rule parameters contain business information, the corresponding business type can be obtained from this information, so the corresponding business type of the business rule can be obtained according to the target executable file In this embodiment, for ease of presentation, the service type is recorded as the first service type.
如上述步骤S4所述,可通过计算出第一业务类型的重要系数,然后依据重要系数来更新上述业务规则,由于业务类型的重要程度不同,在进行更新时,会将其部署到不同服务器环境中,而业务类型的重要程度由其包含的各个业务决定,例如在一个业务类型中包含有金融交易、普通交易、核心业务以及非核心业务四种业务,其中金融交易较为重要, 则权重也相对高。故而可通过第一业务类型中所有业务的重要程度,即预设的对应各业务的权重来计算上述重要系数。同时为了保证业务规则部署后运行顺畅,需要知道第一业务类型的使用量,以便更好分配更新到对应服务器环境中,故而需要第一业务类型中各业务的使用量来计算上述重要系数,综上,在更新之前,无需人为凭经验去分配部署,直接依据第一业务类型中所有业务的权重,以及第一业务类型中各业务对应的使用量计算出对应第一业务类型的重要系数,再依据重要系数来分配更新到适用的服务器环境中。As described in step S4 above, the important coefficient of the first service type can be calculated, and then the above-mentioned business rules can be updated according to the important coefficient. Since the importance of the service type is different, it will be deployed to different server environments when updating. The importance of a business type is determined by the various businesses it contains. For example, a business type includes financial transactions, ordinary transactions, core businesses, and non-core businesses. Among them, financial transactions are more important, and their weights are also relatively important. high. Therefore, the above-mentioned important coefficient can be calculated by the importance of all services in the first service type, that is, the preset weights corresponding to each service. At the same time, in order to ensure the smooth operation of the business rules after deployment, it is necessary to know the usage of the first service type in order to better allocate updates to the corresponding server environment. Therefore, the usage of each service in the first service type is required to calculate the above important coefficients. Before the update, there is no need to manually allocate deployment based on experience, and directly calculate the important coefficient corresponding to the first service type based on the weight of all services in the first service type and the corresponding usage of each service in the first service type. According to the important factor to allocate updates to the applicable server environment.
如上述步骤S5-S6所述,上述在目标可执行文件在服务器环境中进行更新,可通过将目标可执行文件在服务器中部署来实现。由于不同的业务规则,更新时会部署到不同的服务器环境中,而服务器环境分为独立服务器环境以及公共服务器环境,其中部署在独立服务器环境中的业务规则,可单独在该独立环境中运行,而部署在公共服务器环境中的业务规则,则可以部署多个不同的业务规则,多个业务规则同时运行,这样有针对性的部署,不但可以节省资源同时也可以避免运行时,重要的业务规则被不重要的业务规则交叉影响,故而重要的业务规则需要部署在独立服务器环境中,不重要的业务规则可以部署在公共服务器环境中,所以获取到对应业务规则的业务类型之后,可依据业务类型中所有业务对应的权重,以及业务类型中各业务对应的使用量计算出对应该业务类型的重要系数,重要系数越高,表明该业务类型越重要,当重要系数大于预设阀值,则可将对应该业务类型的业务规则部署到独立服务器环境,否则可直接部署在公共服务器环境。As described in the above steps S5-S6, the above-mentioned updating of the target executable file in the server environment can be achieved by deploying the target executable file in the server. Due to different business rules, the update will be deployed to different server environments. The server environments are divided into independent server environments and public server environments. The business rules deployed in the independent server environment can be run in the independent environment separately. For business rules deployed in a public server environment, multiple different business rules can be deployed, and multiple business rules run at the same time. This targeted deployment not only saves resources, but also avoids important business rules at runtime. Cross-influenced by unimportant business rules, so important business rules need to be deployed in a separate server environment, and unimportant business rules can be deployed in a public server environment, so after obtaining the business type corresponding to the business rule, you can base it on the business type The corresponding weights of all businesses in the business type and the corresponding usage of each business in the business type calculate the important coefficient corresponding to the business type. The higher the important coefficient, the more important the business type is. When the important coefficient is greater than the preset threshold, you can Deploy the business rules corresponding to the business type to an independent server environment, otherwise it can be directly deployed in a public server environment.
在一个实施例中,利用以下公式计算出所述重要系数:In one embodiment, the important coefficient is calculated using the following formula:
R=(W 1+W 2+…+W n)/(π*W 1/2arctan(C 1)+π*W 2/2arctan(C 2)+…+π*W n/2arctan(C n)); R=(W 1 +W 2 +…+W n )/(π*W 1 /2arctan(C 1 )+π*W 2 /2arctan(C 2 )+…+π*W n /2arctan(C n ) );
其中,所述第一业务类型中预设有n个业务,R为所述重要系数,W为所述第一业务类型中的各业务的权重,C为所述第一业务类型中的各业务的使用量。Wherein, there are preset n services in the first service type, R is the important coefficient, W is the weight of each service in the first service type, and C is each service in the first service type Usage.
上述重要系数可通过上述业务类型的各个业务的权重以及各业务的使用量来计算,上述权重可由用户预设,使用量可通过对应的业务系统获取,本实施例中,上述第一业务类型预设有四个业务,分别为金融交易、普通交易、核心业务以及非核心业务,则W1、W2、W3、W4依次为金融交易、普通交易、核心业务以及非核心业务类型的权重,其中W1>W2>W3>W4,c1、c2、c3、c4依次为上述金融交易、普通交易、核心业务以及非核心业务的使用量。通过上述公式计算出第一业务类型的重要系数,该重要系统在0与1之间,重要系数越高说明该第一业务类型越重要,这时可以将重要系数与预设阀值对比,本实施例中,上述预设阀值可为0.7,当超过该阀值,则可将上述目标可执行文件部署在 独立服务器环境中,若不超过预设阀值,则说明该规则系统不重要,则可部署在公共服务环境中。The above-mentioned important coefficients can be calculated by the weight of each service of the above-mentioned service type and the usage of each service. The above-mentioned weight can be preset by the user, and the usage can be obtained through the corresponding service system. In this embodiment, the aforementioned first service type is predicted There are four businesses, namely financial transaction, ordinary transaction, core business and non-core business. W1, W2, W3, W4 are the weights of financial transaction, ordinary transaction, core business and non-core business type in turn, where W1> W2>W3>W4, c1, c2, c3, and c4 are the usage of the above-mentioned financial transactions, ordinary transactions, core business, and non-core business in turn. The important coefficient of the first service type is calculated by the above formula. The important system is between 0 and 1. The higher the important coefficient, the more important the first service type. At this time, the important coefficient can be compared with the preset threshold. In an embodiment, the preset threshold may be 0.7. When the threshold is exceeded, the target executable file can be deployed in an independent server environment. If the threshold is not exceeded, the rule system is not important. It can be deployed in a public service environment.
在一个实施例中,上述步骤S4之前,包括:In one embodiment, before step S4, the method includes:
步骤S41:调用所述第一业务类型中每种所述业务每次被使用的历史记录;Step S41: Invoke the historical record of each of the services used in the first service type;
步骤S42:依据所述历史记录统计每种业务的使用次数,将所述使用次数记为所述使用量。Step S42: Count the usage times of each service according to the historical records, and record the usage times as the usage amount.
本实施例中,由于需要第一业务类型中各业务的使用量来进行计算上述重要系数,故而在计算之前,需要获取到上述各业务的使用量,已知的是,每种业务在被使用的时候,均会被记录下来,例如记录在系统日志中,故而通过调用对应的日志,查看日志中的记录即可得到该种业务的使用次数,将使用次数记为上述使用量,通过调用并查看对应的记录可得到第一业务类型中每个业务的使用量。In this embodiment, since the usage amount of each service in the first service type is needed to calculate the above important coefficients, it is necessary to obtain the usage amount of each service before calculating. It is known that each service is being used. It will be recorded, for example, in the system log. Therefore, by calling the corresponding log and checking the record in the log, you can get the number of uses of this type of business. The number of uses is recorded as the amount of use mentioned above. Check the corresponding record to get the usage of each service in the first service type.
在一个实施例中,上述步骤S1之前,包括:In an embodiment, before step S1, the method includes:
步骤S01:接收用户在规则编辑界面中输入的规则参数,以形成目标规则文件;Step S01: receiving the rule parameters input by the user in the rule editing interface to form a target rule file;
步骤S02:将所述目标规则文件解析成目标prl文件;Step S02: Parse the target rule file into a target prl file;
步骤S03:将所述prl文件编译成所述目标可执行文件;Step S03: Compile the prl file into the target executable file;
步骤S04:将所述目标可执行文件存储至所述指定数据库中;Step S04: Store the target executable file in the designated database;
步骤S05:在所述指定数据库中依据历史文件将所述目标可执行文件通过tag标签定义为最新版本,所述历史文件为在将所述目标可执行文件存储在所述指定数据库之前,已经存储在所述指定数据库中的可执行文件。Step S05: Define the target executable file as the latest version through a tag tag in the designated database according to a historical file, the historical file being stored before storing the target executable file in the designated database The executable file in the specified database.
如上述步骤S01所述,上述规则编辑界面通过浏览器的方式展现,当接收到用户(如业务人员)输入的规则参数之后,将规则参数加入到由开发人员预设的业务规则集中,以形成对应上述规则参数的目标规则文件,用户填入不同的规则参数,则会形成不同的目标规则文件,其中,该目标规则文件以html的方式存在。本实施例中,当用户在规则编辑界面完成输入规则参数之后,可输入形成指令,系统即可依据形成指令将加入上述规则参数的业务规则集形成上述目标规则文件。As described in step S01 above, the rule editing interface is displayed through a browser. After receiving the rule parameters input by the user (such as a business person), the rule parameters are added to the set of business rules preset by the developer to form For the target rule file corresponding to the above rule parameters, the user fills in different rule parameters to form different target rule files, where the target rule file exists in the form of html. In this embodiment, after the user finishes inputting the rule parameters on the rule editing interface, he can input the formation instruction, and the system can form the target rule file according to the formation instruction to the business rule set added to the rule parameters.
如上述步骤S02所述,上述prl文件即为对应规则的代码程序,运行该代码程序可实现对应该业务规则的业务策略,本实施例中,将目标规则文件解析成目标prl文件具体可通过如下步骤:依据用户输入的参数将目标规则文件按逻辑关系分成when、then、else三部分,然后依次对这三部分进行打包合并形成上述目标prl文件。As described in the above step S02, the above prl file is the code program corresponding to the rule, and running the code program can realize the business strategy corresponding to the business rule. In this embodiment, parsing the target rule file into the target prl file can be specifically as follows Steps: According to the parameters input by the user, the target rule file is logically divided into three parts: when, then, and else, and then these three parts are packaged and merged to form the target prl file.
如上述步骤S03及步骤S04所述,将目标prl文件编译成上述目标可执行文件,即将 目标prl文件打成可以运行部署的jar包,该jar包即为上述目标可执行文件,然后将目标可执行文件存储至指定数据库中。As described in the above steps S03 and S04, the target prl file is compiled into the target executable file, that is, the target prl file is marked into a jar package that can be run and deployed, the jar package is the target executable file, and then the target can be The execution file is stored in the specified database.
如上述步骤S05所述,在上述指定数据库中,将上述目标可执行文件通过tag标签定义出该目标可执行文件的最新版本,该版本是在历史文件对应的旧版本的基础上进行定义的,该历史文件为在将目标可执行文件存储在指定数据库之前已经存在的可执行文件,如某可执行文件在第一次存储到MongoDB时,定义为第一代版本,之后用户再一次更新,重新存储至该MongoDB中的可执行文件定义为第二代版本,以此类推,每一次更新都在前一个版本的基础上往后定义其对应的版本,而上述目标可执行文件即是在指定数据库中的最新版本。As mentioned in step S05 above, in the above-mentioned designated database, the latest version of the target executable file is defined through the tag tag of the above-mentioned target executable file, and this version is defined on the basis of the old version corresponding to the historical file. The history file is an executable file that exists before the target executable file is stored in the specified database. For example, when an executable file is stored in MongoDB for the first time, it is defined as the first generation version, and the user updates it again afterwards. The executable file stored in the MongoDB is defined as the second-generation version, and so on, each update defines its corresponding version on the basis of the previous version, and the target executable file mentioned above is in the specified database The latest version in.
通过上述方法,当需要更新规则时,用户直接通过在规则编辑界面填入参数即可生成当前规则的最新版本,用户可实时修改规则,更新速度加快,效率大大提高,无需每次更新时在线下修改再上传,减少规则更新步骤,避免人为出错带来影响。Through the above method, when the rule needs to be updated, the user can directly generate the latest version of the current rule by filling in the parameters in the rule editing interface. The user can modify the rule in real time, the update speed is accelerated, and the efficiency is greatly improved. There is no need to go offline for each update. Modify and upload it to reduce the rule update steps and avoid the impact of human error.
在一个实施例中,上述步骤S6中,依据将目标可执行文件部署进而更新在独立服务器环境中的步骤,包括:In one embodiment, in the above step S6, the step of deploying and then updating the target executable file in a stand-alone server environment includes:
步骤S601:将所述独立服务器中已经部署的所述可执行文件替换成所述最新版本的目标可执行文件;Step S601: Replace the executable file that has been deployed in the independent server with the target executable file of the latest version;
步骤S602:对所述目标可执行文件进行部署以完成更新。Step S602: Deploy the target executable file to complete the update.
本实施例中,将该目标可执行文件下发至独立服务器之后,将独立服务器中旧版本的可执行文件替换成最新版本的目标可执行文件,即覆盖旧版本的可执行文件,并对目标可执行文件进行部署,从而实现规则更新,如依据用户请求,将服务器中第一代的规则替换成第二代规则,同理,在公共服务器环境中更新时,可将公共服务器中旧版本的可执行文件替换成最新版本的目标可执行文件,并对该目标可执行文件进行部署,以完成更新。In this embodiment, after the target executable file is distributed to the independent server, the old version of the executable file in the independent server is replaced with the latest version of the target executable file, that is, the old version of the executable file is overwritten, and the target executable file is Executable files are deployed to implement rule updates, such as replacing the first-generation rules in the server with second-generation rules according to user requests. Similarly, when updating in a public server environment, you can update the old version of the public server The executable file is replaced with the latest version of the target executable file, and the target executable file is deployed to complete the update.
在一个实施例中,上述步骤S6之后,包括:In an embodiment, after the above step S6, the method includes:
步骤S61:获取所述独立服务器返回的更新业务规则版本不适应的第一反馈信息所述更新业务规则版本不适应包括所述目标可执行文件在所述独立服务器环境中无法完成更新,以及所述目标可执行文件在所述独立服务器环境中更新完成之后无法运行;Step S61: Obtain the first feedback information returned by the independent server indicating that the updated business rule version is not compatible, including that the target executable file cannot be updated in the independent server environment, and The target executable file cannot run after the update is completed in the independent server environment;
步骤S62:依据所述第一反馈信息从所述指定数据库中重新读取所述可执行文件;Step S62: Re-read the executable file from the designated database according to the first feedback information;
步骤S63:将所述目标可执行文件替换成所述可执行文件,并对所述可执行文件进行部署;Step S63: Replace the target executable file with the executable file, and deploy the executable file;
或者,将所述目标可执行文件在公共服务器环境中进行更新的步骤之后,包括:Alternatively, after the step of updating the target executable file in a public server environment, the method includes:
步骤S61’:获取到所述公共服务器返回的更新业务规则版本不适应的第二反馈信息,所述更新业务规则版本不适应包括所述目标可执行文件在所述公共服务器环境中无法完成更新,以及所述目标可执行文件在所述公共服务器环境中更新完成之后无法运行;Step S61': Obtain the second feedback information returned by the public server that the updated business rule version is not suitable, and the updated business rule version is not suitable, including that the target executable file cannot be updated in the public server environment, And the target executable file cannot run after the update is completed in the public server environment;
步骤S62’:依据所述第二反馈信息从所述指定数据库中重新读取所述可执行文件;Step S62': re-read the executable file from the designated database according to the second feedback information;
步骤S63’:将所述目标可执行文件替换成所述可执行文件,并在所述公共服务器环境中对所述可执行文件进行部署。Step S63': Replace the target executable file with the executable file, and deploy the executable file in the public server environment.
本实施例中,由于目标可执行文件为更新后的版本,服务器并不一定会适应并能够运行该目标可执行文件,故而在将旧版本的可执行文件替换成最新版本的目标可执行文件之后,当该服务器在更新该版本不适合时,即更新对应的业务规则不适应,这时返回反馈信息,上述更新业务规则不适应的情况包括两种,一种为目标可执行文件在公共服务器环境中无法完成更新,一种为目标可执行文件在公共服务器环境中更新完成之后无法运行的情况,上述反馈信息为对应这两种情况的信息。获取该反馈信息之后,会从指定数据库中重新读取旧版板的可执行文件,将服务器中已更新的新版本替换成原来的旧版本可执行文件,避免出现更新不适合无法运行的情况,上述服务器可为独立服务器,也可为公共服务器。In this embodiment, since the target executable file is an updated version, the server may not necessarily adapt to and be able to run the target executable file, so after replacing the old version executable file with the latest version of the target executable file , When the server is not suitable for updating the version, that is, the update corresponding business rules are not suitable, then feedback information is returned. The above-mentioned updating business rules are not suitable for two situations, one is that the target executable file is in the public server environment The update cannot be completed in the middle, one is the case where the target executable file cannot run after the update is completed in the public server environment, and the above feedback information is information corresponding to these two cases. After obtaining the feedback information, the executable file of the old version of the board will be re-read from the specified database, and the updated new version in the server will be replaced with the original old version of the executable file to avoid the situation that the update is not suitable for running, as mentioned above The server can be an independent server or a public server.
另一实施例中,上述步骤S3之后,包括:In another embodiment, after the above step S3, the method includes:
步骤S7:判断对所述业务规则进行更新的更新方式是否为依据所述重要系数更新;Step S7: Determine whether the update method for updating the business rule is based on the important coefficient;
步骤S8:若更新方式为依据所述重要系数更新,则生成计算重要系数的计算指令;若更新方式不为依据所述重要系数更新,则判断所述第一业务类型对应的业务规则运行量是否超过预设运行量;Step S8: If the update method is to update based on the important coefficient, generate a calculation instruction for calculating the important coefficient; if the update method is not to update based on the important coefficient, then determine whether the business rule operation volume corresponding to the first business type is Exceed the preset operating volume;
步骤S9:若所述业务规则运行量超过预设运行量,则将所述目标可执行文件在所述独立服务器环境中进行更新,若所述业务规则运行量未超过预设运行量,则将所述目标可执行文件在所述公共服务器环境中进行更新。Step S9: If the running volume of the business rule exceeds the preset running volume, update the target executable file in the independent server environment, and if the running volume of the business rule does not exceed the preset running volume, then The target executable file is updated in the public server environment.
可以理解的是,除了通过重要系数来决定业务规则的部署环境,还可以直接根据运行量来决定业务规则的部署环境,故而在获得第一业务类型之后,首先判断业务规则的更新方式,更新方式有两种,分别为依据重要系数更新以及依据运行量更新,当更新方式为依据重要系数更新时,直接生成生成计算重要系数的计算指令,依据该计算指令进行计算重要系数,然后执行步骤S5-S6。当更新方式不是依据重要系数更新时,则可以依据运行量来判断,由于业务类型的不同,用户不一样,故而对应的业务规则的运行量也不一样,这时下发到运行的服务器也可不一样,运行量小的下发到公共服务器运行,由于运行量少,所以公共服务器可以同时运行多个可执行文件,而运行量大的则需要下发到单独服务器中, 由一个服务器单独运行,以保证程序正常运行。所以在步骤S8-S9中先判断目标可执行文件的运行量是否超过预设运行量,该预设运行量可参考服务器的运行量来设置,当超过预设运行量时,可将目标可执行文件下发至单独服务器,将旧版本的可执行文件替换成最新版本的目标可执行文件,并进行部署以完成更新,若没有超过预设运行量,则将目标可执行文件下发至公共服务器,将旧版本的可执行文件替换成最新版本的目标可执行文件,并对该目标可执行忘记进行部署以完成更新。It is understandable that in addition to determining the deployment environment of business rules through important factors, the deployment environment of business rules can also be determined directly based on the running volume. Therefore, after obtaining the first business type, first determine the update method of the business rule and the update method There are two types: update based on important coefficients and update based on operating volume. When the update method is based on important coefficients, directly generate calculation instructions for calculating important coefficients, calculate the important coefficients according to the calculation instructions, and then execute step S5- S6. When the update method is not updated based on the important coefficient, it can be judged based on the running volume. Because of the different business types and different users, the running volume of the corresponding business rules is also different. At this time, the running server can also be different. , The small running volume is sent to the public server to run. Because the running volume is small, the public server can run multiple executable files at the same time, while the large running volume needs to be sent to a separate server, which is run by a server alone. Ensure that the program runs normally. Therefore, in steps S8-S9, first determine whether the running volume of the target executable file exceeds the preset running volume. The preset running volume can be set with reference to the running volume of the server. When the preset running volume is exceeded, the target executable can be set The file is distributed to a separate server, the old version of the executable file is replaced with the latest version of the target executable file, and the deployment is performed to complete the update. If the preset running volume is not exceeded, the target executable file is distributed to the public server , Replace the old version of the executable file with the latest version of the target executable file, and forget to deploy the target executable to complete the update.
参照图2,本实施例中规则引擎系统的规则更新装置,包括:Referring to Fig. 2, the rule updating device of the rule engine system in this embodiment includes:
获取指令单元100,用于获取对规则引擎系统中的业务规则进行更新的更新指令;The obtaining instruction unit 100 is configured to obtain an update instruction for updating business rules in the rule engine system;
读取文件单元200,用于依据所述更新指令从指定数据库中读取最新版本的目标可执行文件,所述目标可执行文件为预设业务规则集生成的且可在服务器中运行的文件;The file reading unit 200 is configured to read a target executable file of the latest version from a designated database according to the update instruction, the target executable file being a file generated by a preset business rule set and that can be run on a server;
获取类型单元300,用于依据所述目标可执行文件获取对应所述业务规则的业务类型,并记为第一业务类型,其中,同一种业务类型中包括有多个不同的业务;The obtaining type unit 300 is configured to obtain the service type corresponding to the business rule according to the target executable file, and record it as the first service type, wherein the same service type includes multiple different services;
计算系数单元400,用于依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数;The calculation coefficient unit 400 is configured to calculate an important coefficient corresponding to the first service type according to the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type;
判断系数单元500,用于判断所述重要系数是否大于预设阀值;The judging coefficient unit 500 is used to judge whether the important coefficient is greater than a preset threshold;
更新文件单元600,用于判断所述重要系数大于预设阀值时,则将所述目标可执行文件在独立服务器环境中进行更新,若否,则将所述目标可执行文件在公共服务器环境中进行更新。The update file unit 600 is used to update the target executable file in an independent server environment when it is determined that the important coefficient is greater than a preset threshold; if not, update the target executable file in a public server environment To be updated.
如上述获取指令单元100所述,当获取到对规则引擎系统的业务规则进行更新的更新指令时,可依据更新指令对当前的业务规则进行更新,上述业务规则即为对应某一业务类型的规则数据,这些规则数据包括规则代码。上述更新指令可以依据用户发起的更新请求而生成,也可以是在规则引擎系统重启时自动触发而产生。As described in the above-mentioned acquisition instruction unit 100, when an update instruction for updating the business rules of the rule engine system is acquired, the current business rules can be updated according to the update instructions, and the foregoing business rules are rules corresponding to a certain business type. Data, these rule data include rule codes. The aforementioned update instruction can be generated based on an update request initiated by a user, or can be automatically triggered when the rule engine system restarts.
如上述读取文件单元200所述,上述目标可执行文件为由预设的业务规则集生成的且可在服务器中运行的文件,如上述文件为可进行运行部署的jar包,该目标可执行文件由系统依据用户输入的规则参数生成,并存储在指定的数据库中,如存储在MongoDB数据库。As described in the above-mentioned file reading unit 200, the above-mentioned target executable file is a file that is generated by a preset set of business rules and can be run on the server. If the above-mentioned file is a jar package that can be run and deployed, the target executable file is The file is generated by the system according to the rule parameters entered by the user, and stored in a specified database, such as a MongoDB database.
如上述获取类型单元300所述,上述规则引擎系统的业务规则应用到不同的业务,而不同的业务当中部分业务可采用同一种业务规则,故而可将这些不同的业务分类,得到多个业务类型,且每种业务类型包括有多个不同的业务,每个业务类型均对应一种业务规则。由于目标可执行文件由用户输入的规则参数生成,而规则参数中包含有业务信息,从该信 息中可得到对应的业务类型,故而依据目标可执行文件可获取得到对应的该业务规则的业务类型,本实施例中为了便于表述将该业务类型记为第一业务类型。As described in the above-mentioned acquisition type unit 300, the business rules of the above-mentioned rule engine system are applied to different businesses, and some of the different businesses can use the same business rules, so these different businesses can be classified to obtain multiple business types , And each business type includes multiple different businesses, and each business type corresponds to a business rule. Since the target executable file is generated by the rule parameters entered by the user, and the rule parameters contain business information, the corresponding business type can be obtained from this information, so the corresponding business type of the business rule can be obtained according to the target executable file In this embodiment, for ease of presentation, the service type is recorded as the first service type.
如上述获取类型单元300所述,可通过计算出第一业务类型的重要系数,然后依据重要系数来更新上述业务规则,由于业务类型的重要程度不同,在进行更新时,会将其部署到不同服务器环境中,而业务类型的重要程度由其包含的各个业务决定,例如在一个业务类型中包含有金融交易、普通交易、核心业务以及非核心业务四种业务,其中金融交易较为重要,则权重也相对高。故而可通过第一业务类型中所有业务的重要程度,即预设的对应各业务的权重来计算上述重要系数。同时为了保证到业务规则部署后运行顺畅,需要知道第一业务类型的使用量,以便更好分配更新到对应服务器环境中,故而需要第一业务类型中各业务的使用量来计算上述重要系数,综上,在更新之前,无需人为凭经验去分配部署,直接依据第一业务类型中所有业务的权重,以及第一业务类型中各业务对应的使用量计算出对应第一业务类型的重要系数,再依据重要系数来分配更新到适用的服务器环境中。As described in the above-mentioned obtaining type unit 300, the important coefficient of the first service type can be calculated, and then the above-mentioned business rules can be updated according to the important coefficient. As the importance of the service type is different, it will be deployed to different In the server environment, the importance of a business type is determined by the various businesses it contains. For example, a business type contains four businesses: financial transactions, ordinary transactions, core businesses, and non-core businesses. Among them, financial transactions are more important. Also relatively high. Therefore, the above-mentioned important coefficient can be calculated by the importance of all services in the first service type, that is, the preset weights corresponding to each service. At the same time, in order to ensure the smooth operation of the business rules after deployment, it is necessary to know the usage of the first service type so as to better allocate and update to the corresponding server environment. Therefore, the usage of each service in the first service type is required to calculate the above important coefficients. In summary, before the update, there is no need to allocate deployment based on human experience, and directly calculate the important coefficient corresponding to the first service type based on the weight of all services in the first service type and the corresponding usage of each service in the first service type. Then according to the important factor to allocate updates to the applicable server environment.
如上述判断系数单元500以及更新文件单元600所述,上述在目标可执行文件在服务器环境中进行更新,可通过将目标可执行文件在服务器中部署来实现。由于不同的业务规则,更新时会部署到不同的服务器环境中,其中,而服务器环境分为独立服务器环境以及公共服务器环境,其中部署在独立服务器环境中的业务规则,可单独在该独立环境中运行,而部署在公共服务器环境中的业务规则,则可以部署多个不同的业务规则,多个业务规则同时运行,这样有针对性的部署,不但可以节省资源同时也可以避免运行时,重要的业务规则被不重要的业务规则交叉影响,故而重要的业务规则需要部署在独立服务器环境中,不重要的业务规则可以部署在公共服务器环境中,所以获取到对应业务规则的业务类型之后,可依据业务类型中所有业务对应的权重,以及业务类型中各业务对应的使用量计算出对应该业务类型的重要系数,重要系数越高,表明该业务类型越重要,当重要系数大于预设阀值,则可将对应该业务类型的业务规则部署到独立服务器环境,否则可直接部署在公共服务器环境。As described in the aforementioned determination coefficient unit 500 and the update file unit 600, the aforementioned update of the target executable file in the server environment can be implemented by deploying the target executable file in the server. Due to different business rules, the update will be deployed to different server environments. The server environments are divided into independent server environments and public server environments. The business rules deployed in the independent server environment can be separately deployed in the independent environment For business rules deployed in a public server environment, multiple different business rules can be deployed, and multiple business rules run at the same time. This targeted deployment not only saves resources but also avoids runtime, important Business rules are cross-influenced by unimportant business rules, so important business rules need to be deployed in an independent server environment, unimportant business rules can be deployed in a public server environment, so after obtaining the business type corresponding to the business rule, you can follow The corresponding weights of all services in the business type and the corresponding usage of each business in the business type calculate the important coefficient corresponding to the business type. The higher the important coefficient, the more important the business type. When the important coefficient is greater than the preset threshold, Then the business rules corresponding to the business type can be deployed to the independent server environment, otherwise it can be directly deployed in the public server environment.
在一个实施例中,利用以下公式计算出所述重要系数:In one embodiment, the important coefficient is calculated using the following formula:
R=(W 1+W 2+…+W n)/(π*W 1/2arctan(C 1)+π*W 2/2arctan(C 2)+…+π*W n/2arctan(C n)); R=(W 1 +W 2 +…+W n )/(π*W 1 /2arctan(C 1 )+π*W 2 /2arctan(C 2 )+…+π*W n /2arctan(C n ) );
其中,所述第一业务类型中预设有n个业务,R为所述重要系数,W为所述第一业务类型中的各业务的权重,C为所述第一业务类型中的各业务的使用量。Wherein, there are preset n services in the first service type, R is the important coefficient, W is the weight of each service in the first service type, and C is each service in the first service type Usage.
在一个实施例中,上述步规则引擎系统的规则更新装置,包括:In an embodiment, the rule update device of the above-mentioned step rule engine system includes:
调用记录单元,用于调用所述第一业务类型中每种所述业务每次被使用的历史记录;A call recording unit, which is used to call a historical record of each of the services used in the first service type;
统计用量单元,用于依据所述历史记录统计每种业务的使用次数,将所述使用次数记为所述使用量。The statistical usage unit is used to count the usage times of each type of service according to the historical records, and record the usage times as the usage amount.
在一个实施例中,上述步规则引擎系统的规则更新装置,还包括:In an embodiment, the rule updating device of the aforementioned step rule engine system further includes:
接收参数单元,用于接收用户在规则编辑界面中输入的规则参数,以形成目标规则文件;The parameter receiving unit is used to receive the rule parameters input by the user in the rule editing interface to form a target rule file;
解析文件单元,用于将所述目标规则文件解析成目标prl文件;A parsing file unit for parsing the target rule file into a target prl file;
编译文件单元,用于将所述prl文件编译成所述目标可执行文件;A compiling file unit for compiling the prl file into the target executable file;
存储文件单元,用于将所述目标可执行文件存储至所述指定数据库中;The file storage unit is used to store the target executable file in the designated database;
定义版本单元,用于在所述指定数据库中依据历史文件将所述目标可执行文件通过tag标签定义为最新版本,所述历史文件为在将所述目标可执行文件存储在所述指定数据库之前,已经存储在所述指定数据库中的可执行文件。The definition version unit is used to define the target executable file as the latest version through a tag tag in the specified database according to a history file, where the history file is before storing the target executable file in the specified database , The executable file that has been stored in the specified database.
在一个实施例中,上述更新文件单元600,包括:In an embodiment, the aforementioned update file unit 600 includes:
替换文件单元,用于将所述独立服务器中已经部署的所述可执行文件替换成所述最新版本的目标可执行文件;The file replacement unit is used to replace the executable file deployed in the independent server with the target executable file of the latest version;
部署文件单元,用于对所述目标可执行文件进行部署以完成更新。The deployment file unit is used to deploy the target executable file to complete the update.
在一个实施例中,上述规则引擎系统的规则更新装置,包括:In an embodiment, the rule updating device of the above-mentioned rule engine system includes:
第一获取单元,用于获取所述独立服务器返回的更新业务规则版本不适应的第一反馈信息所述更新业务规则版本不适应包括所述目标可执行文件在所述独立服务器环境中无法完成更新,以及所述目标可执行文件在所述独立服务器环境中更新完成之后无法运行;The first acquiring unit is configured to acquire the first feedback information returned by the independent server that the updated business rule version is not compatible, and the updated business rule version is not compatible, including that the target executable file cannot be updated in the independent server environment , And the target executable file cannot run after the update is completed in the independent server environment;
第一重读单元,用于依据所述第一反馈信息从所述指定数据库中重新读取所述可执行文件;The first reread unit is configured to reread the executable file from the designated database according to the first feedback information;
第一替换单元,用于将所述目标可执行文件替换成所述可执行文件,并对所述可执行文件进行部署;The first replacement unit is configured to replace the target executable file with the executable file, and deploy the executable file;
上述规则引擎系统的规则更新装置,还包括:The rule update device of the above rule engine system also includes:
第二获取单元,用于获取到所述公共服务器返回的更新业务规则版本不适应的第二反馈信息,所述更新业务规则版本不适应包括所述目标可执行文件在所述公共服务器环境中无法完成更新,以及所述目标可执行文件在所述公共服务器环境中更新完成之后无法运行;The second obtaining unit is configured to obtain the second feedback information returned by the public server that the updated business rule version is not suitable, and the updated business rule version is not suitable for including the target executable file cannot be found in the public server environment. The update is completed, and the target executable file cannot run after the update is completed in the public server environment;
第二重读单元,用于依据所述第二反馈信息从所述指定数据库中重新读取所述可执行文件;A second reread unit, configured to reread the executable file from the designated database according to the second feedback information;
第二部署单元,用于将所述目标可执行文件替换成所述可执行文件,并在所述公共服务器环境中对所述可执行文件进行部署。The second deployment unit is configured to replace the target executable file with the executable file, and deploy the executable file in the public server environment.
另一实施例中,上述规则引擎系统的规则更新装置,包括:In another embodiment, the rule updating device of the above-mentioned rule engine system includes:
判断方式单元,用于判断对所述业务规则进行更新的更新方式是否为依据所述重要系数更新;A judging mode unit for judging whether the update mode for updating the business rule is based on the important coefficient;
判断运行单元,用于在更新方式为依据所述重要系数更新时,则生成计算重要系数的计算指令;若更新方式不为依据所述重要系数更新,则判断所述第一业务类型对应的业务规则运行量是否超过预设运行量;The judging operation unit is configured to generate a calculation instruction for calculating important coefficients when the update mode is to update based on the important coefficient; if the update mode is not to update based on the important coefficient, determine the business corresponding to the first service type Whether the running volume of the rule exceeds the preset running volume;
运行更新单元,用于若所述业务规则运行量超过预设运行量,则将所述目标可执行文件在所述独立服务器环境中进行更新,若所述业务规则运行量未超过预设运行量,则将所述目标可执行文件在所述公共服务器环境中进行更新。An operation update unit, configured to update the target executable file in the independent server environment if the operation volume of the business rule exceeds the preset operation volume, and if the operation volume of the business rule does not exceed the preset operation volume , The target executable file is updated in the public server environment.
参照图3,本申请实施例中还提供一种计算机设备,该计算机设备可以是服务器,其内部结构可以如图3所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储更新规则引擎系统中的规则所需的所有数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种规则引擎系统的规则更新方法。Referring to FIG. 3, an embodiment of the present application also provides a computer device. The computer device may be a server, and its internal structure may be as shown in FIG. 3. The computer equipment includes a processor, a memory, a network interface and a database connected by a system bus. Among them, the computer designed processor is used to provide calculation 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, computer readable instructions, and a database. The memory provides an environment for the operation of the operating system and computer readable instructions in the non-volatile storage medium. The database of the computer equipment is used to store all the data required to update the rules in the rule engine system. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer readable instruction is executed by the processor to realize a rule update method of the rule engine system.
上述处理器执行上述规则引擎系统的规则更新方法的步骤:获取对规则引擎系统中的业务规则进行更新的更新指令;依据所述更新指令从指定数据库中读取最新版本的目标可执行文件,所述目标可执行文件为预设业务规则集生成的且可在服务器中运行的文件;依据所述目标可执行文件获取对应所述业务规则的业务类型,并记为第一业务类型,其中,同一种业务类型中包括有多个不同的业务;依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数;判断所述重要系数是否大于预设阀值;若是,则将所述目标可执行文件在独立服务器环境中进行更新,若否,则将所述目标可执行文件在公共服务器环境中进行更新。The processor executes the steps of the rule update method of the rule engine system: obtains an update instruction for updating the business rules in the rule engine system; reads the latest version of the target executable file from the designated database according to the update instruction, so The target executable file is a file that is generated by a preset business rule set and can be run on the server; the business type corresponding to the business rule is obtained according to the target executable file, and is recorded as the first business type, where the same A service type includes multiple different services; according to the weights corresponding to all services in the first service type, and the corresponding usage of each service in the first service type, the corresponding first service is calculated The important coefficient of the type; determine whether the important coefficient is greater than the preset threshold; if yes, update the target executable file in a stand-alone server environment; if not, update the target executable file in a public server environment To be updated.
上述计算机设备,上述依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数的步骤,包括:利用以下公式计算出所述重要系数: R=(W 1+W 2+…+W n)/(π*W 1/2arctan(C 1)+π*W 2/2arctan(C 2)+…+π*W n/2arctan(C n));其中,所述第一业务类型中预设有n个业务,R为所述重要系数,W为所述第一业务类型中的各业务的权重,C为所述第一业务类型中的各业务的使用量。 In the above-mentioned computer equipment, the step of calculating the important coefficient corresponding to the first service type according to the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type, Including: use the following formula to calculate the important coefficient: R=(W 1 +W 2 +…+W n )/(π*W 1 /2arctan(C 1 )+π*W 2 /2arctan(C 2 )+ …+π*W n /2arctan(C n )); wherein, there are preset n services in the first service type, R is the important coefficient, and W is the value of each service in the first service type Weight, C is the usage amount of each service in the first service type.
在一个实施例中,上述依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数的步骤之前,包括:调用所述第一业务类型中每种所述业务每次被使用的历史记录;依据所述历史记录统计每种业务的使用次数,将所述使用次数记为所述使用量。In an embodiment, the above-mentioned calculation of the important coefficient corresponding to the first service type is based on the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type. Before the step, it includes: invoking the historical record of each of the services used in the first service type; counting the number of uses of each service according to the historical record, and recording the number of uses as the amount of use .
在一个实施例中,上述获取到对规则引擎系统中的业务规则进行更新的更新指令的步骤之前,包括:接收用户在规则编辑界面中输入的规则参数,以形成目标规则文件;将所述目标规则文件解析成目标prl文件;将所述prl文件编译成所述目标可执行文件;将所述目标可执行文件存储至所述指定数据库中;在所述指定数据库中依据历史文件将所述目标可执行文件通过tag标签定义为最新版本,所述历史文件为在将所述目标可执行文件存储在所述指定数据库之前,已经存储在所述指定数据库中的可执行文件。In one embodiment, before the step of obtaining the update instruction for updating the business rules in the rule engine system, the step includes: receiving the rule parameters input by the user in the rule editing interface to form a target rule file; The rule file is parsed into a target prl file; the prl file is compiled into the target executable file; the target executable file is stored in the designated database; the target is stored in the designated database according to the historical file The executable file is defined as the latest version through a tag, and the history file is an executable file that has been stored in the specified database before the target executable file is stored in the specified database.
在一个实施例中,上述将所述目标可执行文件在独立服务器环境中进行更新的步骤,包括:将所述独立服务器中已经部署的所述可执行文件替换成所述目标执行文件;对所述目标可执行文件进行部署以完成更新。In one embodiment, the above step of updating the target executable file in an independent server environment includes: replacing the executable file already deployed in the independent server with the target executable file; The target executable file is deployed to complete the update.
在一个实施例中,上述将所述目标可执行文件在独立服务器环境中进行更新的步骤之后,包括:获取所述独立服务器返回的更新业务规则版本不适应的第一反馈信息,所述更新业务规则版本不适应包括所述目标可执行文件在所述独立服务器环境中无法完成更新,以及所述目标可执行文件在所述独立服务器环境中更新完成之后无法运行;依据所述第一反馈信息从所述指定数据库中重新读取所述可执行文件;将所述目标可执行文件替换成所述可执行文件,并在所述独立服务器环境中对所述可执行文件进行部署;或者,将所述目标可执行文件在公共服务器环境中进行更新的步骤之后,包括:获取所述公共服务器返回的更新业务规则版本不适应的第二反馈信息,所述更新业务规则版本不适应包括所述目标可执行文件在所述公共服务器环境中无法完成更新,以及所述目标可执行文件在所述公共服务器环境中更新完成之后无法运行;依据所述第二反馈信息从所述指定数据库中重新读取所述可执行文件;将所述目标可执行文件替换成所述可执行文件,并在所述公共服务器环境中对所述可执行文件进行部署。In one embodiment, after the above step of updating the target executable file in an independent server environment, it includes: obtaining the first feedback information returned by the independent server that the updated business rule version is not suitable, and the update service The rule version incompatibility includes that the target executable file cannot be updated in the independent server environment, and the target executable file cannot run after the update is completed in the independent server environment; according to the first feedback information from Re-read the executable file in the designated database; replace the target executable file with the executable file, and deploy the executable file in the independent server environment; or After the step of updating the target executable file in the public server environment, it includes: acquiring the second feedback information returned by the public server that the updated business rule version is not suitable, and the updated business rule version is not suitable for including the target The executable file cannot be updated in the public server environment, and the target executable file cannot be run after the update is completed in the public server environment; re-read all files from the designated database according to the second feedback information The executable file; replace the target executable file with the executable file, and deploy the executable file in the public server environment.
在一个实施例中,上述依据所述目标可执行文件获取所述业务规则的业务类型,并记为第一业务类型的步骤之后,包括:判断对所述业务规则进行更新的更新方式是否为依据 所述重要系数更新;若更新方式为依据所述重要系数更新,则生成计算重要系数的计算指令;若更新方式不为依据所述重要系数更新,则判断所述第一业务类型对应的业务规则运行量是否超过预设运行量;若所述业务规则运行量超过预设运行量,则将所述目标可执行文件在所述独立服务器环境中进行更新,若所述业务规则运行量未超过预设运行量,则将所述目标可执行文件在所述公共服务器环境中进行更新。In one embodiment, after the step of obtaining the business type of the business rule based on the target executable file and recording it as the first business type, it includes: judging whether the update method of the business rule is based on The important coefficient is updated; if the update method is based on the important coefficient, a calculation instruction for calculating the important coefficient is generated; if the update method is not based on the important coefficient, the business rule corresponding to the first business type is determined Whether the running volume exceeds the preset running volume; if the running volume of the business rules exceeds the preset running volume, the target executable file is updated in the independent server environment, and if the running volume of the business rules does not exceed the preset running volume, Assuming the running volume, the target executable file is updated in the public server environment.
本领域技术人员可以理解,图3中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定。Those skilled in the art can understand that the structure shown in FIG. 3 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.
本申请一实施例还提供一种计算机可读存储介质,所述计算机可读存储介质,例如为非易失性的计算机可读存储介质,或者为易失性的计算机可读存储介质。其上存储有计算机可读指令,计算机可读指令被处理器执行时实现一种规则引擎系统的规则更新方法,具体为:获取对规则引擎系统中的业务规则进行更新的更新指令;依据所述更新指令从指定数据库中读取最新版本的目标可执行文件,所述目标可执行文件为预设业务规则集生成的且可在服务器中运行的文件;依据所述目标可执行文件获取对应所述业务规则的业务类型,并记为第一业务类型,其中,同一种业务类型中包括有多个不同的业务;依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数;判断所述重要系数是否大于预设阀值;若是,则将所述目标可执行文件在独立服务器环境中进行更新,若否,则将所述目标可执行文件在公共服务器环境中进行更新。An embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium is, for example, a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. There are computer-readable instructions stored thereon, and when the computer-readable instructions are executed by the processor, a rule update method of the rule engine system is realized, specifically: obtaining an update instruction for updating business rules in the rule engine system; The update instruction reads the latest version of the target executable file from the specified database. The target executable file is a file that is generated by a preset business rule set and can be run on the server; and the corresponding target executable file is obtained according to the target executable file. The business type of the business rule is recorded as the first business type, where the same business type includes multiple different businesses; based on the weights corresponding to all businesses in the first business type, and the first business type Calculate the important coefficient corresponding to the first service type according to the usage amount corresponding to each of the services; determine whether the important coefficient is greater than a preset threshold; if so, perform the target executable file in an independent server environment Update, if not, update the target executable file in the public server environment.
上述计算机可读存储介质,上述依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数的步骤,包括:利用以下公式计算出所述重要系数:R=(W 1+W 2+…+W n)/(π*W 1/2arctan(C 1)+π*W 2/2arctan(C 2)+…+π*W n/2arctan(C n));其中,所述第一业务类型中预设有n个业务,R为所述重要系数,W为所述第一业务类型中的各业务的权重,C为所述第一业务类型中的各业务的使用量。 The above-mentioned computer-readable storage medium, the above-mentioned calculation of an important coefficient corresponding to the first service type based on the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type The steps include: using the following formula to calculate the important coefficient: R=(W 1 +W 2 +…+W n )/(π*W 1 /2arctan(C 1 )+π*W 2 /2arctan(C 2 )+...+π*W n /2arctan(C n )); wherein, there are preset n services in the first service type, R is the important coefficient, and W is the value in the first service type The weight of each service, C is the usage amount of each service in the first service type.
在一个实施例中,上述依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数的步骤之前,包括:调用所述第一业务类型中每种所述业务每次被使用的历史记录;依据所述历史记录统计每种业务的使用次数,将所述使用次数记为所述使用量。In an embodiment, the above-mentioned calculation of the important coefficient corresponding to the first service type is based on the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type. Before the step, it includes: invoking the historical record of each of the services used in the first service type; counting the number of uses of each service according to the historical record, and recording the number of uses as the amount of use .
在一个实施例中,上述获取到对规则引擎系统中的业务规则进行更新的更新指令的步骤之前,包括:接收用户在规则编辑界面中输入的规则参数,以形成目标规则文件;将所 述目标规则文件解析成目标prl文件;将所述prl文件编译成所述目标可执行文件;将所述目标可执行文件存储至所述指定数据库中;在所述指定数据库中依据历史文件将所述目标可执行文件通过tag标签定义为最新版本,所述历史文件为在将所述目标可执行文件存储在所述指定数据库之前,已经存储在所述指定数据库中的可执行文件。In one embodiment, before the step of obtaining the update instruction for updating the business rules in the rule engine system, the step includes: receiving the rule parameters input by the user in the rule editing interface to form a target rule file; The rule file is parsed into a target prl file; the prl file is compiled into the target executable file; the target executable file is stored in the designated database; the target is stored in the designated database according to the historical file The executable file is defined as the latest version through a tag, and the history file is an executable file that has been stored in the specified database before the target executable file is stored in the specified database.
在一个实施例中,上述将所述目标可执行文件在独立服务器环境中进行更新的步骤,包括:将所述独立服务器中已经部署的所述可执行文件替换成所述目标执行文件;对所述目标可执行文件进行部署以完成更新。In one embodiment, the above step of updating the target executable file in an independent server environment includes: replacing the executable file already deployed in the independent server with the target executable file; The target executable file is deployed to complete the update.
在一个实施例中,上述将所述目标可执行文件在独立服务器环境中进行更新的步骤之后,包括:获取所述独立服务器返回的更新业务规则版本不适应的第一反馈信息,所述更新业务规则版本不适应包括所述目标可执行文件在所述独立服务器环境中无法完成更新,以及所述目标可执行文件在所述独立服务器环境中更新完成之后无法运行;依据所述第一反馈信息从所述指定数据库中重新读取所述可执行文件;将所述目标可执行文件替换成所述可执行文件,并在所述独立服务器环境中对所述可执行文件进行部署;或者,将所述目标可执行文件在公共服务器环境中进行更新的步骤之后,包括:获取所述公共服务器返回的更新业务规则版本不适应的第二反馈信息,所述更新业务规则版本不适应包括所述目标可执行文件在所述公共服务器环境中无法完成更新,以及所述目标可执行文件在所述公共服务器环境中更新完成之后无法运行;依据所述第二反馈信息从所述指定数据库中重新读取所述可执行文件;将所述目标可执行文件替换成所述可执行文件,并在所述公共服务器环境中对所述可执行文件进行部署。In one embodiment, after the above step of updating the target executable file in an independent server environment, it includes: obtaining the first feedback information returned by the independent server that the updated business rule version is not suitable, and the update service The rule version incompatibility includes that the target executable file cannot be updated in the independent server environment, and the target executable file cannot run after the update is completed in the independent server environment; according to the first feedback information from Re-read the executable file in the designated database; replace the target executable file with the executable file, and deploy the executable file in the independent server environment; or After the step of updating the target executable file in the public server environment, it includes: acquiring the second feedback information returned by the public server that the updated business rule version is not suitable, and the updated business rule version is not suitable for including the target The executable file cannot be updated in the public server environment, and the target executable file cannot be run after the update is completed in the public server environment; re-read all files from the designated database according to the second feedback information The executable file; replace the target executable file with the executable file, and deploy the executable file in the public server environment.
在一个实施例中,上述依据所述目标可执行文件获取所述业务规则的业务类型,并记为第一业务类型的步骤之后,包括:判断对所述业务规则进行更新的更新方式是否为依据所述重要系数更新;若更新方式为依据所述重要系数更新,则生成计算重要系数的计算指令;若更新方式不为依据所述重要系数更新,则判断所述第一业务类型对应的业务规则运行量是否超过预设运行量;若所述业务规则运行量超过预设运行量,则将所述目标可执行文件在所述独立服务器环境中进行更新,若所述业务规则运行量未超过预设运行量,则将所述目标可执行文件在所述公共服务器环境中进行更新。In one embodiment, after the step of obtaining the business type of the business rule based on the target executable file and recording it as the first business type, it includes: judging whether the update method of the business rule is based on The important coefficient is updated; if the update method is based on the important coefficient, a calculation instruction for calculating the important coefficient is generated; if the update method is not based on the important coefficient, the business rule corresponding to the first business type is determined Whether the running volume exceeds the preset running volume; if the running volume of the business rules exceeds the preset running volume, the target executable file is updated in the independent server environment, and if the running volume of the business rules does not exceed the preset running volume, Assuming the running volume, the target executable file is updated in the public server environment.
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the preferred embodiments of this application, and do not limit the scope of this application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of this application, or directly or indirectly applied to other related The technical field is equally included in the scope of patent protection of this application.

Claims (20)

  1. 一种规则引擎系统的规则更新方法,其特征在于,包括:A rule update method of a rule engine system is characterized in that it includes:
    获取对规则引擎系统中的业务规则进行更新的更新指令;Obtain update instructions for updating business rules in the rule engine system;
    依据所述更新指令从指定数据库中读取最新版本的目标可执行文件,所述目标可执行文件为预设业务规则集生成的且可在服务器中运行的文件;Reading the latest version of the target executable file from a designated database according to the update instruction, where the target executable file is a file that is generated by a preset business rule set and can be run on the server;
    依据所述目标可执行文件获取对应所述业务规则的业务类型,并记为第一业务类型,其中,同一种业务类型中包括有多个不同的业务;Obtain the business type corresponding to the business rule according to the target executable file, and record it as the first business type, where the same business type includes multiple different businesses;
    依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数;Calculating an important coefficient corresponding to the first service type according to the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type;
    判断所述重要系数是否大于预设阀值;Judging whether the important coefficient is greater than a preset threshold;
    若是,则将所述目标可执行文件在独立服务器环境中进行更新,若否,则将所述目标可执行文件在公共服务器环境中进行更新。If yes, update the target executable file in a standalone server environment, if not, update the target executable file in a public server environment.
  2. 根据权利要求1所述的规则引擎系统的规则更新方法,其特征在于,所述依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数的步骤,包括:The rule update method of the rule engine system according to claim 1, wherein the weights corresponding to all services in the first service type and the corresponding usage of each of the services in the first service type are used. The step of calculating the important coefficient corresponding to the first service type by quantity includes:
    利用以下公式计算出所述重要系数:Use the following formula to calculate the important factor:
    R=(W 1+W 2+…+W n)/(π*W 1/2arctan(C 1)+π*W 2/2arctan(C 2)+…+π*W n/2arctan(C n)); R=(W 1 +W 2 +…+W n )/(π*W 1 /2arctan(C 1 )+π*W 2 /2arctan(C 2 )+…+π*W n /2arctan(C n ) );
    其中,所述第一业务类型中预设有n个业务,R为所述重要系数,W为所述第一业务类型中的各业务的权重,C为所述第一业务类型中的各业务的使用量。Wherein, there are preset n services in the first service type, R is the important coefficient, W is the weight of each service in the first service type, and C is each service in the first service type Usage.
  3. 根据权利要求1所述的规则引擎系统的规则更新方法,其特征在于,所述依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数的步骤之前,包括:The rule update method of the rule engine system according to claim 1, wherein the weights corresponding to all services in the first service type and the corresponding usage of each of the services in the first service type are used. Before the step of calculating the important coefficient corresponding to the first service type, the step includes:
    调用所述第一业务类型中每种所述业务每次被使用的历史记录;Invoking the historical record of each of the services used in the first service type;
    依据所述历史记录统计每种业务的使用次数,将所述使用次数记为所述使用量。Count the usage times of each service according to the historical records, and record the usage times as the usage amount.
  4. 根据权利要求1所述的规则引擎系统的规则更新方法,其特征在于,所述获取到对规则引擎系统中的业务规则进行更新的更新指令的步骤之前,包括:The rule update method of the rule engine system according to claim 1, characterized in that, before the step of obtaining an update instruction for updating business rules in the rule engine system, the method comprises:
    接收用户在规则编辑界面中输入的规则参数,以形成目标规则文件;Receive rule parameters entered by the user in the rule editing interface to form a target rule file;
    将所述目标规则文件解析成目标prl文件;Parse the target rule file into a target prl file;
    将所述prl文件编译成所述目标可执行文件;Compiling the prl file into the target executable file;
    将所述目标可执行文件存储至所述指定数据库中;Storing the target executable file in the designated database;
    在所述指定数据库中依据历史文件将所述目标可执行文件通过tag标签定义为最新版本,所述历史文件为在将所述目标可执行文件存储在所述指定数据库之前,已经存储在所述指定数据库中的可执行文件。In the designated database, the target executable file is defined as the latest version through the tag tag according to the historical file, and the historical file is stored in the target executable file before the target executable file is stored in the designated database. Specify the executable file in the database.
  5. 根据权利要求4所述的规则引擎系统的规则更新方法,其特征在于,所述将所述目标可执行文件在独立服务器环境中进行更新的步骤,包括:The rule update method of the rule engine system according to claim 4, wherein the step of updating the target executable file in an independent server environment comprises:
    将所述独立服务器中已经部署的所述可执行文件替换成所述目标执行文件;Replacing the executable file that has been deployed in the independent server with the target executable file;
    对所述目标可执行文件进行部署以完成更新。The target executable file is deployed to complete the update.
  6. 根据权利要求4所述的规则引擎系统的规则更新方法,其特征在于,所述将所述目标可执行文件在独立服务器环境中进行更新的步骤之后,包括:The rule updating method of the rule engine system according to claim 4, characterized in that, after the step of updating the target executable file in an independent server environment, it comprises:
    获取所述独立服务器返回的更新业务规则版本不适应的第一反馈信息,所述更新业务规则版本不适应包括所述目标可执行文件在所述独立服务器环境中无法完成更新,以及所述目标可执行文件在所述独立服务器环境中更新完成之后无法运行;Obtain the first feedback information returned by the independent server that the updated business rule version is not suitable, and the updated business rule version is not suitable, including that the target executable file cannot be updated in the independent server environment, and the target can be updated The executable file cannot run after the update is completed in the independent server environment;
    依据所述第一反馈信息从所述指定数据库中重新读取所述可执行文件;Re-read the executable file from the designated database according to the first feedback information;
    将所述目标可执行文件替换成所述可执行文件,并在所述独立服务器环境中对所述可执行文件进行部署;Replacing the target executable file with the executable file, and deploying the executable file in the independent server environment;
    或者,将所述目标可执行文件在公共服务器环境中进行更新的步骤之后,包括:Alternatively, after the step of updating the target executable file in a public server environment, the method includes:
    获取所述公共服务器返回的更新业务规则版本不适应的第二反馈信息,所述更新业务规则版本不适应包括所述目标可执行文件在所述公共服务器环境中无法完成更新,以及所述目标可执行文件在所述公共服务器环境中更新完成之后无法运行;Obtain the second feedback information returned by the public server that the updated business rule version is not suitable, and the updated business rule version is not suitable including that the target executable file cannot be updated in the public server environment, and the target can The executable file cannot run after the update is completed in the public server environment;
    依据所述第二反馈信息从所述指定数据库中重新读取所述可执行文件;Re-read the executable file from the designated database according to the second feedback information;
    将所述目标可执行文件替换成所述可执行文件,并在所述公共服务器环境中对所述可执行文件进行部署。Replace the target executable file with the executable file, and deploy the executable file in the public server environment.
  7. 根据权利要求1所述的规则引擎系统的规则更新方法,其特征在于,所述依据所述目标可执行文件获取所述业务规则的业务类型,并记为第一业务类型的步骤之后,包括:The rule update method of the rule engine system according to claim 1, wherein after the step of obtaining the business type of the business rule according to the target executable file and recording it as the first business type, it comprises:
    判断对所述业务规则进行更新的更新方式是否为依据所述重要系数更新;Judging whether the update method for updating the business rules is based on the important coefficient;
    若更新方式为依据所述重要系数更新,则生成计算重要系数的计算指令;若更新方式不为依据所述重要系数更新,则判断所述第一业务类型对应的业务规则运行量是否超过预设运行量;If the update method is to update based on the important coefficient, a calculation instruction for calculating the important coefficient is generated; if the update method is not to update based on the important coefficient, it is determined whether the operation volume of the business rule corresponding to the first business type exceeds the preset Running volume
    若所述业务规则运行量超过预设运行量,则将所述目标可执行文件在所述独立服务器环境中进行更新,若所述业务规则运行量未超过预设运行量,则将所述目标可执行文件在所述公共服务器环境中进行更新。If the running volume of the business rules exceeds the preset running volume, the target executable file is updated in the independent server environment. If the running volume of the business rules does not exceed the preset running volume, the target executable file is updated The executable file is updated in the public server environment.
  8. 一种规则引擎系统的规则更新装置,其特征在于,包括:A rule updating device of a rule engine system is characterized in that it comprises:
    获取指令单元,用于获取对规则引擎系统中的业务规则进行更新的更新指令;The obtaining instruction unit is used to obtain an update instruction for updating the business rules in the rule engine system;
    读取文件单元,用于依据所述更新指令从指定数据库中读取最新版本的目标可执行文件,所述目标可执行文件为预设业务规则集生成的且可在服务器中运行的文件;The file reading unit is configured to read the latest version of the target executable file from the designated database according to the update instruction, where the target executable file is a file that is generated by a preset business rule set and can be run on the server;
    获取类型单元,用于依据所述目标可执行文件获取对应所述业务规则的业务类型,并记为第一业务类型,其中,同一种业务类型中包括有多个不同的业务;The obtaining type unit is used to obtain the service type corresponding to the business rule according to the target executable file and record it as the first service type, wherein the same service type includes multiple different services;
    计算系数单元,用于依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数;The calculation coefficient unit is configured to calculate the important coefficient corresponding to the first service type according to the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type;
    判断系数单元,用于判断所述重要系数是否大于预设阀值;The judgment coefficient unit is used to judge whether the important coefficient is greater than a preset threshold;
    更新文件单元,用于判断所述重要系数大于预设阀值时,则将所述目标可执行文件在独立服务器环境中进行更新,若否,则将所述目标可执行文件在公共服务器环境中进行更新。The update file unit is used to update the target executable file in a stand-alone server environment when it is determined that the important coefficient is greater than a preset threshold; if not, then update the target executable file in a public server environment Update.
  9. 根据权利要求8所述的规则引擎系统的规则更新装置,其特征在于,还包括:The rule updating device of the rule engine system according to claim 8, characterized in that it further comprises:
    调用记录单元,用于调用所述第一业务类型中每种所述业务每次被使用的历史记录;A call recording unit, which is used to call a historical record of each of the services used in the first service type;
    统计用量单元,用于依据所述历史记录统计每种业务的使用次数,将所述使用次数记为所述使用量。The statistical usage unit is used to count the usage times of each type of service according to the historical records, and record the usage times as the usage amount.
  10. 根据权利要求8所述的规则引擎系统的规则更新装置,其特征在于,还包括:The rule updating device of the rule engine system according to claim 8, characterized in that it further comprises:
    接收参数单元,用于接收用户在规则编辑界面中输入的规则参数,以形成目标规则文件;The parameter receiving unit is used to receive the rule parameters input by the user in the rule editing interface to form a target rule file;
    解析文件单元,用于将所述目标规则文件解析成目标prl文件;A parsing file unit for parsing the target rule file into a target prl file;
    编译文件单元,用于将所述prl文件编译成所述目标可执行文件;A compiling file unit for compiling the prl file into the target executable file;
    存储文件单元,用于将所述目标可执行文件存储至所述指定数据库中;The file storage unit is used to store the target executable file in the designated database;
    定义版本单元,用于在所述指定数据库中依据历史文件将所述目标可执行文件通过tag标签定义为最新版本,所述历史文件为在将所述目标可执行文件存储在所述指定数据库之前,已经存储在所述指定数据库中的可执行文件。The definition version unit is used to define the target executable file as the latest version through a tag tag in the specified database according to a history file, where the history file is before storing the target executable file in the specified database , The executable file that has been stored in the specified database.
  11. 根据权利要求10所述的规则引擎系统的规则更新装置,其特征在于,所述更新文件单元包括:The rule updating device of the rule engine system according to claim 10, wherein the updating file unit comprises:
    替换文件单元,用于将所述独立服务器中已经部署的所述可执行文件替换成所述最新版本的目标可执行文件;The file replacement unit is used to replace the executable file deployed in the independent server with the target executable file of the latest version;
    部署文件单元,用于对所述目标可执行文件进行部署以完成更新。The deployment file unit is used to deploy the target executable file to complete the update.
  12. 根据权利要求10所述的规则引擎系统的规则更新装置,其特征在于,还包括:The rule updating device of the rule engine system according to claim 10, further comprising:
    第一获取单元,用于获取所述独立服务器返回的更新业务规则版本不适应的第一反馈信息所述更新业务规则版本不适应包括所述目标可执行文件在所述独立服务器环境中无法完成更新,以及所述目标可执行文件在所述独立服务器环境中更新完成之后无法运行;The first acquiring unit is configured to acquire the first feedback information returned by the independent server that the updated business rule version is not compatible, and the updated business rule version is not compatible, including that the target executable file cannot be updated in the independent server environment , And the target executable file cannot run after the update is completed in the independent server environment;
    第一重读单元,用于依据所述第一反馈信息从所述指定数据库中重新读取所述可执行文件;The first reread unit is configured to reread the executable file from the designated database according to the first feedback information;
    第一替换单元,用于将所述目标可执行文件替换成所述可执行文件,并对所述可执行文件进行部署;The first replacement unit is configured to replace the target executable file with the executable file, and deploy the executable file;
    上述规则引擎系统的规则更新装置,还包括:The rule update device of the above rule engine system also includes:
    第二获取单元,用于获取到所述公共服务器返回的更新业务规则版本不适应的第二反馈信息,所述更新业务规则版本不适应包括所述目标可执行文件在所述公共服务器环境中无法完成更新,以及所述目标可执行文件在所述公共服务器环境中更新完成之后无法运行;The second obtaining unit is configured to obtain the second feedback information returned by the public server that the updated business rule version is not suitable, and the updated business rule version is not suitable for including the target executable file cannot be found in the public server environment. The update is completed, and the target executable file cannot run after the update is completed in the public server environment;
    第二重读单元,用于依据所述第二反馈信息从所述指定数据库中重新读取所述可执行文件;A second reread unit, configured to reread the executable file from the designated database according to the second feedback information;
    第二部署单元,用于将所述目标可执行文件替换成所述可执行文件,并在所述公共服务器环境中对所述可执行文件进行部署。The second deployment unit is configured to replace the target executable file with the executable file, and deploy the executable file in the public server environment.
  13. 根据权利要求8所述的规则引擎系统的规则更新装置,其特征在于,还包括:The rule updating device of the rule engine system according to claim 8, characterized in that it further comprises:
    判断方式单元,用于判断对所述业务规则进行更新的更新方式是否为依据所述重要系数更新;A judging mode unit for judging whether the update mode for updating the business rule is based on the important coefficient;
    判断运行单元,用于在更新方式为依据所述重要系数更新时,则生成计算重要系数的计算指令;若更新方式不为依据所述重要系数更新,则判断所述第一业务类型对应的业务规则运行量是否超过预设运行量;The judging operation unit is configured to generate a calculation instruction for calculating important coefficients when the update mode is to update based on the important coefficient; if the update mode is not to update based on the important coefficient, determine the business corresponding to the first service type Whether the running volume of the rule exceeds the preset running volume;
    运行更新单元,用于若所述业务规则运行量超过预设运行量,则将所述目标可执行文件在所述独立服务器环境中进行更新,若所述业务规则运行量未超过预设运行量,则将所述目标可执行文件在所述公共服务器环境中进行更新。An operation update unit, configured to update the target executable file in the independent server environment if the operation volume of the business rule exceeds the preset operation volume, and if the operation volume of the business rule does not exceed the preset operation volume , The target executable file is updated in the public server environment.
  14. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现规则引擎系统的规则更新方法,该 规则引擎系统的规则更新方法包括:A computer device includes a memory and a processor, the memory stores computer readable instructions, and is characterized in that when the processor executes the computer readable instructions, a rule update method of a rule engine system is implemented, and the rule engine system The rule update methods include:
    获取对规则引擎系统中的业务规则进行更新的更新指令;Obtain update instructions for updating business rules in the rule engine system;
    依据所述更新指令从指定数据库中读取最新版本的目标可执行文件,所述目标可执行文件为预设业务规则集生成的且可在服务器中运行的文件;Reading the latest version of the target executable file from a designated database according to the update instruction, where the target executable file is a file that is generated by a preset business rule set and can be run on the server;
    依据所述目标可执行文件获取对应所述业务规则的业务类型,并记为第一业务类型,其中,同一种业务类型中包括有多个不同的业务;Obtain the business type corresponding to the business rule according to the target executable file, and record it as the first business type, where the same business type includes multiple different businesses;
    依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数;Calculating an important coefficient corresponding to the first service type according to the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type;
    判断所述重要系数是否大于预设阀值;Judging whether the important coefficient is greater than a preset threshold;
    若是,则将所述目标可执行文件在独立服务器环境中进行更新,若否,则将所述目标可执行文件在公共服务器环境中进行更新。If yes, update the target executable file in a standalone server environment, if not, update the target executable file in a public server environment.
  15. 根据权利要求14所述的计算机设备,其特征在于,所述依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数的步骤,包括:The computer device according to claim 14, wherein the corresponding weight is calculated based on the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type. The steps to describe the important coefficients of the first business type include:
    利用以下公式计算出所述重要系数:Use the following formula to calculate the important factor:
    R=(W 1+W 2+…+W n)/(π*W 1/2arctan(C 1)+π*W 2/2arctan(C 2)+…+π*W n/2arctan(C n)); R=(W 1 +W 2 +…+W n )/(π*W 1 /2arctan(C 1 )+π*W 2 /2arctan(C 2 )+…+π*W n /2arctan(C n ) );
    其中,所述第一业务类型中预设有n个业务,R为所述重要系数,W为所述第一业务类型中的各业务的权重,C为所述第一业务类型中的各业务的使用量。Wherein, there are preset n services in the first service type, R is the important coefficient, W is the weight of each service in the first service type, and C is each service in the first service type Usage.
  16. 根据权利要求14所述的计算机设备,其特征在于,所述依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数的步骤之前,包括:The computer device according to claim 14, wherein the corresponding weight is calculated based on the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type. Before describing the important factors of the first business type, the steps include:
    调用所述第一业务类型中每种所述业务每次被使用的历史记录;Invoking the historical record of each of the services used in the first service type;
    依据所述历史记录统计每种业务的使用次数,将所述使用次数记为所述使用量。Count the usage times of each service according to the historical records, and record the usage times as the usage amount.
  17. 根据权利要求14所述的计算机设备,其特征在于,所述获取到对规则引擎系统中的业务规则进行更新的更新指令的步骤之前,包括:The computer device according to claim 14, characterized in that, before the step of obtaining the update instruction for updating the business rules in the rule engine system, it comprises:
    接收用户在规则编辑界面中输入的规则参数,以形成目标规则文件;Receive rule parameters entered by the user in the rule editing interface to form a target rule file;
    将所述目标规则文件解析成目标prl文件;Parse the target rule file into a target prl file;
    将所述prl文件编译成所述目标可执行文件;Compiling the prl file into the target executable file;
    将所述目标可执行文件存储至所述指定数据库中;Storing the target executable file in the designated database;
    在所述指定数据库中依据历史文件将所述目标可执行文件通过tag标签定义为最新版本,所述历史文件为在将所述目标可执行文件存储在所述指定数据库之前,已经存储在所述指定数据库中的可执行文件。In the designated database, the target executable file is defined as the latest version through the tag tag according to the historical file, and the historical file is stored in the target executable file before the target executable file is stored in the designated database. Specify the executable file in the database.
  18. 一种计算机可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现规则引擎系统的规则更新方法,该规则引擎系统的规则更新方法包括:A computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions are executed by a processor to implement a rule update method of a rule engine system, and the rule update method of the rule engine system includes :
    获取对规则引擎系统中的业务规则进行更新的更新指令;Obtain update instructions for updating business rules in the rule engine system;
    依据所述更新指令从指定数据库中读取最新版本的目标可执行文件,所述目标可执行文件为预设业务规则集生成的且可在服务器中运行的文件;Reading the latest version of the target executable file from a designated database according to the update instruction, where the target executable file is a file that is generated by a preset business rule set and can be run on the server;
    依据所述目标可执行文件获取对应所述业务规则的业务类型,并记为第一业务类型,其中,同一种业务类型中包括有多个不同的业务;Obtain the business type corresponding to the business rule according to the target executable file, and record it as the first business type, where the same business type includes multiple different businesses;
    依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数;Calculating an important coefficient corresponding to the first service type according to the weights corresponding to all the services in the first service type and the usage amount corresponding to each of the services in the first service type;
    判断所述重要系数是否大于预设阀值;Judging whether the important coefficient is greater than a preset threshold;
    若是,则将所述目标可执行文件在独立服务器环境中进行更新,若否,则将所述目标可执行文件在公共服务器环境中进行更新。If yes, update the target executable file in a standalone server environment, if not, update the target executable file in a public server environment.
  19. 根据权利要求18所述的计算机可读存储介质,其特征在于,所述依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数的步骤,包括:The computer-readable storage medium according to claim 18, wherein the calculation is performed based on the weights corresponding to all services in the first service type and the usage amount corresponding to each of the services in the first service type The step of calculating the important coefficient corresponding to the first service type includes:
    利用以下公式计算出所述重要系数:Use the following formula to calculate the important factor:
    R=(W 1+W 2+…+W n)/(π*W 1/2arctan(C 1)+π*W 2/2arctan(C 2)+…+π*W n/2arctan(C n)); R=(W 1 +W 2 +…+W n )/(π*W 1 /2arctan(C 1 )+π*W 2 /2arctan(C 2 )+…+π*W n /2arctan(C n ) );
    其中,所述第一业务类型中预设有n个业务,R为所述重要系数,W为所述第一业务类型中的各业务的权重,C为所述第一业务类型中的各业务的使用量。Wherein, there are preset n services in the first service type, R is the important coefficient, W is the weight of each service in the first service type, and C is each service in the first service type Usage.
  20. 根据权利要求18所述的计算机可读存储介质,其特征在于,所述依据所述第一业务类型中所有业务对应的权重,以及所述第一业务类型中各所述业务对应的使用量计算出对应所述第一业务类型的重要系数的步骤之前,包括:The computer-readable storage medium according to claim 18, wherein the calculation is performed based on the weights corresponding to all services in the first service type and the usage amount corresponding to each of the services in the first service type Before the step of deriving the important coefficient corresponding to the first service type, it includes:
    调用所述第一业务类型中每种所述业务每次被使用的历史记录;Invoking the historical record of each of the services used in the first service type;
    依据所述历史记录统计每种业务的使用次数,将所述使用次数记为所述使用量。Count the usage times of each service according to the historical records, and record the usage times as the usage amount.
PCT/CN2019/116334 2019-01-31 2019-11-07 Rule update method and apparatus for rule engine system, and computer device WO2020155735A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910101290.1A CN109918079B (en) 2019-01-31 2019-01-31 Rule updating method and device of rule engine system and computer equipment
CN201910101290.1 2019-01-31

Publications (1)

Publication Number Publication Date
WO2020155735A1 true WO2020155735A1 (en) 2020-08-06

Family

ID=66961248

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/116334 WO2020155735A1 (en) 2019-01-31 2019-11-07 Rule update method and apparatus for rule engine system, and computer device

Country Status (2)

Country Link
CN (1) CN109918079B (en)
WO (1) WO2020155735A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918079B (en) * 2019-01-31 2022-03-18 平安科技(深圳)有限公司 Rule updating method and device of rule engine system and computer equipment
CN111221550A (en) * 2019-10-24 2020-06-02 支付宝(杭州)信息技术有限公司 Rule updating method and device for streaming computing and streaming computing system
CN113254061B (en) * 2021-06-02 2021-11-09 深圳前海大道金融服务有限公司 Business decision method, system and storage medium based on rule engine

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104995964A (en) * 2013-02-04 2015-10-21 Metropcs无线公司 Intelligent network selection system
CN105426748A (en) * 2014-09-18 2016-03-23 腾讯科技(深圳)有限公司 Rule file updating method and device
CN106126215A (en) * 2016-06-17 2016-11-16 深圳市麦斯杰网络有限公司 Business rule scenario generation method and device
US20180322185A1 (en) * 2017-05-02 2018-11-08 Sap Se Cloud-based pluggable classification system
CN109284106A (en) * 2018-07-18 2019-01-29 平安科技(深圳)有限公司 Method for release management, electronic device and the readable storage medium storing program for executing of business rule
CN109918079A (en) * 2019-01-31 2019-06-21 平安科技(深圳)有限公司 Rule update method, device and the computer equipment of rule engine system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739248A (en) * 2008-11-13 2010-06-16 国际商业机器公司 Method and system for executing rule set
CN107656755A (en) * 2016-07-24 2018-02-02 平安科技(深圳)有限公司 The edit methods and device of regulation engine
US10162613B1 (en) * 2017-07-18 2018-12-25 Sap Portals Israel Ltd. Re-usable rule parser for different runtime engines

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104995964A (en) * 2013-02-04 2015-10-21 Metropcs无线公司 Intelligent network selection system
CN105426748A (en) * 2014-09-18 2016-03-23 腾讯科技(深圳)有限公司 Rule file updating method and device
CN106126215A (en) * 2016-06-17 2016-11-16 深圳市麦斯杰网络有限公司 Business rule scenario generation method and device
US20180322185A1 (en) * 2017-05-02 2018-11-08 Sap Se Cloud-based pluggable classification system
CN109284106A (en) * 2018-07-18 2019-01-29 平安科技(深圳)有限公司 Method for release management, electronic device and the readable storage medium storing program for executing of business rule
CN109918079A (en) * 2019-01-31 2019-06-21 平安科技(深圳)有限公司 Rule update method, device and the computer equipment of rule engine system

Also Published As

Publication number Publication date
CN109918079A (en) 2019-06-21
CN109918079B (en) 2022-03-18

Similar Documents

Publication Publication Date Title
WO2020155735A1 (en) Rule update method and apparatus for rule engine system, and computer device
US10061573B2 (en) User interfaces of application porting software platform
US7386609B2 (en) Method, system, and program for managing devices in a network
US9465608B2 (en) Code separation with semantic guarantees
KR100995199B1 (en) Reflection-based processing of input parameters for commands
US7743414B2 (en) System and method for executing a permissions recorder analyzer
US9378526B2 (en) System and method for accessing data objects via remote references
US7836055B2 (en) XNA relationship management
US8166347B2 (en) Automatic testing for dynamic applications
US20140215446A1 (en) Automated Porting of Application to Mobile Infrastructures
US20070288412A1 (en) Method, system and program product for generating an implementation of a business rule including a volatile portion
US20040250258A1 (en) System and method for rule based object navigation
US20030188036A1 (en) Methods and systems for program migration
US20070178968A1 (en) Displaying game asset relationship in a game development environment
US20130152064A1 (en) Classloader/Instrumentation Approach For Invoking Non-Bound Libraries
US8311794B2 (en) Testing executable logic
US8935288B2 (en) User specific logs in multi-user applications
US10083016B1 (en) Procedurally specifying calculated database fields, and populating them
US20130167048A1 (en) Context dependent personalization of reuse components for a user interface
US20150205603A1 (en) Code transformation using extensibility libraries
US9753701B2 (en) Generating logic with scripting language in software as a service enterprise resource planning
US20200081709A1 (en) Component management platform
KR20120002579A (en) Extending collaboration capabilities to external data
EP1634166B1 (en) System and method for incremental object generation
US8433729B2 (en) Method and system for automatically generating a communication interface

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19912319

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19912319

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19912319

Country of ref document: EP

Kind code of ref document: A1