Exception handling method, device, equipment and storage medium

By continuing to execute the rule description logic based on the current level rule relationship and the existence of the next rule item when an anomaly is detected in the rule description logic, the problem of frequent interruptions of the rule engine is solved and the execution efficiency of the rule engine is improved.

CN115048159BActive Publication Date: 2025-09-16JINGDONG TECH HLDG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210684211.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-16
Publication Date
2025-09-16
Estimated Expiration
2042-06-16

AI Technical Summary

Technical Problem

In the prior art, when an execution exception occurs in a rule item in the rule description logic, the execution efficiency of the rule engine is low, and the execution of the entire rule description logic is frequently interrupted.

Method used

When an abnormal execution of the current rule item is detected, the corresponding current-level rule relationship is obtained. If the relationship is a logical OR relationship and there is a next rule item, the rule description logic is continued to be executed until the execution results of all rule items are success or failure.

Benefits of technology

In this way, frequent interruptions of the rule engine are avoided, the execution efficiency of the rule engine is improved, and the continuity and accuracy of the rule description logic are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115048159B_ABST
    Figure CN115048159B_ABST
Patent Text Reader

Abstract

The present invention discloses an exception handling method, apparatus, device and storage medium, the method comprising: in response to detecting a current rule item with an execution exception during the execution of a rule description logic, obtaining a current-level rule relationship corresponding to the current rule item; if the current-level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item, then continuing to execute the rule description logic based on the next rule item. The embodiment of the present invention solves the problem of frequent interruptions of the rule engine and improves the execution efficiency of the rule engine by obtaining a current-level rule relationship corresponding to the current rule item in response to the current rule item with an execution exception, and if the current-level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item, then continuing to execute the rule description logic based on the next rule item.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an exception handling method, apparatus, device and storage medium. Background Art

[0002] A rule engine is a component embedded in an application that separates business decisions from the application's programming code and uses predefined semantic modules to encode business decisions. A rule engine can reduce the complexity of components with complex business logic, as well as application maintenance and scalability costs.

[0003] The declarative language used by the semantic module in a rule engine is called a rule description language. The rule description language is an important component of the rule engine. The rule description language usually describes a set of conditions and the actions to be performed under these conditions.

[0004] In the process of implementing the present invention, it was found that the prior art has at least the following technical problems:

[0005] During the execution of rule description logic written in a rule description language, if an execution exception occurs in a rule item within the rule description logic, the entire rule description logic is usually stopped, and the developer performs exception handling for the rule item with the execution exception. However, frequent execution interruptions lead to low execution efficiency of the rule engine. Summary of the Invention

[0006] The present invention provides an exception handling method, apparatus, device and storage medium to solve the problem of frequent interruptions of a rule engine and improve the execution efficiency of the rule engine.

[0007] According to one aspect of the present invention, there is provided an exception handling method, the method comprising:

[0008] In response to detecting a current rule item with an execution exception during the execution of the rule description logic, obtaining a current-level rule relationship corresponding to the current rule item; wherein the current rule item includes preset rule parameters and an operation rule corresponding to the preset rule parameters;

[0009] If the current-level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item, then the rule description logic is continued to be executed based on the next rule item.

[0010] According to another aspect of the present invention, there is provided an exception handling device, the device comprising:

[0011] A current rule relationship acquisition module, configured to, in response to detecting a current rule item with an execution anomaly during the execution of the rule description logic, acquire a current-level rule relationship corresponding to the current rule item; wherein the current rule item includes preset rule parameters and operation rules corresponding to the preset rule parameters;

[0012] The first rule description logic continuing execution module is configured to continue executing the rule description logic based on the next rule item if the current level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item.

[0013] According to another aspect of the present invention, an electronic device is provided, comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the exception handling method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the exception handling method according to any embodiment of the present invention when executed.

[0018] The technical solution of an embodiment of the present invention obtains the current-level rule relationship corresponding to the current rule item in response to the execution exception of the current rule item. If the current-level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item, the rule description logic continues to be executed based on the next rule item. The present invention provides an option that can execute the rule description logic without stopping, solves the problem of frequent interruptions of the rule engine, and thus improves the execution efficiency of the rule engine.

