A method and apparatus for detecting system faults

By constructing object graphs and balancing expressions in a distributed system and using log messages to monitor data changes, the problem of subsystems being unable to self-detect faults was solved, achieving efficient system fault detection and reducing enterprise losses.

CN112416704BActive Publication Date: 2026-03-24BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-10
Publication Date
2026-03-24

Smart Images

  • Figure CN112416704B_ABST
    Figure CN112416704B_ABST
Patent Text Reader

Abstract

The present specification discloses a method and device for detecting system failure. For each subsystem database in the system, each object node in the object graph is determined according to each physical model of the database. Then, according to the business content corresponding to each object node and the business logic of each business, a balanced expression composed of object nodes is determined. After that, for each balanced expression, when the data change of the object node in the database in the balanced expression is determined, a balanced expression instance is determined. If the data on both sides of the balanced expression instance is inconsistent, it is determined that there is a system failure, and a prompt information is sent. In this way, when the data of the business in the system changes, whether there is a failure in the system can be detected by judging whether the operation results on both sides of the balanced expression instance corresponding to the business are consistent, so that the problem can be found in time and efficiently, and the loss caused by the system failure to the enterprise can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computers, and in particular to a method and apparatus for detecting system faults. Background Technology

[0002] With the development of internet and computer technologies, business systems of various enterprises are becoming increasingly sophisticated. Enterprises with a wide range of business operations and diverse business types often utilize distributed systems to process these various tasks.

[0003] In particular, in scenarios involving resource allocation, since resource allocation may involve multiple business processes, distributed systems are generally used to execute these processes. Processing these processes typically requires collaboration between multiple subsystems. Furthermore, different subsystems within a distributed system handle different transactions within the business process. For example, in an insurance claims scenario, different insurance subsystems can determine different types of compensation amounts, which are then aggregated to determine the total compensation amount.

[0004] However, because the subsystems in such a distributed system are decoupled, when a system error occurs in a subsystem, the subsystem itself may have difficulty detecting the error. That is, the subsystem may think that the transaction it is executing is normal, resulting in a business execution error.

[0005] In existing technologies, when troubleshooting distributed systems, the common practice is to manually check whether there are any problems with the business data of each subsystem. The most common method is manual reconciliation. This method is inefficient and cannot detect system faults in a timely and accurate manner. If the fault is not detected in time, the losses to the enterprise will be incalculable.

[0006] Therefore, there is an urgent need for a method to detect system failures in order to reduce the impact of system failures on business and reduce corporate losses. Summary of the Invention

[0007] This specification provides a method and apparatus for detecting system faults, in order to partially solve the aforementioned problems existing in the prior art.

[0008] The following technical solution is adopted in this specification:

[0009] This specification provides a method for detecting system faults, the method specifically including:

[0010] For the database of each subsystem in the system, determine the physical models of that database;

[0011] Based on the obtained physical models, determine the object nodes in the object graph;

[0012] Based on the business content corresponding to each object node and the business logic of each business, a balance expression composed of object nodes is determined, wherein the business content on both sides of the equal sign of the balance expression is consistent in business logic.

[0013] For each balancing expression, when it is determined that the data of the object node in the balancing expression has changed in the database, the balancing expression instance is determined based on the changed data and the balancing expression.

[0014] If the data on both sides of the equal sign in the balanced expression instance are inconsistent, a system fault is determined, and a prompt message is sent.

[0015] Optionally, for the database of each subsystem in the system, determine the physical models of that database, specifically including:

[0016] For each subsystem in the system, the object-relational mapping framework of that subsystem is loaded when the subsystem starts up;

[0017] The method scans the subsystem's database using the loaded object-relational mapping framework to determine the physical models within the database. Optionally, the method further includes:

[0018] Subscribe to the log messages of each object node based on the object nodes contained in the determined balance expressions.

[0019] Optionally, based on the modified data and the balancing expression, an instance of the balancing expression is determined, specifically including:

[0020] Receive log messages from the database for the object nodes in the balance expression;

[0021] Based on the data carried in the log message and the business identifier, determine the modified data corresponding to the object node in the balance expression corresponding to the business identifier;

[0022] Based on the balancing expression and the data after the changes to the identified object nodes, determine the balancing expression instance.

