Rule updating method, terminal, device and computer-readable storage medium

By comparing and verifying the main path rules and bypass rules executed by the terminal, the problem of rule update errors caused by changes in business rules in the financial industry is solved, ensuring the stability of the rules and the reliability of the business, and meeting the high security and safety requirements of the financial industry. Real-time requirements.

CN112348523BActive Publication Date: 2024-08-27WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011163736.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-27
Publication Date
2024-08-27
Estimated Expiration
2040-10-27

AI Technical Summary

Technical Problem

Frequent changes in business rules in the financial industry lead to errors or failures when terminals execute new rules, affecting business availability.

Method used

By obtaining the parameters output by the terminal after executing the request using the main path rules and the bypass rules, compare and verify that the version of the bypass rules is higher than the main path rules. If they match, replace the main path rules to update the rules to ensure the correctness and stability of the rules. sex.

Benefits of technology

It avoids errors or failures when the terminal executes new rules, ensures the stability and reliability of business rules, and improves the security and real-time performance of the financial industry's technical requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112348523B
    Figure CN112348523B
Patent Text Reader

Abstract

The present invention relates to the field of financial technology, and discloses a rule updating method, terminal, device, and computer-readable storage medium. The rule updating method includes: obtaining a first parameter and obtaining a second parameter, wherein the first parameter is a parameter output after the terminal uses a main path rule to execute a request, and the second parameter is a parameter output after the terminal uses a bypass rule to execute the request, and the version of the bypass rule is higher than the version of the main path rule; determining whether the second parameter matches the first parameter; when the second parameter matches the first parameter, replacing the main path rule with the bypass rule to update the main path rule. The present invention avoids errors or failures in the execution of new rules by terminals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of financial technology (Fintech), and in particular to a rule updating method, terminal, device and computer-readable storage medium. Background Art

[0002] With the development of computer technology, more and more technologies are being applied in the financial field. The traditional financial industry is gradually transforming into financial technology (Fintech). However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology.

[0003] With the dramatic changes in the financial environment and people's quietly changing consumption habits, the business changes in the financial industry are becoming more frequent and dramatic. In this case, business rules will change frequently. Changes in business rules require the terminal rules to be updated to adapt to the business.

[0004] However, the new rules may have defects, which may cause errors or failures when the terminal executes the new rules, thereby making the inspection service of the corresponding business rules unavailable, affecting the business. Summary of the invention

[0005] The main purpose of the present invention is to provide a rule updating method, terminal, device and computer-readable storage medium, aiming to solve the problem that errors or failures in executing new rules by the terminal affect the business.

[0006] To achieve the above object, the present invention provides a rule updating method, the rule updating method comprising:

[0007] Obtain a first parameter and obtain a second parameter, wherein the first parameter is a parameter output after the terminal executes the request using a main path rule, and the second parameter is a parameter output after the terminal executes the request using a bypass rule, and the version of the bypass rule is higher than the version of the main path rule;

[0008] determining whether the second parameter matches the first parameter;

[0009] When the second parameter matches the first parameter, the main path rule is replaced with the bypass rule to update the main path rule.

[0010] In one embodiment, after the step of obtaining the second parameter, the method further includes:

[0011] Determining whether the second parameter meets a preset condition;

[0012] When the second parameter meets the preset condition, performing the step of determining whether the second parameter matches the first parameter;

[0013] When the second parameter does not match the preset threshold, the rule file of the bypass rule is modified according to the second parameter to update the bypass rule, and the request is executed using the updated bypass rule to return to the step of obtaining the second parameter.

[0014] In one embodiment, after the step of determining whether the second parameter matches the first parameter, the method further includes:

[0015] When the second parameter does not match the first parameter, the rule file of the bypass rule is modified according to the second parameter to update the bypass rule, and the request is executed using the updated bypass rule to return to the step of obtaining the second parameter.

[0016] In one embodiment, the step of the terminal acquiring the first parameter and acquiring the second parameter includes:

[0017] When a rule version update is detected, the bypass rule corresponding to the latest version of the rule is obtained, and the request

[0018] The request is executed using the current main path rule to obtain the first parameter, and the request is executed using the bypass rule to obtain the second parameter.

[0019] In one embodiment, the step of using the bypass rule to execute the request to obtain the second parameter includes:

[0020] Obtaining the execution strategy corresponding to the bypass rule;

[0021] Determining a target request among the requests according to the execution strategy;

[0022] The bypass rule is used to execute the target request to obtain a second parameter.

[0023] In one embodiment, the execution strategy includes the application scenario of the bypass rule, the execution time period of the bypass rule, the status of the bypass rule and / or the request ratio; the request ratio is the ratio between the number of main rule execution requests and the number of bypass rule execution requests.

[0024] In one embodiment, after the step of obtaining the execution strategy corresponding to the bypass rule, the method further includes:

[0025] Determining whether the bypass rule meets an enabling condition according to the execution strategy;

[0026] When it is determined that the bypass rule satisfies the enabling condition, the step of determining the target request among the requests according to the execution strategy is performed.

[0027] In one embodiment, the enabling condition includes at least one of the following:

[0028] The application scenario corresponding to the request matches the application scenario of the bypass rule;

[0029] The current time point is in the execution time period of the bypass rule;

[0030] The status of the bypass rule is enabled.

[0031] In one embodiment, the execution strategy includes the request ratio, and the step of obtaining the execution strategy corresponding to the bypass rule includes:

