CN115048159A - Exception handling method, device, equipment and storage medium - Google Patents

Exception handling method, device, equipment and storage medium Download PDF

Info

Publication number
CN115048159A
CN115048159A CN202210684211.6A CN202210684211A CN115048159A CN 115048159 A CN115048159 A CN 115048159A CN 202210684211 A CN202210684211 A CN 202210684211A CN 115048159 A CN115048159 A CN 115048159A
Authority
CN
China
Prior art keywords
rule
current
item
execution
logic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210684211.6A
Other languages
Chinese (zh)
Inventor
王培轩
贺杰
江国华
杨国志
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Holding Co Ltd
Original Assignee
Jingdong Technology Holding Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingdong Technology Holding Co Ltd filed Critical Jingdong Technology Holding Co Ltd
Priority to CN202210684211.6A priority Critical patent/CN115048159A/en
Publication of CN115048159A publication Critical patent/CN115048159A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/4492Inheritance

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses an exception handling method, an exception handling device, exception handling equipment and a storage medium, wherein the method comprises the following steps: responding to a current rule item of which execution exception is detected in the execution process of rule description logic, and acquiring a current level rule relation 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, continuing execution of the rule description logic based on the next rule item. According to the embodiment of the invention, the current level rule relation corresponding to the current rule item is obtained by responding to the current rule item which is abnormally executed, if the current level rule relation is logic or relation and the next rule item corresponding to the current rule item exists, the rule description logic is continuously executed based on the next rule item, so that the problem that the rule engine is frequently interrupted is solved, and the execution efficiency of the rule engine is improved.

Description