[0023] Optionally, if the data on both sides of the equal sign in the balanced expression instance are inconsistent, a system fault is determined, and a prompt message is sent, specifically including:

[0024] If the data on both sides of the equal sign of the balanced expression instance are inconsistent, the data on both sides of the equal sign of the balanced expression instance will continue to be determined based on the received log messages according to the preset time.

[0025] If the preset time period is exceeded and the data on both sides of the equal sign of the determined balanced expression instance are still inconsistent, a system fault is determined and a prompt message is sent.

[0026] Optionally, a system fault is identified, and a notification message is sent, specifically including:

[0027] When the data corresponding to an object node in the balance expression instance is empty, a fault is determined in the subsystem providing the data corresponding to the object node, and a prompt message is sent; or

[0028] When the value of the data corresponding to an object node in the balance expression instance is not within the preset value range, it is determined that the subsystem providing the data corresponding to the object node is faulty, and a prompt message is sent.

[0029] Optionally, the method further includes:

[0030] For each instance of a balancing expression, if it is determined that the data on both sides of the equals sign of each instance of a balancing expression is consistent, then the system is considered to be functioning normally, and the business logic corresponding to each balancing expression continues to be executed.

[0031] This specification provides a device for detecting system faults, the device specifically comprising:

[0032] The physical model determination module is used to determine the physical models for each database of each subsystem in the system.

[0033] The object node determination module is used to determine each object node in the object graph based on the acquired physical models.

[0034] The expression determination module is used to determine a balanced expression composed of object nodes based on the business content corresponding to each object node and the business logic of each business, wherein the business content on both sides of the equal sign of the balanced expression is consistent in business logic.

[0035] The instance determination module is used to determine the instance of a balance expression based on the changed data and the balance expression when it is determined that the data of the object node in the balance expression has changed in the database for each balance expression.

[0036] The system fault detection module is used to determine that a system fault exists and send a prompt message if the data on both sides of the equal sign of the instance of the balance expression are inconsistent.

[0037] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described above for detecting system faults.

[0038] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described above for detecting system faults.

[0039] The above-mentioned technical solutions adopted in this specification can achieve the following beneficial effects:

[0040] In the method for detecting system faults provided in this specification, for the database of each subsystem in the system, based on the physical models of the database, each object node in the object graph is determined. Then, based on the business content corresponding to each object node and the business logic of each business, a balance expression composed of object nodes is determined. After that, for each balance expression, when it is determined that the data of the object node in the balance expression has changed in the database, a balance expression instance is determined. If the data on both sides of the equal sign of the balance expression instance are inconsistent, a system fault is determined, and a prompt message is sent.

[0041] As can be seen from the above method, this method can detect whether there is a fault in the system when there is a change in business data by judging whether the calculation results on both sides of the balance expression instance corresponding to the business are consistent, so as to discover problems in a timely and efficient manner and reduce the losses caused to enterprises by system failures. Attached Figure Description

[0042] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings:

[0043] Figure 1 This is a flowchart illustrating a method for detecting system faults as described in this specification.

[0044] Figure 2 This is a schematic diagram of an object diagram provided in this specification;

[0045] Figure 3 This is a schematic diagram of a device for detecting system malfunctions provided in this specification;

[0046] Figure 4 The corresponding information provided in this specification Figure 1 A schematic diagram of the structure of an electronic device. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.

[0048] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0049] Currently, in distributed system scenarios involving resource allocation, multiple subsystems need to collaborate when the system processes business. Each subsystem has a clear division of labor and handles different business-related tasks.

[0050] For example, in insurance operations, when claims need to be processed for beneficiaries, different insurance subsystems can determine different types of payouts. The total payout is obtained by summing the payouts from each subsystem. A single subsystem can be responsible for determining only one type of payout or multiple types. Determining the total payout requires the insurance system to function normally and accurately determine the payout amount to ensure fair and reasonable compensation to the beneficiaries. To avoid losses to the company due to erroneous payout amounts caused by insurance system malfunctions, system fault detection is necessary to identify and address any issues promptly.

[0051] Because different subsystems operate independently, a failure in one subsystem may lead to errors in the transactions executed by that subsystem. For example, an incorrect compensation strategy stored in the subsystem might result in an incorrect calculated compensation amount. In such cases, the subsystem cannot automatically detect transaction errors. This necessitates manual reconciliation to detect subsystem transaction execution errors, making it difficult to promptly identify system errors and potentially causing losses.