[0032] Obtaining load parameters of the terminal;

[0033] The request ratio is determined according to the load parameter, wherein the load parameter and the request ratio are negatively correlated.

[0034] In one embodiment, the strategy includes the request ratio, and the step of obtaining the execution strategy corresponding to the bypass rule includes:

[0035] Get the log of the terminal executing the rule within the target time period;

[0036] Determine a third parameter output by the terminal executing the rule according to the log, and obtain a total number of times the terminal executes the rule according to the log;

[0037] Classifying each of the third parameters to obtain the number of each type of third parameters;

[0038] A minimum number is determined among the numbers, and the request ratio is determined according to a ratio of the minimum number to the total number of times.

[0039] In one embodiment, after the step of obtaining the second parameter, the method further includes:

[0040] determining a difference between the first parameter and the second parameter;

[0041] When the difference is less than a preset difference, the step of determining whether the second parameter matches the first parameter is performed.

[0042] To achieve the above object, the present invention further provides a terminal, comprising:

[0043] an acquisition module, configured to acquire a first parameter and a second parameter, wherein the first parameter is a parameter output after the terminal executes the request using a main path rule, and the second parameter is a parameter output after the terminal executes the request using a bypass rule, and the version of the bypass rule is higher than the version of the main path rule;

[0044] A determination module, used to determine whether the second parameter matches the first parameter;

[0045] An updating module is used to replace the main path rule with the bypass rule when the second parameter matches the first parameter, so as to update the main path rule.

[0046] To achieve the above objectives, the present invention also provides a device, comprising a memory, a processor, and an update program stored in the memory and executable on the processor, wherein the update program implements the rule update method as described above when executed by the processor.

[0047] To achieve the above object, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores an update program, and when the update program is executed by a processor, the update method of the rules described above is implemented.

[0048] The present invention provides a rule updating method, terminal, device and readable storage medium, wherein the terminal obtains a first parameter outputted by executing a request using a main rule and a second parameter outputted by executing a request using a bypass rule, wherein the version of the main rule is lower than the version of the bypass rule, and when the first parameter matches the second parameter, the main rule of the terminal is replaced with the bypass rule. The present invention obtains parameters by executing the main rule and the bypass rule respectively, and then verifies whether the bypass rule has defects according to the parameters, and the version of the bypass rule is higher than the version of the main rule, that is, verifying the defects of the bypass rule is to verify the new rule, and then updating the rule after the verification is successful, so as to avoid errors or failures in the execution of the new rule by the terminal, thereby avoiding the impact on the business. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of the hardware structure of a terminal in a hardware operating environment involved in an embodiment of the present invention;

[0050] Figure 2 It is a flowchart of a first embodiment of a method for updating rules of the present invention;

[0051] Figure 3 It is a flow chart of a second embodiment of the method for updating rules of the present invention;

[0052] Figure 4 It is a flowchart of a third embodiment of the method for updating rules of the present invention;

[0053] Figure 5 It is a flowchart of a fourth embodiment of the method for updating rules of the present invention;

[0054] Figure 6 It is a schematic diagram of the functional modules of the terminal of the present invention.

[0055] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0056] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0057] Reference Figure 1 , Figure 1 The embodiment of the present invention is a schematic diagram of the hardware structure of the hardware operating environment of the terminal or device involved.

[0058] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0059] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0060] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an update program.

[0061] exist Figure 1 In the terminal shown, the network interface 1004 is mainly used to connect to the background terminal and perform data communication with the background terminal; the user interface 1003 is mainly used to connect to the client and perform data communication with the client; and the processor 1001 can be used to call the update program stored in the memory 1005 and perform the following operations:

[0062] Obtain a first parameter and obtain a second parameter, wherein the first parameter is a parameter output after the terminal executes the request using a main path rule, and the second parameter is a parameter output after the terminal executes the request using a bypass rule, and the version of the bypass rule is higher than the version of the main path rule;

[0063] determining whether the second parameter matches the first parameter;

[0064] When the second parameter matches the first parameter, the main path rule is replaced with the bypass rule to update the main path rule.

[0065] In one embodiment, the processor 1001 may call the update program stored in the memory 1005, and further perform the following operations:

[0066] Determining whether the second parameter meets a preset condition;

[0067] When the second parameter meets the preset condition, performing the step of determining whether the second parameter matches the first parameter;

[0068] When the second parameter does not match the preset threshold, the rule file of the bypass rule is modified according to the second parameter to update the bypass rule, and the request is executed using the updated bypass rule to return to the step of obtaining the second parameter.

[0069] In one embodiment, the processor 1001 may call the update program stored in the memory 1005, and further perform the following operations:

[0070] When the second parameter does not match the first parameter, the rule file of the bypass rule is modified according to the second parameter to update the bypass rule, and the request is executed using the updated bypass rule to return to the step of obtaining the second parameter.

[0071] In one embodiment, the processor 1001 may call the update program stored in the memory 1005, and further perform the following operations:

[0072] When a rule version update is detected, the bypass rule corresponding to the latest version of the rule is obtained, and the request

[0073] The request is executed using the current main path rule to obtain the first parameter, and the request is executed using the bypass rule to obtain the second parameter.

[0074] In one embodiment, the processor 1001 may call the update program stored in the memory 1005, and further perform the following operations:

[0075] Obtaining the execution strategy corresponding to the bypass rule;

[0076] Determining a target request among the requests according to the execution strategy;