Exception handling method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for exception handling.
Background
A rules engine is a component embedded in an application that separates business decisions from the application's programming code and writes the business decisions using predefined semantic modules. The rules engine may enable reducing the complexity of components of complex business logic, maintenance and extensibility costs of applications.
The expressive language used by the semantic modules in the rules engine is called the rules description language, which is an important component of the rules engine. A rule description language generally describes a set of conditions and operations performed under such conditions.
In the process of implementing the invention, at least the following technical problems are found in the prior art:
in the process of executing the rule description logic written based on the rule description language, when an execution exception occurs to a certain rule item in the rule description logic, the execution of the whole rule description logic is usually stopped, and a developer performs exception handling on the rule item with the execution exception. But frequent execution interruptions can result in inefficient execution of the rules engine.
Disclosure of Invention
The invention provides an exception handling method, an exception handling device, exception handling equipment and a storage medium, which are used for solving the problem that a rule engine is frequently interrupted and improving the execution efficiency of the rule engine.
According to an aspect of the present invention, there is provided an exception handling method, including:
responding to a current rule item of which execution exception is detected in the execution process of rule description logic, and acquiring a current level rule relation corresponding to the current rule item; the current rule item comprises a preset rule parameter and an operation rule corresponding to the preset rule parameter;
if the current level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item, continuing execution of the rule description logic based on the next rule item.
According to another aspect of the present invention, there is provided an exception handling apparatus comprising:
the current rule relation acquisition module is used for responding to a current rule item which detects execution abnormity in the execution process of the rule description logic and acquiring a current level rule relation corresponding to the current rule item; the current rule item comprises a preset rule parameter and an operation rule corresponding to the preset rule parameter;
a first rule description logic continuing execution module, configured to continue executing the rule description logic based on a next rule item if the current level rule relationship is a logical or relationship and the next rule item corresponding to the current rule item exists.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the exception handling method according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the exception handling method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, the current level rule relation corresponding to the current rule item is obtained by responding to the current rule item which is abnormally executed, and if the current level rule relation is logic or relation and the next rule item corresponding to the current rule item exists, the rule description logic is continuously executed based on the next rule item.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart of a method for exception handling according to an embodiment of the present invention;
FIG. 2A is a schematic diagram of an interaction interface of a rule designer provided by an embodiment of the invention;
FIG. 2B is a flowchart of an embodiment of a method for exception handling according to the present invention;
FIG. 2C is a diagram illustrating a feedback result of a rule description logic according to an embodiment of the present invention;
FIG. 3 is a flow chart of another exception handling method provided by an embodiment of the present invention;
FIG. 4A is an architecture diagram of a rule set provided by an embodiment of the present invention;
FIG. 4B is a diagram illustrating the feedback result of another rule description logic provided by an embodiment of the present invention;
FIG. 4C is a flowchart of another embodiment of an exception handling method according to the present invention;
FIG. 5 is a schematic structural diagram of an exception handling apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of the present invention and the above-described drawings, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a flowchart of an exception handling method according to an embodiment of the present invention, where the embodiment is applicable to a case where an application calls a rule engine to execute a rule description logic, the method may be executed by an exception handling apparatus, the exception handling apparatus may be implemented in a form of hardware and/or software, and the exception handling apparatus may be configured in a terminal device. As shown in fig. 1, the method includes:
s110, responding to the current rule item with execution exception detected in the execution process of the rule description logic, and obtaining the current level rule relation corresponding to the current rule item.
In one embodiment, optionally, the method further comprises: generating a rule description file based on rule condition information through a rule designer in response to the rule condition information input by a user based on an interactive interface provided by the rule designer; the rule condition information comprises preset rule parameters, operation rules corresponding to the preset rule parameters and rule relations between at least two preset rule parameters.
Specifically, the rule description logic is a coding logic for describing the rule condition information. And recording rule description logic in the rule description file generated by the rule designer, wherein the rule description logic comprises at least two rule items and rule relations among the rule items. In this embodiment, the current rule item includes a preset rule parameter and an operation rule corresponding to the preset rule parameter.
The data structure type of the rule description logic is exemplarily a json data structure, the rule designer may be a canvas designer, the operation rule includes but is not limited to at least one of condition 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 non-relationship or a logical exclusive or relationship.
FIG. 2A is a schematic diagram of an interaction interface of a rule designer according to an embodiment of the present invention. Specifically, the preset rule parameters shown in fig. 2A include a coupon held by the user, a gender, a member level, and an age, and the operation rules corresponding to the preset rule parameters are all conditional judgments. Each preset rule parameter is divided into corresponding rule items, and the rule relation among the rule items is logic or relation.
For example, in fig. 2A, assuming that the rule item of "gender-male" performs an exception, the current-level rule relationship, i.e., logical or relationship, to which the rule item of "gender-male" belongs is obtained.
Specifically, the execution process of the rule description logic may be used to characterize a process in which the rule engine converts the rule description file into a knowledge packet and executes the knowledge packet.
And S120, if the current-level rule relation is a logic or relation and a next rule item corresponding to the current rule item exists, continuing to execute the rule description logic based on the next rule item.
In the present embodiment, the execution order of the rule items is serial execution, not parallel execution. For example, assuming that the current-level rule relationship between the rule item 1 and the rule item 2 is a logical or relationship, the rule item 1 is executed first, if the execution result of the rule item 1 is that the execution is successful, the rule item 2 is not executed any more, the execution result corresponding to the current-level rule relationship is fed back as the execution success, if the execution result of the rule item 1 is that the execution is failed, the rule item 2 is executed again, and the execution result of the rule item 2 is taken as the execution result corresponding to the fed-back current-level rule relationship. Assuming that the rule relationship between the rule item 1 and the rule item 2 is a logical and relationship, the rule item 1 is executed first, and the rule item 2 is continuously executed no matter whether the execution result of the rule item 1 is successful or failed, and the execution result corresponding to the current-level rule relationship is fed back based on the execution result of the rule item 1 and the execution result corresponding to the rule item 2. Specifically, when the execution results of rule item 1 and rule item 2 are both successful in execution, the execution result corresponding to the fed back current-level rule relationship is successful in execution, and the execution results corresponding to the current-level rule relationship fed back in the rest 3 cases are all failed in execution.
Specifically, whether the current-level rule relationship is a logic or relationship is judged first, if so, whether a next rule item corresponding to the current rule item exists is judged continuously, and if so, the rule description logic is executed continuously based on the next rule item.
On the basis of the foregoing embodiment, optionally, the method further includes: if the current level rule relation is not a logic or relation, or if a next rule item corresponding to the current rule item does not exist, stopping executing the rule description logic, and executing the logic to execute the exception prompting operation.
The abnormal prompt operation may be, for example, a text prompt, a voice prompt, an indicator light prompt, or the like.
The method has the advantages that when the current-level rule relation is logic or relation, if one rule item is abnormal in execution but the execution result is the rule item which is successfully executed, the execution result corresponding to the current-level rule relation can still be fed back to be successful in execution without interrupting the execution process of the rule description logic, and therefore the execution efficiency of the rule engine is improved under the condition that the execution result is accurate.
In one embodiment, optionally, based on the next rule item, continuing to execute the rule description logic, comprising: if the execution result of the next rule item is successful, feeding back the execution result corresponding to the current level rule relationship as successful execution; and if the execution result of the next rule item is that the execution fails, taking the next rule item as the current rule item, and returning to execute the step of judging whether the next rule item corresponding to the current rule item exists or not.
Specifically, if the execution result of the next rule item is successful, the execution result corresponding to the fed back current-level rule relationship is successful regardless of whether the current-level rule relationship also corresponds to other unexecuted rule items. If the execution result of the next rule item is execution failure, it indicates that other unexecuted rule items corresponding to the current-level rule relationship still need to be executed continuously, if the execution result of the other unexecuted rule items is a rule item which is executed successfully, the feedback execution results corresponding to the current-level rule relationship are all execution success, and if the execution result of the other unexecuted rule items is not a rule item which is executed successfully, the execution of the rule description logic is stopped, and the execution logic executes the exception prompt operation.
Fig. 2B is a flowchart of a specific example of an exception handling method according to an embodiment of the present invention. Specifically, in an embodiment, a current rule item with abnormal execution is detected, and if a current rule relationship corresponding to the current rule item is a logical or relationship, a next rule item exists, and an execution result of the next rule item is successful in execution, an execution result corresponding to the current-level rule relationship is fed back as successful in execution. In another embodiment, a current rule item with execution exception is detected, if the current rule relation corresponding to the current rule item is not a logic or relation, or a next rule item does not exist, the execution of the rule description logic is stopped, and the execution logic executes exception prompt operation. In another embodiment, a current rule item with abnormal execution is detected, if the current rule relationship corresponding to the current rule item is a logic or relationship and a next rule item exists, but the execution result of the next rule item is execution failure, the next rule item is used as the current rule item, the step of judging whether the next rule item corresponding to the current rule item exists is returned, and if the next rule item exists and the execution result of the next rule item is execution success, the execution result corresponding to the current-level rule relationship is fed back as execution success. If not, stopping executing the rule description logic, and executing the exception prompting operation by the execution logic.
In another embodiment, optionally, the continuing to execute the rule description logic based on the next rule item further includes: and if the execution state of the next rule item is abnormal, taking the next rule item as the current rule item, and returning to execute the step of judging whether the next rule item corresponding to the current rule item exists or not.
Fig. 2C is a schematic diagram of a feedback result of a rule description logic according to an embodiment of the present invention. Specifically, the two cross-striped boxes in fig. 2C respectively represent rule item 1 and rule item 2 whose execution states are execution exceptions, the vertically striped box represents rule item 3 whose execution results are execution failures, and the blank box represents rule item 4 whose execution results are execution successes. Based on the technical solution provided by this embodiment, the execution result of the "logical or relationship" feedback in fig. 2C is the execution success. Illustratively, in another embodiment, if the execution result of the rule item 4 in fig. 2C is an execution failure, the execution of the rule description logic is stopped, and the execution logic performs an exception prompting operation.
According to the technical scheme of the embodiment, the current level rule relation corresponding to the current rule item is obtained in response to the current rule item which is abnormally executed, and if the current level rule relation is a logic or relation and a next rule item corresponding to the current rule item exists, the rule description logic is continuously executed based on the next rule item.
Fig. 3 is a flowchart of another exception handling method provided in the embodiment of the present invention, and this embodiment provides another implementation manner for a subsequent handling method of "if a current-level rule relationship is not a logical or relationship, or if there is no next rule item corresponding to the current rule item". As shown in fig. 3, the method includes:
s210, responding to the current rule item with execution exception detected in the execution process of the rule description logic, and acquiring the current level rule relation corresponding to the current rule item.
In one embodiment, optionally, the method further comprises: acquiring remote calling information in the execution process of a current rule item in the rule description logic; and if the receiving time of the calling data in the remote calling information exceeds a preset time threshold value and/or if the remote calling information contains calling service abnormal information fed back by the called party, setting the execution state corresponding to the current rule item as execution abnormity.
Specifically, the remote call information is used to record call information corresponding to a preset rule parameter in the current rule item. For example, the preset rule parameter is "gender", and a parameter value (e.g. male, female or unknown) corresponding to the preset rule parameter needs to be obtained from a third-party service (i.e. a called party), which may be, for example, a data storage system or a server.
In one embodiment, specifically, the rule engine executes a timing operation of receiving time of the call data while sending the data call request to the third-party service based on a preset rule parameter in the current rule item, and sets an execution state corresponding to the current rule item as an execution exception if the rule engine does not receive the call data and the receiving time obtained by timing exceeds a preset time threshold. For example, the preset time threshold may be 3 seconds. In another embodiment, optionally, the rule engine sends a data call request to the third-party service based on a preset rule parameter in the current rule item, and if call service exception information fed back by the third-party service based on the data call request is received, the execution state corresponding to the current rule item is set to be execution exception.
On the basis of the foregoing embodiment, optionally, after obtaining the current-level rule relationship corresponding to the current rule item, the method further includes: adding the rule information corresponding to the current rule item into an abnormal log; the rule information comprises at least one of start execution time, remote calling information and a current-level rule relation; after the rule description logic stops executing, the exception log is output.
The method has the advantages that the user can conveniently look up the rule item with execution exception, and the exception repairing operation can be carried out in time.
S220, judging whether the current-level rule relation is a logic or relation and a next rule item corresponding to the current rule item exists, if so, executing S250, and if not, executing S230.
And S230, acquiring the upper-level rule relation corresponding to the current rule group to which the current rule item belongs.
In this embodiment, the current rule set includes at least one rule item and a rule relationship between the rule items. Wherein the current rule group is a higher level rule item containing the current rule item and other rule items. Correspondingly, the rule relationship corresponding to the current rule group is a previous-level rule relationship relative to the current-level rule relationship.
Fig. 4A is an architecture diagram of a rule set according to an embodiment of the present invention. Specifically, fig. 4A shows 3 rule groups, rule group 1, rule group 2, and rule group 3, respectively. The rule group 1 includes a rule item 1.1, a rule item 1.2, and a logic or relationship between the rule item 1.1 and the rule item 1.2, the rule group 2 includes a rule item 2.1, a rule item 2.2, and a logic and relationship between the rule item 2.1 and the rule item 2.2, the rule group 3 includes a rule item 3.1, a rule item 3.2, and a logic or relationship between the rule item 3.1 and the rule item 3.2, and the rule relationships corresponding to the rule group 1, the rule group 2, and the rule group 3 are rules or relationships. Specifically, the current-level rule relationship corresponding to the current rule item is three rule relationships (or, and, or) on the right side in fig. 4A, and the previous-level rule relationship corresponding to the current rule group is a rule relationship (or) on the left side in fig. 4A.
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 is determined that the current rule group to which the current rule item belongs is a rule group that is executed abnormally.
S240, judging whether the upper-level rule relation is a logic or relation and a next rule group corresponding to the current rule group exists, if so, executing S260, and if not, executing S270.
Specifically, whether the rule relationship at the previous stage is a logic or relationship is judged first, and if so, whether a next rule group corresponding to the current rule group exists is judged continuously.
And S250, continuously executing the rule description logic based on the next rule item.
And S260, continuously executing the rule description logic based on the next rule group.
In one embodiment, optionally, the rule description logic continues to be executed based on the next rule group, including: if the execution result of the next rule group is successful, feeding back the execution result corresponding to the upper-level rule relationship as successful execution; and if the execution result of the next rule group is execution failure or the execution state of the next rule group is execution abnormity, taking the next rule group as the current rule group, and returning to execute the step of judging whether the next rule group corresponding to the current rule group exists or not.
S270, stopping executing the rule description logic, and executing the logic to execute the abnormal prompt operation.
Fig. 4B is a schematic diagram of a feedback result of another rule description logic provided in an embodiment of the present invention. Specifically, the cross-striped boxes in fig. 4B indicate rule item rule groups whose execution states are execution exceptions, the cross-striped boxes indicate rule items or rule groups that are not executed, the vertical striped boxes indicate rule items or rule groups whose execution results are execution failures, and the blank boxes indicate rule items or rule groups whose execution results are execution successes. Based on the technical solution provided by this embodiment, the execution state fed back by the first "logic or relationship" on the right side in fig. 4B is an execution exception, the execution state fed back by the "logic and relationship" on the right side is an execution exception, the execution result fed back by the second "logic or relationship" on the right side is an execution success, and correspondingly, the execution result fed back by the "logic or relationship" on the left side is an execution success.
Fig. 4C is a flowchart of another specific example of an exception handling method according to an embodiment of the present invention. Specifically, if the current rule relationship is not a logical or relationship, or if there is no next rule item, the upper-level 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 a 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 execution. In another embodiment, if the last rule relationship is not a logical OR relationship, or there is no next set of rules, execution of the rule description logic is stopped and the execution logic performs an exception prompt operation. 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 an execution failure, the next rule group is used as the previous rule group, the step of determining whether the next rule group corresponding to the previous rule group exists is returned, and if the next rule group exists and the execution result of the next rule group is an execution success, the execution result corresponding to the previous rule relationship is fed back as an execution success. If not, stopping executing the rule description logic, and executing the exception prompting operation by the execution logic.
It should be noted that, in the embodiment of the present invention, the example explanation is performed only by taking the rule level in the rule description logic as two levels, and certainly, if the rule level in the rule description logic is greater than or equal to two levels, a similar technical scheme may be adopted until the root node rule relationship corresponding to the current rule item is found, where the root node rule relationship is a rule relationship where there is no previous level rule relationship corresponding to the root node rule relationship. The above schemes are all within the protection scope of the present application.
According to the technical scheme of the embodiment, when the current-level rule relationship is not a logic or relationship, or when a next rule item corresponding to the current rule item does not exist, the last-level rule relationship corresponding to the current rule group to which the current rule item belongs is continuously obtained, whether the last-level rule relationship is a logic or relationship and the next rule group corresponding to the current rule group exists is judged, and if the last-level rule relationship is a logic or relationship and the next rule group corresponding to the current rule group exists, the rule description logic is continuously executed based on the next rule group.
On the basis of the foregoing embodiment, optionally, the method further includes: in response to receiving a call instruction sent by an application program, acquiring rule description logic corresponding to the call instruction; the calling instruction is sent by the application program in response to the received application request; and executing the rule description logic, and sending the obtained execution result to the application program after the rule description logic stops executing so that the application program executes filtering operation on the application request based on the execution result.
Specifically, the application program receives at least one application request, which may be, for example, an order placing request or a network access request. And the application program executes the rule description logic by calling the rule engine and executes the filtering operation on the application request based on the received execution result fed back by the rule engine. Wherein the filtering operation receives the application operation and the application rejection operation. For example, if the execution result fed back by the rule engine corresponding to the application request a is that the execution is successful, the application program executes an application receiving operation on the application request a, and if the execution result fed back by the rule engine corresponding to the application request a is that the execution is failed, the application program executes an application rejecting operation on the application request a.
Fig. 5 is a schematic structural diagram of an exception handling apparatus according to an embodiment of the present invention. As shown in fig. 5, the apparatus includes: the current rule relation obtaining module 310 and the first rule description logic continue execution module 320.
The current rule relation obtaining module 310 is configured to, in response to a current rule item that is detected to be abnormal in execution of the rule description logic, obtain a current-level rule relation corresponding to the current rule item; the current rule item comprises a preset rule parameter and an operation rule corresponding to the preset rule parameter;
a first rule description logic continuing execution module 320 for continuing execution of 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.
According to the technical scheme of the embodiment, the current level rule relation corresponding to the current rule item is obtained in response to the current rule item which is abnormally executed, and if the current level rule relation is a logic or relation and a next rule item corresponding to the current rule item exists, the rule description logic is continuously executed based on the next rule item.
On the basis of the foregoing embodiment, optionally, the first rule description logic continuing to execute module 320 is specifically configured to:
if the execution result of the next rule item is successful, feeding back the execution result corresponding to the current level rule relationship as successful execution;
and if the execution result of the next rule item is that the execution fails, taking the next rule item as the current rule item, and returning to execute the step of judging whether the next rule item corresponding to the current rule item exists or not.
On the basis of the foregoing embodiment, optionally, the apparatus further includes:
and the first rule description logic stop execution module is used for stopping executing the rule description logic and executing the logic to execute the abnormal prompt operation if the current-level rule relation is not a logic or relation or if a next rule item corresponding to the current rule item does not exist.
On the basis of the above embodiment, optionally, the apparatus further includes:
a previous-level rule relation obtaining module, configured to obtain a previous-level rule relation corresponding to a current rule group to which a current rule item belongs if the current-level rule relation is not a logical or relation, or if a next rule item corresponding to the current rule item does not exist; wherein, the current rule group comprises at least one rule item and the rule relation among the rule items;
and the second rule description logic continuous execution module is used for continuously executing the rule description logic based on the next rule group if the upper-level rule relation is a logic OR relation and the next rule group corresponding to the current rule group exists.
On the basis of the above embodiment, optionally, the apparatus further includes:
and the second rule description logic stop execution module is used for stopping executing the rule description logic and executing the logic to execute the abnormal prompt operation if the upper-level rule relation is not the logic or relation or if the next rule group corresponding to the current rule group does not exist.
On the basis of the above embodiment, optionally, the apparatus further includes:
the execution state setting module is used for acquiring remote calling information in the execution process of the current rule item in the rule description logic;
and if the receiving time of the calling data in the remote calling information exceeds a preset time threshold value and/or if the remote calling information contains calling service abnormal information fed back by the called party, setting the execution state corresponding to the current rule item as execution abnormity.
On the basis of the above embodiment, optionally, the apparatus further includes:
the rule information adding module is used for adding the rule information corresponding to the current rule item into the abnormal log after acquiring the current level rule relation corresponding to the current rule item; the rule information comprises at least one of start execution time, remote calling information and a current-level rule relation;
and the abnormal log output module is used for outputting the abnormal log after the rule description logic stops executing.
On the basis of the above embodiment, optionally, the apparatus further includes:
the rule description logic acquisition module is used for responding to a received call instruction sent by an application program and acquiring rule description logic corresponding to the call instruction; the calling instruction is sent by the application program in response to the received application request;
the calling module is used for calling the current rule relation obtaining module;
and the execution result sending module is used for sending the obtained execution result to the application program after the rule description logic stops executing so that the application program executes filtering operation on the application request based on the execution result.
The exception handling device provided by the embodiment of the invention can execute the exception handling method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 6, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM)12, a Random Access Memory (RAM)13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM)12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of 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, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, 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.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of 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 suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as an exception handling method.
In some embodiments, the exception handling method may be implemented as a computer program tangibly embodied 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 onto the electronic device 10 via the ROM 12 and/or the 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, the processor 11 may be configured to perform the exception handling method by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
The computer program for implementing the exception handling method of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer instruction is stored, where the computer instruction is used to enable a processor to execute an exception handling method, where the method includes:
in response to the current rule item of which the execution exception is detected in the execution process of the rule description logic, acquiring a current-level rule relation corresponding to the current rule item; the current rule item comprises a preset rule parameter and an operation rule corresponding to the preset rule parameter;
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 continues to be executed based on the next rule item.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here 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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, 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 may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, 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: local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. An exception handling method, comprising:
responding to a current rule item of which execution exception is detected in the execution process of rule description logic, and acquiring a current level rule relation corresponding to the current rule item; the current rule item comprises a preset rule parameter and an operation rule corresponding to the preset rule parameter;
if the current level rule relationship is a logical OR relationship and there is a next rule item corresponding to the current rule item, continuing execution of the rule description logic based on the next rule item.
2. The method of claim 1, wherein continuing to execute the rule description logic based on the next rule term comprises:
if the execution result of the next rule item is successful, feeding back the execution result corresponding to the current level rule relationship as successful execution;
and if the execution result of the next rule item is execution failure, taking the next rule item as a current rule item, and returning to execute the step of judging whether the next rule item corresponding to the current rule item exists or not.
3. The method of claim 1, further comprising:
if the current level rule relation is not a logic or relation, or if a next rule item corresponding to the current rule item does not exist, stopping executing the rule description logic, and executing logic to execute an exception prompt operation.
4. The method of claim 1, further comprising:
if the current-level rule relation is not a logic or relation, or if a next rule item corresponding to the current rule item does not exist, acquiring a previous-level rule relation corresponding to a current rule group to which the current rule item belongs; wherein, the current rule group comprises at least one rule item and rule relation among the rule items;
if the superior rule relationship is a logical OR relationship and there is a next rule group corresponding to the current rule group, continuing to execute the rule description logic based on the next rule group.
5. The method of claim 4, further comprising:
if the upper-level rule relation is not a logic or relation, or if a next rule group corresponding to the current rule group does not exist, stopping executing the rule description logic, and executing logic to execute an abnormal prompt operation.
6. The method of claim 1, further comprising:
acquiring remote calling information in the execution process of the current rule item in the rule description logic;
and if the receiving time of the calling data in the remote calling information exceeds a preset time threshold value and/or if the remote calling information contains calling service abnormal information fed back by a called party, setting the execution state corresponding to the current rule item as execution abnormity.
7. The method of claim 6, wherein after obtaining the current level rule relationship corresponding to the current rule item, the method further comprises:
adding the rule information corresponding to the current rule item into an abnormal log; the rule information comprises at least one of start execution time, remote invocation information and a current-level rule relation;
and outputting an exception log after the rule description logic stops executing.
8. The method according to any one of claims 1-7, further comprising:
responding to a received call instruction sent by an application program, and acquiring a rule description logic corresponding to the call instruction; wherein the calling instruction is sent by the application program in response to the received application request;
and executing the rule description logic, and sending an obtained execution result to the application program after the rule description logic stops executing so that the application program executes filtering operation on the application request based on the execution result.
9. An exception handling apparatus, comprising:
the current rule relation acquisition module is used for responding to a current rule item which detects execution abnormity in the execution process of the rule description logic and acquiring a current level rule relation corresponding to the current rule item; the current rule item comprises a preset rule parameter and an operation rule corresponding to the preset rule parameter;
a first rule description logic continuing execution module, configured to continue executing the rule description logic based on a next rule item if the current level rule relationship is a logical or relationship and the next rule item corresponding to the current rule item exists.
10. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the exception handling method of any one of claims 1 to 8.
11. A computer-readable storage medium storing computer instructions for causing a processor to perform the exception handling method of any one of claims 1 to 8 when executed.
CN202210684211.6A 2022-06-16 2022-06-16 Exception handling method, device, equipment and storage medium Pending CN115048159A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210684211.6A CN115048159A (en) 2022-06-16 2022-06-16 Exception handling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210684211.6A CN115048159A (en) 2022-06-16 2022-06-16 Exception handling method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115048159A true CN115048159A (en) 2022-09-13