[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 This is a flowchart of an exception handling method provided by an embodiment of the present invention;

[0022] Figure 2A is a schematic diagram of an interactive interface of a rule designer provided by an embodiment of the present invention;

[0023] Figure 2B This is a flowchart of a specific example of an exception handling method provided by an embodiment of the present invention;

[0024] Figure 2C This is a schematic diagram of a feedback result of a rule description logic provided by an embodiment of the present invention;

[0025] Figure 3 is a flowchart of another exception handling method provided by an embodiment of the present invention;

[0026] Figure 4A This is an architectural diagram of a rule group provided by an embodiment of the present invention;

[0027] Figure 4B is a schematic diagram of another feedback result of rule description logic provided by an embodiment of the present invention;

[0028] Figure 4C is a flowchart of a specific example of another exception handling method provided by an embodiment of the present invention;

[0029] Figure 5 This is a schematic structural diagram of an exception handling device provided by an embodiment of the present invention;

[0030] Figure 6 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products or apparatuses.

[0033] Figure 1 This is a flowchart of an exception handling method provided by an embodiment of the present invention. This embodiment is applicable to the case where an application calls a rule engine to execute rule description logic. The method can be executed by an exception handling device, which can be implemented in the form of hardware and / or software and can be configured in a terminal device. Figure 1 As shown, the method includes:

[0034] S110 : In response to detecting a current rule item with an execution exception during the execution of the rule description logic, obtaining a current-level rule relationship corresponding to the current rule item.

[0035] In one embodiment, optionally, the method further includes: in response to rule condition information input by a user based on an interactive interface provided by a rule designer, generating a rule description file based on the rule condition information through the rule designer; wherein the rule condition information includes preset rule parameters, operation rules corresponding to the preset rule parameters, and a rule relationship between at least two preset rule parameters.

[0036] Specifically, the rule description logic is a coding logic that describes the above-mentioned rule condition information. The rule description logic is recorded in the rule description file generated by the rule designer. The rule description logic includes at least two rule items and the rule relationships between the rule items. In this embodiment, the current rule item includes preset rule parameters and the operation rules corresponding to the preset rule parameters.

[0037] Among them, exemplarily, the data structure type of the rule description logic is a json data structure, the rule designer can be a canvas designer, the operation rules include but are not limited to at least one of conditional judgment, addition, subtraction, multiplication and division, and the rule relationship includes but is not limited to a logical AND relationship, a logical OR relationship, a logical NOT relationship or a logical XOR relationship.

[0038] Figure 2A Schematic diagram of an interactive interface of a rule designer provided by an embodiment of the present invention. Specifically, Figure 2AThe preset rule parameters shown include the user's coupon holdings, gender, membership level, and age. The operation rules corresponding to each preset rule parameter are all conditional judgments. Each preset rule parameter corresponds to a rule item, and the rule relationship between each rule item is a logical OR relationship.

[0039] by Figure 2A For example, assuming that the rule item "gender = male" is executed abnormally, the current level rule relationship to which the rule item "gender = male" belongs, that is, the logical OR relationship, is obtained.

[0040] Specifically, the execution process of the rule description logic can be used to represent the process of the rule engine converting the rule description file into a knowledge package and executing the knowledge package.

[0041] S120: If the current-level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item, then continue to execute the rule description logic based on the next rule item.

[0042] In this embodiment, the execution order of each rule item is serial, not parallel. For example, assuming the current-level rule relationship between rule item 1 and rule item 2 is a logical OR relationship, rule item 1 is executed first. If the execution result of rule item 1 is successful, rule item 2 is not executed, and the execution result corresponding to the current-level rule relationship is fed back as a success. If the execution result of rule item 1 is a failure, rule item 2 is executed again, and the execution result of rule item 2 is used as the execution result corresponding to the current-level rule relationship. Assuming the rule relationship between rule item 1 and rule item 2 is a logical AND relationship, rule item 1 is executed first. Regardless of whether the execution result of rule item 1 is successful or failed, rule item 2 is executed again. Based on the execution results of rule item 1 and rule item 2, the execution result corresponding to the current-level rule relationship is fed back as a success. Specifically, if the execution results of rule item 1 and rule item 2 are both successful, the execution result corresponding to the current-level rule relationship is fed back as a success. In the other three cases, the execution results corresponding to the current-level rule relationship are all fed back as failures.

[0043] Specifically, first determine whether the current level rule relationship is a logical OR relationship. If so, continue to determine whether there is a next rule item corresponding to the current rule item. If so, continue to execute the rule description logic based on the next rule item.

[0044] Based on the above embodiment, optionally, the method further includes: if the current level rule relationship is not a logical OR relationship, or if there is no next rule item corresponding to the current rule item, then the rule description logic is stopped and a logic execution exception prompt operation is performed.

[0045] For example, the abnormal prompt operation may be a text prompt, a voice prompt, or an indicator light prompt, etc.

[0046] The advantage of this setting is that when the current-level rule relationship is a logical or relationship, if one of the rule items is executed abnormally, but there is a rule item with a successful execution result, the execution result corresponding to the current-level rule relationship can still be fed back as a successful execution without interrupting the execution process of the rule description logic, thereby improving the execution efficiency of the rule engine while ensuring the accuracy of the execution result.

[0047] In one embodiment, optionally, based on the next rule item, the rule description logic is continued to be executed, including: if the execution result of the next rule item is successful, then the execution result corresponding to the current level rule relationship is fed back as successful; if the execution result of the next rule item is failed, then the next rule item is used as the current rule item, and the step of determining whether there is a next rule item corresponding to the current rule item is returned.

[0048] Specifically, if the execution result of the next rule item is successful, then regardless of whether the current-level rule relationship corresponds to other unexecuted rule items, the execution result corresponding to the current-level rule relationship fed back is successful. If the execution result of the next rule item is failed, it means that it is still necessary to continue executing other unexecuted rule items corresponding to the current-level rule relationship. If there are rule items with successful execution results among the other unexecuted rule items, the execution results corresponding to the current-level rule relationship fed back are all successful. If there are no rule items with successful execution results among the other unexecuted rule items, the execution of the rule description logic is stopped, and the logic execution exception prompt operation is performed.

[0049] Figure 2BThe flowchart of a specific example of an exception handling method provided by an embodiment of the present invention is as follows. Specifically, in one embodiment, when a current rule item with an execution exception is detected, if the current rule relationship corresponding to the current rule item is a logical OR relationship, and a next rule item exists, and the execution result of the next rule item is successful, then the execution result corresponding to the current-level rule relationship is fed back as successful. In another embodiment, when a current rule item with an execution exception is detected, if the current rule relationship corresponding to the current rule item is not a logical OR relationship, or if the next rule item does not exist, then the rule description logic is stopped and a logical execution exception prompt is performed. In another embodiment, when a current rule item with an execution exception is detected, if the current rule relationship corresponding to the current rule item is a logical OR relationship, and a next rule item exists, but the execution result of the next rule item is failure, then the next rule item is used as the current rule item, and the step of determining whether a next rule item corresponding to the current rule item exists is returned. If so, and the execution result of the next rule item is successful, then the execution result corresponding to the current-level rule relationship is fed back as successful. If not, then the rule description logic is stopped and a logical execution exception prompt is performed.

[0050] In another embodiment, optionally, based on the next rule item, continuing to execute the rule description logic also includes: if the execution status of the next rule item is execution exception, taking the next rule item as the current rule item, and returning to the step of determining whether there is a next rule item corresponding to the current rule item.

[0051] Figure 2C Schematic diagram of a feedback result of a rule description logic provided by an embodiment of the present invention. Specifically, Figure 2C The two cross-striped boxes in the figure represent rule item 1 and rule item 2, whose execution status is abnormal, respectively. The vertical striped box represents rule item 3, whose execution result is failed, and the blank box represents rule item 4, whose execution result is successful. Based on the technical solution provided by this embodiment, Figure 2C The execution result of the "logical or relationship" feedback is successful. Figure 2C If the execution result of rule item 4 in is execution failure, the rule description logic is stopped and the logic execution exception prompt operation is performed.

[0052] The technical solution of this embodiment obtains the current-level rule relationship corresponding to the current rule item in response to the execution exception of the current rule item. If the current-level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item, the rule description logic continues to be executed based on the next rule item. The present invention provides an option that can continue to execute the rule description logic, solves the problem of frequent interruptions of the rule engine, and thus improves the execution efficiency of the rule engine.

[0053] Figure 3 This is a flowchart of another exception handling method provided by an embodiment of the present invention. This embodiment provides another implementation method for the subsequent processing method of "if the current level rule relationship is not a logical OR relationship, or if there is no next rule item corresponding to the current rule item". Figure 3 As shown, the method includes:

[0054] S210 : In response to detecting a current rule item with an execution exception during the execution of the rule description logic, obtain a current-level rule relationship corresponding to the current rule item.

[0055] In one embodiment, optionally, the method further includes: obtaining remote call information during the execution of the current rule item in the rule description logic; if the reception time of the call data in the remote call information exceeds a preset time threshold, and / or if the remote call information contains call service exception information fed back by the called party, the execution status corresponding to the current rule item is set to execution exception.

[0056] Specifically, the remote call information is used to record the call information corresponding to the preset rule parameters in the current rule item. For example, the preset rule parameter is "gender", and the parameter value corresponding to the preset rule parameter (such as male, female, or unknown) needs to be obtained from a third-party service (i.e., the callee). For example, the third-party service can be a data storage system or server.

[0057] In one embodiment, specifically, the rule engine sends a data call request to a third-party service based on the preset rule parameters in the current rule item, and at the same time, performs a timing operation on the reception time of the call data. If the rule engine does not receive the call data and the reception time obtained by timing exceeds the preset time threshold, the execution state corresponding to the current rule item is set to execution exception. Wherein, illustratively, the preset time threshold can be 3 seconds. In another embodiment, optionally, the rule engine sends a data call request to a third-party service based on the preset rule parameters in the current rule item, and if the call service exception information based on the data call request is received from the third-party service, the execution state corresponding to the current rule item is set to execution exception.

[0058] Based on the above embodiment, optionally, after obtaining the current-level rule relationship corresponding to the current rule item, the method also includes: adding the rule information corresponding to the current rule item to the exception log; wherein the rule information includes at least one of the start execution time, remote call information and the current-level rule relationship; after the rule description logic stops executing, the exception log is output.

[0059] The advantage of this setting is that it makes it easier for users to check rule items with execution exceptions and perform exception repair operations in a timely manner.

[0060] S220 , determining whether the current level rule relationship is a logical OR relationship and whether there is a next rule item corresponding to the current rule item; if so, executing S250 ; if not, executing S230 .

[0061] S230: Obtain the upper-level rule relationship corresponding to the current rule group to which the current rule item belongs.

[0062] In this embodiment, the current rule group includes at least one rule item and the rule relationships between the rule items. The current rule group is the upper-level rule item that includes the current rule item and other rule items. Accordingly, the rule relationships corresponding to the current rule group are the upper-level rule relationships relative to the current-level rule relationships.

[0063] Figure 4A This is an architectural diagram of a rule group provided by an embodiment of the present invention. Specifically, Figure 4A Three rule groups are shown, namely rule group 1, rule group 2 and rule group 3. Among them, rule group 1 contains rule item 1.1, rule item 1.2 and the logical OR relationship between rule item 1.1 and rule item 1.2, rule group 2 contains rule item 2.1, rule item 2.2 and the logical AND relationship between rule item 2.1 and rule item 2.2, rule group 3 contains rule item 3.1, rule item 3.2 and the logical OR relationship between rule item 3.1 and rule item 3.2, and the rule relationship corresponding to rule group 1, rule group 2 and rule group 3 is rule OR relationship. Specifically, the current level rule relationship corresponding to the current rule item is Figure 4A The three rule relationships on the right (or, and, or) correspond to the previous level rule relationship of the current rule group: Figure 4A The rule relation on the left side is (or).

[0064] Specifically, if the current-level rule relationship is not a logical OR relationship, or if there is no next rule item corresponding to the current rule item, it indicates that the current rule group to which the current rule item belongs is an abnormally executed rule group.

[0065] S240 , determining whether the previous level rule relationship is a logical OR relationship and whether there is a next rule group corresponding to the current rule group; if so, executing S260 ; if not, executing S270 .

[0066] Specifically, it is first determined whether the upper-level rule relationship is a logical OR relationship. If so, it is determined whether there is a next rule group corresponding to the current rule group.

[0067] S250: Continue executing the rule description logic based on the next rule item.

[0068] S260: Continue executing the rule description logic based on the next rule group.

[0069] In one embodiment, optionally, based on the next rule group, the rule description logic is continued to be executed, including: if the execution result of the next rule group is successful execution, then the execution result corresponding to the relationship with the previous level rule is fed back as successful execution; if the execution result of the next rule group is failed execution, or the execution status of the next rule group is abnormal execution, then the next rule group is used as the current rule group, and the step of determining whether there is a next rule group corresponding to the current rule group is returned.

[0070] S270: Stop executing the rule description logic and execute the logic execution exception prompt operation.

[0071] Figure 4B This is a schematic diagram of another feedback result of rule description logic provided by an embodiment of the present invention. Specifically, Figure 4B The cross-striped box indicates a rule item or rule group with an abnormal execution status, the diagonal striped box indicates an unexecuted rule item or rule group, the vertical striped box indicates a rule item or rule group with a failed execution result, and the blank box indicates a rule item or rule group with a successful execution result. Based on the technical solution provided by this embodiment, Figure 4B The execution status of the first "Logical OR Relationship" feedback on the right is execution exception, the execution status of the "Logical AND Relationship" feedback on the right is execution exception, the execution result of the second "Logical OR Relationship" feedback on the right is execution success, and accordingly, the execution result of the "Logical OR Relationship" feedback on the left is execution success.

[0072] Figure 4CThis is a flowchart of a specific example of another exception handling method provided by an embodiment of the present invention. Specifically, if the current rule relationship is not a logical OR relationship, or if the next rule item does not exist, the previous rule relationship corresponding to the current rule group to which the current rule item belongs is obtained. In one embodiment, if the previous rule relationship is a logical OR relationship, and the next rule group exists, and the execution result of the next rule group is successful, the execution result corresponding to the previous rule relationship is fed back as successful. In another embodiment, if the previous rule relationship is not a logical OR relationship, or if the next rule group does not exist, the rule description logic is stopped and a logic execution exception prompt is performed. In another embodiment, if the previous rule relationship is a logical OR relationship, and the next rule group exists, but the execution result of the next rule group is failure, the next rule group is used as the previous rule group, and the step of determining whether there is a next rule group corresponding to the previous rule group is returned. If so, and the execution result of the next rule group is successful, the execution result corresponding to the previous rule relationship is fed back as successful. If not, the rule description logic is stopped and a logic execution exception prompt is performed.

[0073] It should be noted that the embodiments of the present invention are explained using only two levels of rule hierarchy in the rule description logic. Of course, if the rule hierarchy in the rule description logic is greater than or equal to two levels, a similar technical solution can be adopted until a root node rule relationship corresponding to the current rule item is found, wherein a root node rule relationship is a rule relationship for which no corresponding upper-level rule relationship exists. All of the above solutions are within the scope of protection of this application.

[0074] The technical solution of this embodiment is to continue to obtain the previous-level rule relationship corresponding to the current rule group to which the current rule item belongs when the current-level rule relationship is not a logical OR relationship, or there is no next rule item corresponding to the current rule item, and determine whether the previous-level rule relationship is a logical OR relationship and whether there is a next rule group corresponding to the current rule group. If so, the rule description logic is continued to be executed based on the next rule group. This embodiment further provides an option of not stopping the execution of the rule description logic, which solves the problem of the rule engine being frequently interrupted, further reduces the frequency of the rule engine being interrupted, and thus further improves the execution efficiency of the rule engine.

[0075] Based on the above embodiment, optionally, the method further includes: in response to receiving a call instruction sent by an application, obtaining a rule description logic corresponding to the call instruction; wherein the call instruction is sent by the application in response to a received application request; executing the rule description logic, and after the rule description logic stops executing, sending the obtained execution result to the application, so that the application performs a filtering operation on the application request based on the execution result.

[0076] Specifically, the application receives at least one application request. Exemplarily, the application request may be an order request or a network access request, etc. The application executes the rule description logic by calling the rule engine and performs a filtering operation on the application request based on the execution result received from the rule engine. The filtering operation includes receiving application operations and rejecting application operations. Exemplarily, if the execution result returned by the rule engine corresponding to application request A is successful, the application performs a receiving application operation on application request A. If the execution result returned by the rule engine corresponding to application request A is failed, the application performs a rejecting application operation on application request A.

[0077] Figure 5 This is a schematic diagram of the structure of an exception handling device provided by an embodiment of the present invention. Figure 5 As shown, the device includes: a current rule relationship acquisition module 310 and a first rule description logic continued execution module 320.

[0078] The current rule relationship acquisition module 310 is configured to acquire a current-level rule relationship corresponding to a current rule item in response to detecting an execution anomaly of the current rule item during the execution of the rule description logic; wherein the current rule item includes preset rule parameters and operation rules corresponding to the preset rule parameters;

[0079] The first rule description logic continuing execution module 320 is configured to continue executing the rule description logic based on the next rule item if the current level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item.

[0080] The technical solution of this embodiment obtains the current-level rule relationship corresponding to the current rule item in response to the execution exception of the current rule item. If the current-level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item, the rule description logic continues to be executed based on the next rule item. The present invention provides an option that can continue to execute the rule description logic, solves the problem of frequent interruptions of the rule engine, and thus improves the execution efficiency of the rule engine.

[0081] Based on the above embodiment, optionally, the first rule description logic continuing execution module 320 is specifically configured to:

[0082] If the execution result of the next rule item is successful, the execution result corresponding to the relationship between the feedback and the current level rule is successful;

[0083] If the execution result of the next rule item is execution failure, the next rule item is used as the current rule item, and the process returns to the step of determining whether there is a next rule item corresponding to the current rule item.

[0084] Based on the above embodiment, optionally, the device further includes:

[0085] The first rule description logic execution stop module is used to stop executing the rule description logic and perform a logic execution exception prompt operation if the current level rule relationship is not a logical OR relationship, or if there is no next rule item corresponding to the current rule item.

[0086] Based on the above embodiment, optionally, the device further includes:

[0087] a previous-level rule relationship acquisition module, configured to acquire the previous-level rule relationship corresponding to the current rule group to which the current rule item belongs, if the current-level rule relationship is not a logical OR relationship, or if there is no next rule item corresponding to the current rule item; wherein the current rule group includes at least one rule item and the rule relationships between the rule items;

[0088] The second rule description logic continuing execution module is configured to continue executing the rule description logic based on the next rule group if the previous level rule relationship is a logical OR relationship and there is a next rule group corresponding to the current rule group.

[0089] Based on the above embodiment, optionally, the device further includes:

[0090] The second rule description logic execution stop module is used to stop executing the rule description logic and perform a logic execution exception prompt operation if the previous level rule relationship is not a logical OR relationship, or if there is no next rule group corresponding to the current rule group.

[0091] Based on the above embodiment, optionally, the device further includes:

[0092] The execution status setting module is used to obtain remote call information during the execution of the current rule item in the rule description logic;

[0093] If the reception time of the call data in the remote call information exceeds the preset time threshold, and / or if the remote call information contains call service exception information fed back by the callee, the execution status corresponding to the current rule item is set to execution exception.

[0094] Based on the above embodiment, optionally, the device further includes:

[0095] A rule information adding module, configured to add rule information corresponding to the current rule item to the exception log after obtaining the current-level rule relationship corresponding to the current rule item; wherein the rule information includes at least one of a start execution time, remote call information, and the current-level rule relationship;

[0096] The exception log output module is used to output the exception log after the rule description logic stops executing.

[0097] Based on the above embodiment, optionally, the device further includes:

[0098] A rule description logic acquisition module, configured to, in response to receiving a call instruction sent by an application, acquire the rule description logic corresponding to the call instruction; wherein the call instruction is sent by the application in response to a received application request;

[0099] The calling module is used to call the current rule relationship acquisition module;

[0100] The execution result sending module is used to send the obtained execution result to the application after the rule description logic stops executing, so that the application performs a filtering operation on the application request based on the execution result.

[0101] The exception handling device provided in the embodiment of the present invention can execute the exception handling method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0102] Figure 6 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0103] like Figure 6 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0104] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0105] The processor 11 may be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the exception handling method.