[0077] The bypass rule is used to execute the target request to obtain a second parameter.

[0078] In one embodiment, the processor 1001 may call the update program stored in the memory 1005, and further perform the following operations:

[0079] The execution strategy includes the application scenario of the bypass rule, the execution time period of the bypass rule, the status of the bypass rule and / or the request ratio; the request ratio is the ratio between the number of main rule execution requests and the number of bypass rule execution requests.

[0080] In one embodiment, the processor 1001 may call the update program stored in the memory 1005, and further perform the following operations:

[0081] Determining whether the bypass rule meets an enabling condition according to the execution strategy;

[0082] When it is determined that the bypass rule satisfies the enabling condition, the step of determining the target request among the requests according to the execution strategy is performed.

[0083] In one embodiment, the processor 1001 may call the update program stored in the memory 1005, and further perform the following operations:

[0084] The application scenario corresponding to the request matches the application scenario of the bypass rule;

[0085] The current time point is in the execution time period of the bypass rule;

[0086] The status of the bypass rule is enabled.

[0087] In one embodiment, the processor 1001 may call the update program stored in the memory 1005, and further perform the following operations:

[0088] Obtaining load parameters of the terminal;

[0089] The request ratio is determined according to the load parameter, wherein the load parameter and the request ratio are negatively correlated.

[0090] In one embodiment, the processor 1001 may call the update program stored in the memory 1005, and further perform the following operations:

[0091] Get the log of the terminal executing the rule within the target time period;

[0092] Determine a third parameter output by the terminal executing the rule according to the log, and obtain a total number of times the terminal executes the rule according to the log;

[0093] Classifying each of the third parameters to obtain the number of each type of third parameters;

[0094] A minimum number is determined among the numbers, and the request ratio is determined according to a ratio of the minimum number to the total number of times.

[0095] In one embodiment, the processor 1001 may call the update program stored in the memory 1005, and further perform the following operations:

[0096] determining a difference between the first parameter and the second parameter;

[0097] When the difference is less than a preset difference, the step of determining whether the second parameter matches the first parameter is performed.

[0098] Based on the hardware structure of the above terminal, various embodiments of the rule updating method of the present invention are proposed.

[0099] The invention provides a rule updating method.

[0100] Reference Figure 2 , Figure 2 This is a first embodiment of a method for updating rules of the present invention, and the method for updating rules includes:

[0101] Step S10, obtaining a first parameter, wherein the first parameter is a parameter output after the terminal executes the request using a main path rule, and the second parameter is a parameter output after the terminal executes the request using a bypass rule, and the version of the bypass rule is higher than the version of the main path rule;

[0102] Step S20, obtaining a second parameter, where the second parameter is a parameter output by the terminal after executing the request using a bypass rule, and the version of the bypass rule is higher than the version of the main rule;

[0103] In this embodiment, the execution subject is a terminal. A rule engine is provided in the terminal. The rule engine is a component embedded in the application program, which can separate business decisions from the application program code and use predefined semantic writing modules to make business decisions. The rule engine can separate complex and redundant business rules from the entire system to achieve reusable and transplantable architecture. In this embodiment, the rules are executed by the rule engine. Specifically, the rule file corresponding to the rule is loaded into the rule engine, the rule engine receives the input of the data, and uses the rules based on the loaded rule file to analyze the input data, and then outputs the parameters.

[0104] The terminal can be regarded as a server or business system. When a new rule changes, the rule publishing center will send the information to the terminal, and the terminal will download and obtain the rule file corresponding to the new rule, and copy the rule file. Through different naming methods, one rule file is named the main rule, and the other rule file is named the bypass rule, that is, the main rule and the bypass rule have the same rule file.

[0105] Assume that the rule file corresponding to the main route rule RULE_A is rule_A_main_v1.ser. Among them, rule_A is the rule signature, which is equivalent to the ID of the rule, main indicates that the rule file is the rule file of the main route rule, and v1 is the version number of the rule. In practice, the rule file (rule_A_main_v1.ser) is published to the terminal through the rule publishing center. The file name of the rule file will be removed by the publishing center without the version number for deployment on the terminal. That is, after the rule is deployed to the terminal, the rule file of the rule engine runtime environment is rule_A_main.ser. If the business needs to be adjusted, the logic in the corresponding rule of the business needs to be changed, and the rule file is changed to version V2. The corresponding rule file is rule_A_main_v2.ser.

[0106] Furthermore, when the updated rule is released to v2 through the rule publishing center, the bypass rule file rule_A_side_v2.ser of version v2 is first released to the terminal, and the terminal registers the bypass rule file on the rule engine, that is, the signature of the bypass rule registration is RULE_A_BAK, and the version number is removed, the rule file rule_A_side.ser. side indicates that the rule file is a rule file of the bypass rule.

[0107] After obtaining the bypass rule, the terminal obtains each request, which may be a service request. For example, the request may be an account opening request, a payment request, a recharge request, etc. The terminal executes each request through the current main route rule to obtain the first parameter, and executes each request through the bypass rule to obtain the second parameter. The version of the main route rule is lower than the version of the bypass rule.

[0108] It should be noted that in the terminal using the rule engine for business decision-making, the rules that affect the business process when executed are the main rules. The rules that are only used to obtain the parameters output after the rule is executed for analyzing the rationality of the rule and do not affect the business process are bypass rules.

[0109] Step S30, determining whether the second parameter matches the first parameter;