[0052] Therefore, there is an urgent need for a faster and more effective method for detecting system faults.

[0053] To address the issue that manual reconciliation is inefficient and fails to detect system faults promptly and accurately when troubleshooting distributed systems, this application provides a method for detecting system faults.

[0054] Figure 1 This is a flowchart illustrating a method for detecting system faults as described in this specification, which specifically includes the following steps:

[0055] S100: For the database of each subsystem in the system, determine the physical models of that database.

[0056] In this specification, when the system receives a user's business request, it determines the necessary subsystems to execute the business based on the corresponding business request and sends the required data to each subsystem. Each subsystem then stores the received data in its corresponding database. The stored data typically includes various information related to the user and the business, such as basic user information, the content of the business processed, the processing time, the timeliness of the business, and the resources corresponding to the business. When there are business changes in the system, system faults can be detected by reconciling the data of each subsystem. This requires retrieving the data stored in the databases of each subsystem. To accurately determine the data related to the changed business, it is first necessary to determine the physical models in the databases of each subsystem. Typically, the physical models in the databases of each subsystem include at least the physical models corresponding to the data tables used to store information related to the business execution results.

[0057] The process for detecting system faults provided in this manual is illustrated using the system server as the executing entity.

[0058] When determining the physical models in the database of each subsystem, specifically, the server of the verification system can, for each subsystem, load the Object-Relational Mapping (ORM) framework of that subsystem when the subsystem starts up. The loaded ORM framework then scans the database of that subsystem to determine the physical models within the database. Each physical model provides a visual extraction of the database structure corresponding to that physical model, facilitating the generation of object graphs in subsequent steps.

[0059] Of course, scanning the database of this subsystem using an ORM framework is a relatively mature technical solution, so this manual will not go into detail about the specific scanning process.

[0060] S102: Based on the acquired physical models, determine the object nodes in the object graph.

[0061] In one or more embodiments provided in this specification, after determining the physical models in the database corresponding to each subsystem, an object graph can be determined based on the determined physical models to facilitate the establishment of balance expressions. Different physical models correspond to different object nodes in the object graph. This allows the balance expressions to be determined subsequently through the object nodes in the object graph.

[0062] In one or more embodiments provided in this specification, the server of the verification system can determine an object graph reflecting the relationships between objects, and determine each object node in the object graph, based on the acquired physical models. The object graph can illustrate the data structure in the database.

[0063] Figure 2 This document provides a schematic diagram of an object graph. As shown, the object nodes in the object graph represent the following tables: User Basic Information (user_information), Total Business Transaction Amount (Proj_total_sum), Fee a (Proj_fee_a), Fee b (Proj_fee_b), Fee c (Proj_fee_c), and Fee d (Proj_fee_d). The User Basic Information table includes five types of information: user name, mobile phone number, age, ID, and item. The Total Business Transaction Amount table includes user name and total business transaction amount. The Fee a table includes user name and fee a. The Fee b table includes user name and fee b. The Fee c table includes user name and fee c. The Fee d table includes user name and fee d. Taking an insurance system as an example... Figure 2 Tables A, B, C, and D in the table could store data on the compensation amounts for lost wages, nutritional expenses, medical expenses, and transportation expenses for each insurance policy that requires reimbursement. The total business volume table could then store the total compensation amount for each insurance policy.

[0064] S104: Based on the business content corresponding to each object node and the business logic of each business, determine the balance expression composed of object nodes, wherein the business content on both sides of the equal sign of the balance expression is consistent in business logic.

[0065] In a distributed system, business operations can be processed collaboratively by different subsystems within the system. This means different transactions are handled by different subsystems, and therefore, the data generated by these subsystems often have certain correspondences. Taking an insurance system as an example, the data from different transactions handled by each subsystem in this system can be one or more types of payouts for an insurance policy, or it can be the total payout amount for that policy. When processing out-of-pocket claims, there is an equality relationship between the sum of the different types of payouts and the total payout amount. Therefore, a balance expression can be constructed based on this equality relationship. When executing out-of-pocket claims, the balance expression is reconciled by checking whether both sides of the equality sign are equal based on the data generated by each subsystem's transactions, thus detecting any system malfunctions. Therefore, in one or more embodiments provided in this specification, after determining the object nodes in the object graph, the server of the verification system can determine the balance expression composed of the object nodes based on the business content corresponding to each object node and the business logic of each business.