[0106] In some embodiments, the exception handling method may be implemented as a computer program that is tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the exception handling method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the exception handling method in any other appropriate manner (e.g., by means of firmware).

[0107] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0108] Computer programs for implementing the exception handling methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when executed by the processor, the computer programs implement the functions / operations specified in the flowcharts and / or block diagrams. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0109] An embodiment of the present invention further provides a computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a processor to execute an exception handling method, the method comprising:

[0110] In response to detecting a current rule item with an execution exception during the execution of the rule description logic, obtaining a current-level rule relationship corresponding to the current rule item; wherein the current rule item includes preset rule parameters and an operation rule corresponding to the preset rule parameters;

[0111] If the current level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item, the rule description logic is continued to be executed based on the next rule item.

[0112] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0113] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0114] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0115] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0116] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0117] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. An exception handling method, characterized in that: include: In response to detecting a current rule item with an execution exception during the execution of the rule description logic, obtaining a current-level rule relationship corresponding to the current rule item; wherein the current rule item includes preset rule parameters and an operation rule corresponding to the preset rule parameters; If the current-level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item, then continue to execute the rule description logic based on the next rule item; The execution order of the multiple rule items corresponding to the current level rule relationship is serial execution.

2. The method according to claim 1, characterized in that The continuing to execute the rule description logic based on the next rule item includes: If the execution result of the next rule item is successful, the execution result corresponding to the relationship of the current level rule is fed back as successful; If the execution result of the next rule item is execution failure, the next rule item is used as the current rule item, and the process returns to the step of determining whether there is a next rule item corresponding to the current rule item.