[0110] Step S40: When the second parameter matches the first parameter, the main path rule is replaced with the bypass rule to update the main path rule.

[0111] After obtaining the first parameter and the second parameter, the terminal determines whether the second parameter matches the first parameter. Specifically, the terminal calculates the difference between the second parameter and the first parameter, and the difference represents the difference between the first parameter and the second parameter. If the difference is less than the preset difference, it can be determined that the second parameter matches the first parameter, that is, whether the difference is as expected. It should be noted that if there are multiple requests for the engine rule execution, the requests corresponding to the first parameter and the second parameter to be compared are the same, that is, each request corresponds to a difference. If the number of differences is less than the preset difference is below the preset number, it is determined that the first parameter matches the second parameter.

[0112] It should be noted that the first parameter and the second parameter can be specific values ​​or conclusions after executing the request. If the first parameter and the second parameter are values, the difference between the two is used to determine whether the first parameter matches the second parameter. If the first parameter and the second parameter are conclusions, the two conclusions are compared to see if they are consistent. If they are consistent, the second parameter matches the first parameter.

[0113] When the terminal determines that the second parameter matches the first parameter, it can be determined that the terminal will not make mistakes or fail in executing the new rule. The terminal then replaces the main rule with the bypass rule, thereby completing the update of the main rule.

[0114] In the prior art, by executing the V1 version of the rules and the V2 version of the rules in the same or similar scenarios, and then detecting the differences between the parameters of the rule outputs, it is possible to evaluate whether the V2 version of the rules meet expectations. However, it is difficult to find 100% consistent requests for the parameters of the request evaluated by the V2 version and the parameters of the request evaluated by the V1 version. Only roughly similar requests can be found for horizontal comparison; from a statistical point of view, it is difficult to find requests with completely consistent conditions for comparative analysis, so the accuracy of evaluating the difference between the V2 version and the V1 version is reduced. In this embodiment, different versions of the rules are executed through the same request to obtain parameters for evaluating the higher version of the rules, which can more accurately evaluate whether the higher version of the rules meet expectations.

[0115] In the technical solution provided in this embodiment, the terminal obtains the first parameter output by executing the request using the main route rule and the second parameter output by executing the request using the bypass rule. The version of the main route rule is lower than the version of the bypass rule. When the first parameter matches the second parameter, the main route rule of the terminal is replaced by the bypass rule. The present invention obtains parameters by executing the main route rule and the bypass rule respectively, and then verifies whether the bypass rule has defects according to the parameters. The version of the bypass rule is higher than the version of the main route rule, that is, verifying the defects of the bypass rule is to verify the new rule, and then updating the rule after the verification is successful, so as to avoid errors or failures in the execution of the new rule by the terminal, thereby avoiding the impact on the business.

[0116] Reference Figure 3 , Figure 3 The second embodiment of the rule updating method of the present invention is based on the first embodiment, and after step S20, further includes:

[0117] Step S50, determining whether the second parameter meets a preset condition;

[0118] Step S60, when the second parameter meets the preset condition, executing the step of determining whether the second parameter matches the first parameter;

[0119] In this embodiment, after obtaining the second parameter, the terminal needs to determine whether there is a logical problem in the bypass rule based on the second parameter, that is, determine whether there is a defect in the bypass rule. Specifically, the terminal stores the preset conditions corresponding to the request, and the preset conditions execute the expected results of the request. The terminal determines whether the second parameter meets the preset conditions. If the second parameter meets the preset conditions, the terminal determines whether the second parameter matches the first parameter, and when the first parameter matches the second parameter, the main path rule is replaced with the bypass rule, that is, step S30 is executed. The following is a specific example:

[0120] The old version of the rule is that between 1am and 2am, if the total amount of user transfers exceeds 10,000 yuan, face scanning is required to verify the user's identity. But now it is found that the risk of exceeding 10,000 yuan is not high. In order to improve the user experience and reduce the amount of face scanning, the rule is modified to face scanning to verify the user's identity between 1am and 2am, and the total transaction amount exceeds 20,000 yuan. Assume that the rule has variables: transaction time and total amount, the transaction time is txn_time, and the total amount is the total transaction amount in the last hour txn_total_amt_1h. After modifying the business rules in the main road rule file V2 and deploying it to the bypass, observe the transaction amount of users between 1am and 2am during the transaction time txn_tim. If the transaction txn_total_amt_1h is greater than 1w and less than 2w, but there is face scanning, it does not meet expectations. If the rule outputs face scanning only when txn_total_amt_1h is greater than 2w, it meets expectations. The transaction amount of users between 1am and 2am in the above observation is regarded as a request, and the preset condition is that the amount is greater than 2w and the identity is verified by face scanning.

[0121] Step S70: When the second parameter does not satisfy the preset condition, modify the rule file of the bypass rule according to the second parameter to update the bypass rule, and use the updated bypass rule to execute the request.

[0122] When the second parameter does not meet the preset conditions, it can be determined that there is a problem with the logic of the bypass rule file, causing an error when the terminal executes the bypass rule. In this regard, the terminal determines the logic corresponding to the request based on the request corresponding to the second parameter, thereby changing the logic in the bypass rule file to update the bypass rule file, and the terminal returns to execute the step of obtaining the second parameter. The modification work can be modified by the rule publisher, that is, after determining that the second parameter does not meet the preset conditions, the terminal sends the second parameter and the request corresponding to the second parameter to the preset terminal (the preset terminal is the terminal of the rule publisher), and the preset terminal then sends the modified bypass rule file to the terminal or the rule publishing center, and finally the terminal adopts the updated bypass rule execution request.