[0066] The business content corresponding to the object node represents which data from which business processes are stored in the database. For example, if a physical model in a subsystem's database corresponds to a table storing data on compensation for mental distress, then the business content corresponding to the object node determined based on that physical model could be: compensation amount for mental distress. The business logic describes the specific operational relationships between the business contents on both sides of the equals sign in this balanced expression, such as which business contents are equal to which other business contents after what operations.

[0067] Specifically, first, the verification system's server can determine the business processes and logic corresponding to each business as needed. Then, based on the business processes and logic, it determines which process nodes' data determine the business result after execution. Next, it identifies the object nodes storing the data for each process node and the object nodes storing the business result data, and establishes a balancing expression composed of these object nodes. Alternatively, business personnel can use this object graph to establish balancing expressions for different businesses, based on the business logic and content.

[0068] Furthermore, in one or more embodiments provided in this specification, after determining each balancing expression, the server of the verification system can subscribe to the log messages of each object node based on the object nodes contained in the determined balancing expressions. This allows for the determination of the changed data of the object node corresponding to the log message in subsequent steps. The log message can be a binary log (binlog), which records all "add," "delete," and "modify" operations in the database. Thus, based on the binlog, it is possible to determine which services have changed and which data has been changed.

[0069] In one or more embodiments provided in this specification, taking an insurance system as an example, after an insured purchases insurance, information related to the insurance, such as the insured's information, beneficiary information, and specific details of the insurance, is stored in the corresponding database. At this time, the database stores the compensation amounts for each claim item for the insurance beneficiary. If the insured experiences an accident during the insurance period and files a claim, the insurance system needs to determine the total amount to be paid to the beneficiary for the insurance purchased by the insured. In this case, the compensation amounts for each claim item stored in the database corresponding to the insurance change. An insurance policy may involve multiple compensation items, such as medical expenses, lost wages, and nutritional expenses. The specific compensation amounts and total compensation amounts for these items can be determined separately by different subsystems of the insurance system. In the business logic of the balance expression corresponding to the insurance, the compensation amount for each claim item and the total compensation amount are on opposite sides of the equality sign in the balance expression. Under normal operating conditions, the sum of all compensation amounts equals the total compensation amount.

[0070] S106: For each balancing expression, when it is determined that the data of the object node in the balancing expression has changed in the database, determine the balancing expression instance based on the changed data and the balancing expression.

[0071] In one or more embodiments provided in this specification, when data changes occur during system business operations, if the changed data corresponds to the data of an object node included in any balancing expression, the server of the verification system can receive a log message sent by the database storing the data through the balancing expression. Therefore, the server of the verification system can also determine the balancing expression that needs to be generated based on the received log message, and determine the balancing expression instance based on the changed data and the balancing expression.

[0072] Specifically, for each determined balancing expression, when the server of the verification system receives a log message from the database containing the object node of that balancing expression, it can first determine the instance of the object node in the balancing expression corresponding to the business identifier, based on the data and business identifier carried in the log message. Then, based on the balancing expression and the determined object node instance, it determines the balancing expression instance of that balancing expression.

[0073] Furthermore, in one or more embodiments provided in this specification, since the distributed system handles numerous business processes, there may be situations where multiple business processes are modified simultaneously, requiring the system to determine multiple instances of the balancing expression. In this case, the modified data that the system needs to determine also involves multiple instances of the balancing expression, necessitating the identification of which modified data is used to determine the same balancing expression instance. For the above reasons, the system can determine which modified data is used to determine the same balancing expression instance based on the different business identifiers of different data carried in the log messages. For example, in an insurance claims scenario, when the system confirms the payout amount for each claim item and the total payout amount for multiple insurance policies, it can determine the payout amount and the total payout amount based on the business identifiers of the data carried in the log messages, thereby determining the balancing expression instance for that insurance policy.