Family

ID=83162100

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210684211.6A Pending CN115048159A (en) 2022-06-16 2022-06-16 Exception handling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115048159A (en)

Similar Documents

Publication Publication Date Title
CN112988727B (en) Data annotation method, device, equipment, storage medium and computer program product
CN115686910A (en) Fault analysis method and device, electronic equipment and medium
CN116010220A (en) Alarm diagnosis method, device, equipment and storage medium
CN112948081B (en) Method, device, equipment and storage medium for processing tasks in delayed mode
CN115426287B (en) System monitoring and optimizing method and device, electronic equipment and medium
CN114697398B (en) Data processing method, device, electronic equipment, storage medium and product
CN115048159A (en) Exception handling method, device, equipment and storage medium
CN116527652A (en) Method, device, equipment and medium for determining file format conversion path
CN115509714A (en) Task processing method and device, electronic equipment and storage medium
CN115456634A (en) Data processing method and device, electronic equipment and storage medium
CN113656239A (en) Monitoring method and device for middleware and computer program product
CN115081413A (en) Report generation method, device, system, equipment and medium
CN113590287A (en) Task processing method, device, equipment, storage medium and scheduling system
CN114358288B (en) Knowledge graph generation method, information recommendation device and electronic equipment
CN116719621B (en) Data write-back method, device, equipment and medium for mass tasks
CN117290179A (en) Method, device, equipment and storage medium for determining event timeout state
CN117932671A (en) Message processing method and device, electronic equipment and storage medium
CN114706578A (en) Data processing method, device, equipment and medium
CN114445127A (en) Account releasing method and device, electronic equipment and storage medium
CN115131137A (en) Operation risk checking method, device, equipment and storage medium
CN115878086A (en) Application program operation processing method, device, equipment and storage medium
CN118034749A (en) Updating method and electronic equipment
CN115421665A (en) Data storage method, device, equipment and storage medium
CN116991825A (en) Database flashback method, device, equipment and storage medium
CN115834729A (en) Data transmission method, device, equipment and medium

Legal Events

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