[0123] In the technical solution provided in this embodiment, after obtaining the second parameter, the terminal determines whether the second eating sweet potato meets the preset conditions. If the preset conditions are met, the main rule is replaced with the bypass rule; if the preset conditions are not met, the bypass rule file is modified to update the bypass rule, and the request is executed through the updated bypass rule, thereby returning to obtain the second parameter until the bypass rule is modified to an error-free bypass rule, thereby ensuring that there will be no errors when the terminal executes the new rule.

[0124] Reference Figure 4 , Figure 4 This is a third embodiment of the rule updating method of the present invention, based on the first or second embodiment, after step S30, further comprising:

[0125] Step S80: When the second parameter does not match the first parameter, modify the rule file of the bypass rule according to the second parameter, and use the updated rule file to execute the request.

[0126] In this embodiment, after obtaining the second parameter, the terminal needs to determine whether the second parameter matches the first parameter. The specific process of matching the first parameter with the second parameter is described above. When the first parameter matches the second parameter, it can be determined that there is no logical error in the rule file of the bypass rule, and the terminal replaces the main rule with a higher version of the bypass rule, thereby completing the version upgrade of the main rule.

[0127] When the second parameter does not match the first parameter, it can be determined that the bypass rule is wrong, and it is necessary to modify the rule file corresponding to the bypass rule with the second parameter to update the bypass rule, and then use the update bypass rule execution request to return to the step of obtaining the second parameter. The specific process of modifying the rule file according to the second parameter refers to the above description.

[0128] It should be noted that the mismatch between the second parameter and the first parameter may not be due to a logical error in the rule file of the bypass rule. Therefore, it is necessary to first determine whether the cause of the mismatch between the two is a logical error in the bypass rule file. If the cause is determined to be a logical error in the bypass rule file, the bypass rule file should be modified. In addition, whether the second parameter meets the preset conditions also requires first determining whether the cause of the mismatch between the two is a logical error in the bypass rule file. The terminal can first determine whether the second parameter meets the preset conditions. If so, it further determines whether the second parameter matches the first parameter.

[0129] In the technical solution provided in this embodiment, after obtaining the second parameter, the terminal determines whether the second parameter matches the first parameter. If it matches, the main rule is replaced with the bypass rule. If it does not match, the rule file of the bypass rule is modified according to the second parameter to update the bypass rule, and the request is executed through the updated bypass rule, thereby returning to obtain the second parameter until the bypass rule is modified to an error-free bypass rule, thereby ensuring that there will be no errors when the terminal executes the new rule.

[0130] Reference Figure 5 , Figure 5 This is the fourth embodiment of the rule updating method of the present invention, and the step S10 and the step S20 include:

[0131] Step S11, when a rule version update is detected, a bypass rule corresponding to the latest version of the rule is obtained, and a request is obtained;

[0132] Step S12, executing the request using the current main path rule to obtain the first parameter, and executing the request using the bypass rule to obtain the second parameter.

[0133] In this embodiment, when the rule publishing center detects that the rule version has been updated, it will send information to the terminal so that the terminal detects that the rule version has been updated. The terminal downloads the bypass rule corresponding to the latest version through the rule publishing center, or the rule publishing center directly deploys the text of the bypass rule to the rule engine of the terminal so that the terminal obtains the bypass rule corresponding to the latest version of the rule. The terminal obtains each request.

[0134] The terminal uses the current main path rule to execute the request to obtain the first parameter, and uses the bypass path rule to execute the request to obtain the second parameter.

[0135] The process of the terminal using the current main route rule to execute the request to obtain the first parameter is as follows:

[0136] The terminal calls the rule execution tool class RuleExecutor to make the rule engine execute the main route rule, and the parameters passed in include: rule signature (rule_alias), rule input parameter object input_obj, and empty rule output parameter object output_obj. The execution tool class RuleExecutor calls the rule engine through the parameters. The steps for the rule engine to execute the main route rule are:

[0137] A. Load the corresponding rule file (the rule file of the main road rule) through the rule signature (rule_alias);

[0138] B. Implement main road rules;

[0139] C. Set the output parameters of the main rule execution to the rule output object output_obj.

[0140] RuleExecutor then processes the rule execution results. Specifically, the detailed information of the main rule execution is recorded in the main rule execution details table: rule_exec_detl_main. The execution details table includes: call serial number, rule information (signature and version number), rule engine input parameter details, rule engine output parameter details; RuleExecutor sends the rule execution results to the terminal, including: rule signature (RULE_A), rule version (v1), rule execution conclusion (1-pass; 2-reject; 3-verify short). The execution result is the first parameter.

[0141] The process for the terminal to obtain the second parameter by executing the request using the bypass rule is as follows:

[0142] RuleExecutor starts a new thread to call the bypass rule service SideRuleExecService, passing in the parameters, which are the rule signature (rule_alias), the rule input parameter object input_obj, and the empty rule output parameter object output_obj. The process of executing bypass rules can be consistent with the process of executing main rules, which will not be repeated here.