[0074] In one or more embodiments provided in this specification, taking an insurance claim scenario as an example, according to Figure 2 In the object graph, the balance expression for an insurance claim requiring compensation can be Proj_total_sum = Proj_fee_a + Proj_fee_b + Proj_fee_c + Proj_fee_d, that is, total compensation = compensation for lost wages + compensation for nutritional expenses + compensation for medical expenses + compensation for transportation expenses. Further, assuming that the subsystems responsible for determining each compensation item determine the compensation for lost wages as 1000, the compensation for nutritional expenses as 600, the compensation for medical expenses as 3000, and the compensation for transportation expenses as 200, for a total compensation of 4800, then the server of the verification system, based on this balance expression, determines the following instance of the balance expression: 4800 = 1000 + 600 + 3000 + 200.

[0075] S108: If the data on both sides of the equal sign of the balanced expression instance are inconsistent, a system fault is determined and a prompt message is sent.

[0076] In one or more embodiments provided in this specification, after the server of the verification system determines the instance of the balance expression, it can determine whether the data operation results on both sides of the equal sign of the balance expression instance are consistent. If it is determined that the data operation results on both sides of the equal sign of the balance expression instance are inconsistent, a system fault is determined, and a prompt message is sent.

[0077] Furthermore, for the same business process, transactions executed by different subsystems may have a specific order within the business workflow. Therefore, data changes for that business may occur sequentially over a period of time. Similarly, for the same balancing expression instance, the timeframes for each changed data determined by the server in the verification system may differ. Therefore, even under normal system operation, there is a possibility that the results of the equality calculation on both sides of the balancing expression instance may be inconsistent.

[0078] Therefore, to avoid misjudgments caused by time differences in business data changes, this specification stipulates that when the server of the verification system determines that the data calculation results on both sides of the equals sign of the balanced expression instance are inconsistent, it waits for log messages sent by the databases of each subsystem for a preset time period. When a log message corresponding to the balanced expression instance (i.e., with consistent business identifiers) is received, the balanced expression instance is updated. In other words, within this preset time period, the data on both sides of the equals sign of the balanced expression instance is determined based on the received log messages. This preset time period can be a few seconds or a few minutes, and can be set as needed; this specification does not impose any restrictions.

[0079] If the preset time limit is exceeded and the data on both sides of the equals sign of the determined balanced expression instance are still inconsistent, a system fault is identified, and a prompt message is sent. If the data on both sides of the equals sign of the determined balanced expression instance are consistent and the preset time limit is not exceeded, a system fault is identified, and the business corresponding to the balanced expression instance can be executed normally.

[0080] Specifically, if the server of the verification system determines that the data calculation results on both sides of the equals sign of the balanced expression instance are inconsistent, it can determine whether there is any undetermined changed data within a preset time period based on the log messages of the object nodes in the balanced expression instance. If so, the changed data is re-determined based on the log messages of the object nodes in the balanced expression; otherwise, a system fault is determined, and a prompt message is sent. If the preset time period is exceeded, and the determined data on both sides of the equals sign of the balanced expression instance is still inconsistent, a system fault is determined, and a prompt message is sent.

[0081] In addition, in one or more embodiments provided in this specification, when the server of the verification system determines that the data on both sides of the equal sign of each balanced expression instance is consistent, the system is determined to be normal and the business corresponding to each balanced expression continues to be executed.

[0082] based on Figure 1The method for detecting system faults described herein involves determining each object node in the object graph based on the physical model of each subsystem's database. Then, based on the business content corresponding to each object node and the business logic of each business, a balance expression composed of the object nodes is determined. Subsequently, for each balance expression, when it is determined that the data of the object node in the balance expression has changed in the database, a balance expression instance is determined. If the data on both sides of the equal sign of the balance expression instance are inconsistent, a system fault is determined, and a prompt message is sent.

[0083] As can be seen from the above method, this method can detect whether there is a fault in the system when there is a change in business data by judging whether the calculation results on both sides of the balance expression instance corresponding to the business are consistent, so as to discover problems in a timely and efficient manner and reduce the losses caused to enterprises by system failures. In step S108 of this specification, when the server of the verification system determines that there is a fault in the system, it cannot determine the specific subsystem that has failed. Therefore, in one or more embodiments provided in this specification, the specific subsystem that has failed in the system can also be determined based on the determined changed data.