3. The method according to claim 1, characterized in that The method further comprises: If the current-level rule relationship is not a logical OR relationship, or if there is no next rule item corresponding to the current rule item, then the rule description logic is stopped from being executed, and a logic execution exception prompt operation is performed.

4. The method according to claim 1, wherein The method further comprises: If the current-level rule relationship is not a logical OR relationship, or if there is no next rule item corresponding to the current rule item, obtaining the previous-level rule relationship corresponding to the current rule group to which the current rule item belongs; wherein the current rule group includes at least one rule item and rule relationships between the rule items; If the upper-level rule relationship is a logical OR relationship and there is a next rule group corresponding to the current rule group, then the rule description logic is continued to be executed based on the next rule group.

5. The method according to claim 4, characterized in that The method further comprises: If the upper-level rule relationship is not a logical OR relationship, or if there is no next rule group corresponding to the current rule group, the rule description logic is stopped from being executed, and a logic execution exception prompt operation is performed.

6. The method according to claim 1, wherein The method further comprises: During the execution of the current rule item in the rule description logic, remote call information is obtained; If the reception time of the call data in the remote call information exceeds a preset time threshold, and / or if the remote call information contains call service exception information fed back by the callee, the execution state corresponding to the current rule item is set to execution exception.

7. The method according to claim 6, characterized in that After obtaining the current-level rule relationship corresponding to the current rule item, the method further includes: Adding rule information corresponding to the current rule item to the exception log; wherein the rule information includes at least one of the start execution time, remote call information, and current level rule relationship; After the rule description logic stops executing, the exception log is output.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: In response to receiving a call instruction sent by an application, obtaining a rule description logic corresponding to the call instruction; wherein the call instruction is sent by the application in response to a received application request; The rule description logic is executed, and after the rule description logic stops executing, the obtained execution result is sent to the application program, so that the application program performs a filtering operation on the application request based on the execution result.

9. An exception handling device, characterized in that: include: A current rule relationship acquisition module, configured to, in response to detecting a current rule item with an execution anomaly during the execution of the rule description logic, acquire a current-level rule relationship corresponding to the current rule item; wherein the current rule item includes preset rule parameters and operation rules corresponding to the preset rule parameters; a first rule description logic continuing execution module, configured to continue executing the rule description logic based on the next rule item if the current-level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item; The execution order of the multiple rule items corresponding to the current level rule relationship is serial execution.

10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the exception handling method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the exception handling method according to any one of claims 1 to 8 when executed.

Citation Information

Patent Citations

  • VLSI hardware implemented rule-based expert system apparatus and method

    US5218669A

  • Rule based product classification

    US9201967B1