[0143] The execution of the main route rules and bypass rules by the terminal is asynchronous execution. Asynchronous execution means that the execution of the main route rules and the execution of the bypass rules will not affect each other, that is, the execution of the bypass rules will not affect the key indicators such as the pass rate, response time, and error rate of the main route. It can be understood that based on asynchronous execution, the terminal can execute the main route rules first and then the bypass rules, can execute the bypass rules first and then the main route rules, or can execute the main route rules and bypass rules at the same time.

[0144] In the technical solution provided in this embodiment, when the terminal detects a version update, it obtains the bypass rules corresponding to the latest version of the rules and obtains the request, and uses the current main rule to execute the request to obtain the first parameter, and uses the bypass rule to execute the request to obtain the second parameter, thereby updating the main rule according to the first parameter and the second parameter to avoid errors when the terminal executes the new rule.

[0145] In one embodiment, using the bypass rule to execute the request to obtain the second parameter includes:

[0146] C1. Obtaining the execution strategy corresponding to the bypass rule;

[0147] C2. determining a target request among the requests according to the execution strategy;

[0148] C3. Use the bypass rule to execute the target request to obtain a second parameter.

[0149] In this embodiment, before executing the bypass rule, the terminal will establish a bypass configuration table cfg_rule_sideway. The bypass configuration table includes: rule_alias: main rule signature; sw_rule_alias: bypass rule signature; oper_type: rule application scenario, such as account opening, payment, recharge, etc.; desc: Chinese description of the rule application scenario; enabled: whether the bypass rule is enabled; effect_from: bypass rule enablement start time; expire_date: bypass rule enablement end time; percent: the proportion of bypass rules relative to the main rule. The following table is an example of bypass configuration information:

[0150]

[0151] The terminal can obtain the execution strategy of the bypass rule based on the bypass configuration information. The execution strategy includes the application scenario of the bypass rule, the execution time period of the bypass rule, the status of the bypass rule and / or the request ratio; wherein the request ratio is the ratio between the number of main rule execution requests and the number of bypass rule execution requests, that is, the request ratio is the ratio of the bypass rule to the main rule. The execution time period of the bypass rule is determined according to effect_from and expire_date. The status of the bypass rule is determined according to whether the bypass rule is enabled, and the status is enabled or not. Y in the above table means that the bypass rule is enabled.

[0152] The terminal determines the target request in each request according to the execution strategy. Specifically, if the execution strategy requires the application scenarios of the bypass rule to be account opening, payment, and recharge, the request for account opening, payment, and recharge will be determined as the target request. In addition, the terminal can determine the target request according to the request ratio. For example, if the request ratio is 30%, and the number of requests when executing the main route rule is 10, then 3 requests are randomly obtained from 10 requests as the target request.

[0153] There are two ways to determine the request ratio.

[0154] Method A: Obtain the load parameter of the terminal, and then determine the request ratio based on the load parameter. The load parameter and the request ratio are negatively correlated, that is, the larger the load parameter, the smaller the request ratio. That is, if the load of the terminal is small, the request ratio is set to be small, so that multiple requests can be used to more comprehensively and accurately determine whether the bypass rule is wrong. If the load is large, set the request ratio to be small to avoid terminal overload. The load parameter can be characterized by the response time of the terminal. The longer the response time, the greater the load. The load parameter can also be characterized by the load condition.

[0155] Method B: Obtain the log of the terminal executing the rule within the target time period, and the target time period is preferably the last few days. The log records the parameters output by the terminal to execute the rule, the type of parameter, and the total number of times the rule is executed. The terminal determines the third parameter output by the terminal to execute the rule and the total number of times the rule is executed based on the log. The terminal then classifies each third parameter to obtain the number of each type of third parameter, and determines the smallest number among each number. The ratio of the smallest number to the total number can determine the request ratio. The application scenarios corresponding to each type of third parameter are the same.

[0156] Specifically, for target time period selection: the target time period is generally selected to be more than 24 hours, 24 hours can represent a complete sampling cycle, and generally in T+1 (1 is one day, T is hours), rule_exec_detl_main (rule_exec_detl_main can be regarded as the log of executing rules in the terminal T+1) checks whether the scenarios of various input parameters are verified in the bypass rules, that is, statistics the various types of input parameters saved in rule_exec_detl_main. If there are unverified scenarios, you can add another day to increase the target time period, that is, the target time period changes from T+1 to T+2 days, until all scenarios have been verified.

[0157] The minimum value of the request ratio can be set by analyzing the historical data of rule_exec_detl_main. Take the following steps: Count the minimum number of times L of each type of rule input parameter in table rule_exec_detl_main every day during the target time period, L divided by the total number of times the rule is run M, L / M is the ratio of the least frequent application scenarios. The request ratio can be set to be greater than or equal to L / M.

[0158] As for the maximum value of the request ratio, the adopted strategy is: on the basis of the minimum number of times, the minimum request ratio is increased through the terminal load parameters, that is, when the load and response time are small, the request ratio is increased.

[0159] In one embodiment, after the step of obtaining the execution strategy corresponding to the bypass rule, the method further includes:

[0160] S1. Determine whether the bypass rule meets the enabling condition according to the execution strategy;

[0161] S2. When it is determined that the bypass rule satisfies the enabling condition, the step of determining the target request in each of the requests according to the execution strategy is executed.

[0162] In this embodiment, after determining the execution strategy, the terminal needs to determine whether the bypass rule meets the enabling conditions according to the execution strategy. If it does, the step of determining the target request in each request according to the execution strategy is executed. The enabling conditions include at least one of the following: the application scenario corresponding to the request matches the application scenario of the bypass rule, the current time point is in the execution time period of the bypass rule, and the bypass rule is enabled. The terminal can accurately determine whether the terminal needs to update the main path rule through the enabling conditions.