[0084] Specifically, when the data corresponding to an object node in the balance expression instance is empty, a fault is identified in the subsystem providing the data for that object node, and a prompt message is sent. Alternatively, when the value of the data corresponding to an object node in the balance expression instance is outside the preset range, a fault is identified in the subsystem providing the data for that object node, and a prompt message is sent. This preset range can be a limitation on whether the data is positive or negative, or on upper or lower limits, and can be set as needed; this specification does not impose any restrictions on it.

[0085] Furthermore, since the log messages of each object node may be generated at different times, the server of the verification system may not be able to receive the log messages of all object nodes in the balancing expression simultaneously. Therefore, in steps S106 to S108 of this specification, for each balancing expression, a timer can be started when the first log message carrying a service identifier from an object node in the balancing expression is received, and within a preset waiting time, log messages in the balancing expression carrying the same service identifier as the log message are continued to be received. After the waiting time expires, based on the data and service identifiers carried by each received log message, the balancing expression instance is determined, and it is determined whether the operation results on both sides of the equal sign of the balancing expression instance are consistent. If they are inconsistent, a system fault is determined, and a prompt message is sent. In this way, while ensuring the detection of system faults, the number of times the operation results on both sides of the equal sign of the balancing expression instance are checked for consistency can be reduced, thereby reducing energy consumption and saving resources.

[0086] The above describes one or more embodiments of a method for detecting system faults provided in this specification. Based on the same concept, this specification also provides corresponding devices for detecting system faults, such as... Figure 3 As shown.

[0087] Figure 3 This is a schematic diagram of a device for detecting system faults provided in this specification. The device includes: a physical model determination module, an object node determination module, an expression determination module, an instance determination module, and a system fault detection module, wherein:

[0088] The physical model determination module 200 is used to determine the physical models of each database for each subsystem in the system.

[0089] The object node determination module 202 is used to determine each object node in the object graph based on the acquired physical models.

[0090] The expression determination module 204 is used to determine a balanced expression composed of object nodes based on the business content corresponding to each object node and the business logic of each business, wherein the business content on both sides of the equal sign of the balanced expression is consistent in business logic.

[0091] The instance determination module 206 is used to determine the instance of a balance expression based on the changed data and the balance expression when it is determined that the data of the object node in the balance expression has changed in the database.

[0092] The system fault detection module 208 is used to determine that a system fault exists and send a prompt message if the data on both sides of the equal sign of the instance of the balance expression are inconsistent.

[0093] Optionally, the physical model determination module 200, for each subsystem in the system, loads the object-relational mapping framework of the subsystem when the subsystem starts, and scans the database of the subsystem through the loaded object-relational mapping framework to determine each physical model in the database of the subsystem.

[0094] Optionally, based on the object nodes contained in each of the determined balance expressions, the log messages of each object node can be subscribed to.

[0095] Optionally, the instance determination module 206 receives log messages of object nodes in the balance expression sent by the database, determines the modified data corresponding to the object node in the balance expression corresponding to the business identifier based on the data carried in the log messages and the business identifier, and determines the balance expression instance of the balance expression based on the balance expression and the determined modified data of the object node.

[0096] Optionally, if the data on both sides of the equal sign of the balanced expression instance are inconsistent, the system fault detection module 208 continues to determine the data on both sides of the equal sign of the balanced expression instance based on the received log messages for a preset time period. If the preset time period is exceeded and the determined data on both sides of the equal sign of the balanced expression instance are still inconsistent, a system fault is determined and a prompt message is sent.

[0097] Optionally, the system fault detection module 208 determines that the subsystem providing the data corresponding to the object node is faulty and sends a prompt message when the data corresponding to an object node in the balance expression instance is empty; or determines that the subsystem providing the data corresponding to the object node is faulty and sends a prompt message when the value of the data corresponding to an object node in the balance expression instance is not within a preset range.

[0098] Optionally, for each instance of a balancing expression, if it is determined that the data on both sides of the equals sign of each instance of a balancing expression is consistent, then the system is considered to be functioning normally, and the business corresponding to each balancing expression continues to be executed.

[0099] This specification also provides a computer-readable storage medium storing a computer program that can be used to execute the above-described... Figure 1 The provided method for detecting system malfunctions.

[0100] This instruction manual also provides Figure 4 The diagram shows a schematic structure of an electronic device. Figure 4 As shown, at the hardware level, this electronic device includes a processor, an internal bus, memory, and non-volatile storage, and may also include other hardware required for business operations. The processor reads the corresponding computer program from the non-volatile storage into memory and then executes it to achieve the above-mentioned functions. Figure 1 The provided method for detecting system malfunctions.