[0163] The updating method of the rules of the present invention mainly comprises the following steps:

[0164] A. The terminal obtains the bypass rules corresponding to the latest version of the rules released by the rule publishing center;

[0165] B. The terminal uses the current main rule execution request to obtain the first parameter, and uses the bypass rule execution request to obtain the second parameter;

[0166] C. The terminal determines whether the second parameter meets the preset condition to determine whether the execution result of the bypass rule meets expectations;

[0167] D. If it meets expectations, determine whether the first parameter matches the second parameter to determine whether the bypass rule is wrong. If it is not wrong, replace the main rule with the bypass rule to complete the update of the first version of the main rule.

[0168] E. If the second parameter does not meet the preset condition, or the first parameter does not match the second parameter, modify the rule file of the bypass rule and return to step B to re-acquire the second parameter.

[0169] The above method for updating the main road rules has the following advantages:

[0170] The route rules are executed asynchronously, which does not affect the response time of the main route service (the main route service is used to execute the main route rules) and has little impact on the throughput of the main route service;

[0171] The monitoring platform in the terminal can be used to observe the operating status of the main and bypass rules in real time. If after updating the rules, the conclusion ratio of the new and old versions of the rules does not meet expectations, early intervention can be made. For example, monitor the bypass rule conclusion pass rate. If the real-time pass rate is lower than a certain threshold, promptly notify the rule person in charge of the relevant stakeholders and confirm the business rules in the bypass rules. If it is found that the rules do not meet expectations, it is necessary to push the business rules in the rules to adjust them, and then publish the rule file of the bypass rules again, and update the bypass rules online again;

[0172] For the same request, the input parameters are the same when the main rule and bypass rule are running. It is easier to measure whether the bypass rule meets expectations by comparing the differences in conclusions.

[0173] Before updating the main road rules, first verify them through the bypass rules. After verification, update the main road to reduce various operational risks caused by the main road rule update.

[0174] The invention also provides a terminal.

[0175] Reference Figure 6 , Figure 6 It is a schematic diagram of the functional modules of the terminal of the present invention.

[0176] like Figure 6 As shown, the terminal includes:

[0177] An acquisition module 10 is used to acquire a first parameter and a second parameter, wherein the first parameter is a parameter output after the terminal executes the request using a main path rule, and the second parameter is a parameter output after the terminal executes the request using a bypass rule, and the version of the bypass rule is higher than the version of the main path rule;

[0178] A determination module 20, configured to determine whether the second parameter matches the first parameter;

[0179] The updating module 30 is configured to replace the main path rule with the bypass rule when the second parameter matches the first parameter, so as to update the main path rule.

[0180] In one embodiment, the terminal comprises:

[0181] A determination module, used to determine whether the second parameter meets a preset condition;

[0182] an execution module, configured to execute the step of determining whether the second parameter matches the first parameter when the second parameter meets the preset condition;

[0183] A modification module is used to modify the rule file of the bypass rule according to the second parameter to update the bypass rule when the second parameter does not match the preset threshold, and use the updated bypass rule to execute the request to return to the step of obtaining the second parameter.

[0184] In one embodiment, the terminal comprises:

[0185] A determination module, used to determine whether the second parameter matches the first parameter;

[0186] an execution module, configured to execute the step of updating the current rule of the terminal to the main path rule when the second parameter matches the first parameter;

[0187] An update module is used to modify the rule file of the bypass rule according to the second parameter to update the bypass rule when the second parameter does not match the first parameter, and use the updated bypass rule to execute the request to return to the step of obtaining the second parameter.

[0188] In one embodiment, the terminal comprises:

[0189] The acquisition module is used to obtain the bypass rules corresponding to the latest version of the rules when a rule version update is detected, and obtain the request

[0190] An execution module is used to use the current main path rule to execute the request to obtain the first parameter, and use the bypass rule to execute the request to obtain the second parameter.

[0191] In one embodiment, the terminal comprises:

[0192] An acquisition module, used to acquire an execution strategy corresponding to the bypass rule;

[0193] A determination module, configured to determine a target request among the requests according to the execution strategy;

[0194] An execution module is used to execute the target request using the bypass rule to obtain a second parameter.

[0195] In one embodiment, the terminal comprises:

[0196] A determination module, configured to determine whether the bypass rule satisfies an enabling condition according to the execution strategy;

[0197] An execution module is used to execute the step of determining a target request in each of the requests according to the execution strategy when it is determined that the bypass rule meets the activation condition.

[0198] In one embodiment, the terminal comprises:

[0199] An acquisition module, used for acquiring load parameters of the terminal;

[0200] A determination module is used to determine the request ratio according to the load parameter, wherein the load parameter and the request ratio are negatively correlated.

[0201] In one embodiment, the terminal comprises:

[0202] The acquisition module is used to obtain the log of the terminal executing the rule within the target time period;

[0203] a determination module, configured to determine a third parameter output by the terminal executing the rule according to the log, and obtain a total number of times the terminal executes the rule according to the log;

[0204] A classification module, used for classifying each of the third parameters to obtain the quantity of each type of third parameters;

[0205] The determination module is used to determine a minimum number among the various numbers, and determine the request ratio according to the ratio of the minimum number to the total number of times.