[0101] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0102] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0103] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0104] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0105] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components.

[0106] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0107] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0108] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0109] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0110] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0111] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0112] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0113] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0114] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0115] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0116] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0117] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.

Claims

1. A method for detecting system faults, characterized in that, The method specifically includes: For the database of each subsystem in the system, determine the physical model of the database. The physical model of the database is the physical model corresponding to the data table used to store the content related to the business execution results. Based on the obtained physical models, determine the object nodes in the object graph; Based on the business content corresponding to each object node and the business logic of each business, a balance expression composed of object nodes is determined, wherein the business content on both sides of the equal sign of the balance expression is consistent in business logic. For each balancing expression, when it is determined that the data of the object node in the balancing expression has changed in the database, the balancing expression instance is determined based on the changed data and the balancing expression. If the data on both sides of the equal sign in the balanced expression instance are inconsistent, a system fault is determined, and a prompt message is sent. For each subsystem's database in the system, determining the physical models for that database specifically includes: For each subsystem in the system, the object-relational mapping framework of that subsystem is loaded when the subsystem starts up; The database of the subsystem is scanned by the loaded object-relational mapping framework to determine the physical models in the database of the subsystem.

2. The method as described in claim 1, characterized in that, The method further includes: Subscribe to the log messages of each object node based on the object nodes contained in the determined balance expressions.

3. The method as described in claim 2, characterized in that, Based on the revised data and the balancing expression, determine the instance of the balancing expression, specifically including: Receive log messages from the database for the object nodes in the balance expression; Based on the data carried in the log message and the business identifier, determine the modified data corresponding to the object node in the balance expression corresponding to the business identifier; Based on the balancing expression and the data after the changes to the identified object nodes, determine the balancing expression instance.

4. The method as described in claim 1, characterized in that, If the data on both sides of the equals sign in the balanced expression instance are inconsistent, a system fault is determined, and a prompt message is sent, specifically including: If the data on both sides of the equal sign of the balanced expression instance are inconsistent, the data on both sides of the equal sign of the balanced expression instance will continue to be determined based on the received log messages according to the preset time. If the preset time period is exceeded and the data on both sides of the equal sign of the determined balanced expression instance are still inconsistent, a system fault is determined and a prompt message is sent.

5. The method as described in claim 1, characterized in that, A system malfunction has been identified, and a notification message is sent, including: When the data corresponding to an object node in the balance expression instance is empty, a fault is determined in the subsystem providing the data corresponding to the object node, and a prompt message is sent; or When the value of the data corresponding to an object node in the balance expression instance is not within the preset value range, it is determined that the subsystem providing the data corresponding to the object node is faulty, and a prompt message is sent.

6. The method as described in claim 1, characterized in that, The method further includes: For each instance of a balancing expression, if it is determined that the data on both sides of the equals sign of each instance of a balancing expression is consistent, then the system is considered to be functioning normally, and the business logic corresponding to each balancing expression continues to be executed.

7. A device for detecting system faults, characterized in that, The device specifically includes: The physical model determination module is used to determine the physical models of each database in the system for each subsystem. The physical model of the database is the physical model corresponding to the data table used to store content related to business execution results. Specifically, determining the physical models of each database in the system for each subsystem includes: for each subsystem, when the subsystem starts, loading the object-relational mapping framework of the subsystem, and scanning the database of the subsystem through the loaded object-relational mapping framework to determine the physical models in the database of the subsystem. The object node determination module is used to determine each object node in the object graph based on the acquired physical models. The expression determination module is used to determine a balanced expression composed of object nodes based on the business content corresponding to each object node and the business logic of each business, wherein the business content on both sides of the equal sign of the balanced expression is consistent in business logic. The instance determination module is used to determine the instance of a balance expression based on the changed data and the balance expression when it is determined that the data of the object node in the balance expression has changed in the database for each balance expression. The system fault detection module is used to determine that a system fault exists and send a prompt message if the data on both sides of the equal sign of the instance of the balance expression are inconsistent.

8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 6.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Mapping architecture with incremental view maintenance

    CN101405729A

  • Method and device for realizing ORM (Object Relational Mapping)

    CN107391529A