[0206] In one embodiment, the terminal comprises:

[0207] A determination module, configured to determine a difference between the first parameter and the second parameter;

[0208] An execution module is used to execute the step of determining whether the second parameter matches the first parameter when the difference is less than a preset difference.

[0209] Among them, the functional implementation of each module in the above-mentioned terminal corresponds to each step in the above-mentioned rule updating method embodiment, and its functions and implementation processes are no longer repeated here one by one.

[0210] The present invention also provides a computer-readable storage medium having an update program stored thereon, wherein when the determination program is executed by a processor, the steps of the rule update method as described in any of the above embodiments are implemented.

[0211] The specific embodiments of the computer-readable storage medium of the present invention are substantially the same as the embodiments of the above-mentioned rule updating method, and are not described in detail herein.

[0212] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0213] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0214] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0215] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A rule updating method, It is characterized in that include: When a version update of a rule is detected, a bypass rule corresponding to the latest version of the rule is obtained, and a request is obtained, wherein the request includes a variable value corresponding to the rule variable and generated in real time by the terminal; Using the current main path rule to execute the request to obtain the first parameter, the version of the main path rule being lower than the version of the bypass rule; Obtaining an execution strategy corresponding to the bypass rule, wherein the execution strategy includes an application scenario of the bypass rule, an execution time period of the bypass rule, a status of the bypass rule and / or a request ratio; The request ratio is the ratio between the number of the main path rule execution requests and the number of the bypass path rule execution requests; Determining a target request among the requests according to the execution strategy; Executing the target request using the bypass rule to obtain a second parameter; Determining whether the second parameter meets a preset condition; If the preset condition is met, determining whether the second parameter matches the first parameter; When the second parameter matches the first parameter, replacing the main path rule with the bypass rule to update the main path rule; If the preset condition is not met, the rule file of the bypass rule is modified according to the second parameter to update the bypass rule, and the request is executed using the updated bypass rule to return to the step of obtaining the second parameter.

2. The method for updating rules according to claim 1, It is characterized in that After the step of determining whether the second parameter matches the first parameter, the method further includes: When the second parameter does not match the first parameter, the rule file of the bypass rule is modified according to the second parameter to update the bypass rule, and the request is executed using the updated bypass rule to return to the step of obtaining the second parameter.

3. The method for updating rules according to claim 1, It is characterized in that After the step of obtaining the execution strategy corresponding to the bypass rule, the method further includes: Determining whether the bypass rule meets an enabling condition according to the execution strategy; When it is determined that the bypass rule satisfies the enabling condition, the step of determining the target request among the requests according to the execution strategy is performed.

4. The method for updating rules according to claim 3, It is characterized in that The enabling condition includes at least one of the following: The application scenario corresponding to the request matches the application scenario of the bypass rule; The current time point is in the execution time period of the bypass rule; The status of the bypass rule is enabled.

5. The method for updating rules according to claim 1, It is characterized in that The execution strategy includes the request ratio, and the step of obtaining the execution strategy corresponding to the bypass rule includes: Obtaining load parameters of the terminal; The request ratio is determined according to the load parameter, wherein the load parameter and the request ratio are negatively correlated.

6. The method for updating rules according to claim 1, It is characterized in that The strategy includes the request ratio, and the step of obtaining the execution strategy corresponding to the bypass rule includes: Get the log of the terminal executing the rule within the target time period; Determine a third parameter output by the terminal executing the rule according to the log, and obtain a total number of times the terminal executes the rule according to the log; Classifying each of the third parameters to obtain the number of each type of third parameters; A minimum number is determined among the numbers, and the request ratio is determined according to a ratio of the minimum number to the total number of times.

7. A method for updating a rule according to any one of claims 1 to 6, It is characterized in that After the step of using the bypass rule to execute the target request to obtain the second parameter, the method further includes: determining a difference between the first parameter and the second parameter; When the difference is less than a preset difference, the step of determining whether the second parameter matches the first parameter is performed.

8. A terminal, It is characterized in that The terminal comprises: An acquisition module is used to acquire the bypass rule corresponding to the latest version of the rule when a version update of the rule is detected, and acquire a request, wherein the request includes a variable value corresponding to the rule variable generated in real time by the terminal; and, using the current main rule to execute the request to obtain a first parameter, wherein the version of the main rule is lower than the version of the bypass rule; and, acquiring an execution strategy corresponding to the bypass rule, wherein the execution strategy includes an application scenario of the bypass rule, an execution time period of the bypass rule, a status of the bypass rule and / or a request ratio; the request ratio is the ratio between the number of execution requests of the main rule and the number of execution requests of the bypass rule; and, determining a target request in each of the requests according to the execution strategy; and, using the bypass rule to execute the target request to obtain a second parameter; a determination module, configured to determine whether the second parameter satisfies a preset condition; if the preset condition is satisfied, determining whether the second parameter matches the first parameter; An updating module, configured to replace the main path rule with the bypass rule when the second parameter matches the first parameter, so as to update the main path rule; The real-time determination module is also used to modify the rule file of the bypass rule according to the second parameter to update the bypass rule if the preset condition is not met, and use the updated bypass rule to execute the request to return to the step of obtaining the second parameter.

9. A device, It is characterized in that The device comprises a memory, a processor, and an update program stored in the memory and executable on the processor, wherein the update program implements the rule update method according to any one of claims 1 to 7 when executed by the processor.