Fault early warning method and device, equipment, storage medium and computer program product
By generating an error code record table and querying the error code records to be alerted, combined with the alert failure record and task parameters, an alert notification task is generated, which solves the problem of inability to perform personalized alerts in the existing technology and achieves fast and accurate monitoring of the application system. Fault warning and resolution.
Patent Information
- Application Number
- CN202410767991.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-03
AI Technical Summary
In the existing technology, application monitoring and early warning tools or platforms are open to most applications in the enterprise and cannot provide personalized early warning for different businesses, resulting in the inability to quickly and accurately identify and solve specific problems in the application system.
Generate an error code record table based on the error codes output by the application system, query the error code records to be alerted based on the error code occurrence threshold and the alert buffer time, determine the target alert error code based on the alert failure record and the error code to be alerted, and determine the target alert error code based on the alert task Parameters generate early warning notification tasks to achieve early warning of faults.
It realizes personalized fault warning for different businesses, improves the efficiency of fault identification and resolution, ensures that problems are handled in a timely manner in a short time, and reduces the impact on the business.
Smart Images

Figure CN118585409A
Abstract
Description
Technical Field
[0001] The present application relates to the field of fault warning technology, and in particular to a fault warning method, device, equipment, storage medium and computer program product. Background Art
[0002] With the rapid development of the Internet and cloud services, more and more enterprises have implemented cloud applications. Applications are constantly increasing in scale through rapid and agile iterations, and the complexity of the system is also increasing with the expansion of business. As applications become more complete and the number of connected users increases, it is inevitable that some problems that were not covered during the development and testing process will arise. These problems may be some special scenarios of the business, or boundary conditions that were not fully considered during the system analysis, design, development, and testing process. How to quickly warn, accurately locate problems, and provide solutions in a short time is becoming an increasingly urgent problem for current enterprise applications.
[0003] In the context of enterprise applications moving to the cloud, each enterprise has more or less a set of unified monitoring tools or platforms for applications, which can be used to monitor and warn of various application indicators. However, such tool platforms are usually open to most applications within the enterprise, and are more general and universal, and cannot provide personalized warnings for a specific application.
[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a fault warning method, device, equipment, storage medium and computer program product, aiming to solve the technical problem in the prior art that application monitoring and warning tools or platforms are open to most applications within the enterprise, resulting in the inability to provide personalized warnings for different businesses.
[0006] To achieve the above objectives, the present application proposes a fault warning method, which includes:
[0007] generating an error code record table based on an error code output by the application system, wherein the error code is generated based on application information of the application system;
[0008] According to the error code occurrence count threshold and the warning buffer time, query the error code record table to obtain the error code record to be warned;
[0009] Determine a target warning error code based on the warning failure record and the error code record to be warned;
[0010] A warning notification task is generated based on the warning task parameters and the target warning error code, and a fault warning is performed through the warning notification task.
[0011] In one embodiment, the step of generating an error code record table based on the error code output by the application system includes:
[0012] Collect all error codes output by the application system through the preset message queue middleware;
[0013] The error code is consumed by a consumption component in the preset message queue middleware to obtain a processed error code;
[0014] The processed error code is persistently stored in a preset database;
[0015] An error code record table is generated in the preset database based on the processed error code.
[0016] In one embodiment, before the step of determining the target warning error code based on the warning failure record and the error code record to be warned, the step further includes:
[0017] Determine whether the detection switch corresponding to the current fault detection task is in the on state;
[0018] If so, determine whether the current list of warning notification personnel is empty;
[0019] If not, query the historical warning records based on the current time to obtain the warning failure records in the historical warning records.
[0020] In one embodiment, before the step of generating a warning notification task based on the warning task parameters and the target warning error code, and performing a fault warning through the warning notification task, the step further includes:
[0021] Determine a target error code based on the error code properties corresponding to all error codes in the application system, the target error code being an error code corresponding to a service that the application system performs normal verification;
[0022] Generate an error code whitelist based on the target error code;
[0023] Filter the target warning error code according to the error code whitelist to obtain the filtered target warning error code;
[0024] The step of generating a warning notification task based on the warning task parameters and the target warning error code, and performing a fault warning through the warning notification task includes:
[0025] A warning notification task is generated based on the warning task parameters and the filtered target warning error code, and a fault warning is performed through the warning notification task.
[0026] In one embodiment, the warning task parameters include: notification content and notification time; the step of generating the warning notification task based on the warning task parameters includes:
[0027] Determine the warning method corresponding to the current warning task;
[0028] Determine the user to be notified corresponding to the current warning task based on the warning method;
[0029] An early warning notification task is generated based on the user to be notified, the notification content, the notification time, and the early warning method.
[0030] In one embodiment, before the step of generating an error code record table based on the error code output by the application system, the step further includes:
[0031] Classify microservices according to the risk types corresponding to all microservices in the application system to obtain several microservice sets;
[0032] Numbering each microservice set to obtain a first number corresponding to each microservice set;
[0033] Determine error codes corresponding to services of different risk levels in the microservice set based on the application information of the application system, the first number, and the risk level identifier;
[0034] When executing different services, the application system outputs the error code corresponding to each service in real time in an explicit manner.
[0035] In addition, to achieve the above purpose, the present application also proposes a fault warning device, which includes:
[0036] A record table generating module, used to generate an error code record table based on an error code output by an application system, wherein the error code is generated based on application information of the application system;
[0037] A record query module, used to query the error code record table according to the error code occurrence number threshold and the warning buffer time, and obtain the error code record to be warned;
[0038] An error code determination module, used to determine a target warning error code based on the warning failure record and the error code record to be warned;
[0039] The fault warning module is used to generate a warning notification task based on the warning task parameters and the target warning error code, and perform fault warning through the warning notification task.
[0040] In addition, to achieve the above objectives, the present application also proposes a fault warning device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the fault warning method described above.
[0041] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the fault warning method described above are implemented.
[0042] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the fault warning method described above are implemented.
[0043] The present application provides a fault warning method, which discloses generating an error code record table based on an error code output by an application system, wherein the error code is generated based on application information of the application system; querying the error code record table according to an error code occurrence threshold and a warning buffer time to obtain a record of error codes to be warned; determining a target warning error code based on the warning failure record and the record of error codes to be warned; generating a warning notification task based on warning task parameters, and performing a fault warning based on the warning notification task and the target warning error code; since the present invention generates an error code record table based on the error code output by the application system, and performs a fault warning based on the target warning error code determined based on the record of error codes to be warned obtained from the error code record table, the technical problem in the prior art that application monitoring and warning tools or platforms are open to most applications within an enterprise and cannot perform personalized warnings for different businesses is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1 A flowchart of the first embodiment of the fault warning method of the present application is provided;
[0047] Figure 2 This is a functional module diagram of the fault warning method of this application;
[0048] Figure 3 A flowchart of the second embodiment of the fault warning method of the present application is provided;
[0049] Figure 4 This is a flowchart of the timing task in the fault warning method of this application;
[0050] Figure 5 A flowchart of the third embodiment of the fault warning method of the present application is provided;
[0051] Figure 6 This is a schematic diagram of the module structure of the fault warning device according to an embodiment of the present application;
[0052] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the fault warning method in the embodiment of the present application.
[0053] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0054] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0055] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0056] The main solution of the embodiment of the present application is: generate an error code record table based on the error code output by the application system, the error code is generated based on the application information of the application system; query the error code record table according to the error code occurrence threshold and the warning buffer time to obtain the error code record to be warned; determine the target warning error code based on the warning failure record and the error code record to be warned; generate a warning notification task based on the warning task parameters and the target warning error code, and perform fault warning through the warning notification task.
[0057] With the existing technology, in the context of enterprise applications moving to the cloud, each enterprise has more or less a set of unified monitoring tools or platforms for applications, and by using this tool platform, it is possible to monitor and warn of various application indicators. However, this type of tool platform is usually open to most applications within the enterprise, and is more general and universal, and cannot provide personalized warnings for a specific application.
[0058] The present application provides a solution, which generates an error code record table based on the error code output by the application system, and performs fault warning based on the target warning error code determined by the error code record to be warned obtained from the error code record table, thereby solving the technical problem in the prior art that application monitoring and warning tools or platforms are open to most applications within the enterprise, resulting in the inability to perform personalized warnings for different businesses.
[0059] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a fault warning device, etc. The following takes the fault warning device as an example (hereinafter referred to as the device) to illustrate this embodiment and the following embodiments.
[0060] Based on this, the present application embodiment provides a fault warning method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the fault warning method of the present application.
[0061] In this embodiment, the fault warning method includes steps S10 to S40:
[0062] Step S10: Generate an error code record table based on the error code output by the application system, wherein the error code is generated based on application information of the application system.
[0063] It should be noted that the above-mentioned application system may be a system corresponding to various business applications deployed by an enterprise in the cloud, and this embodiment does not limit the business type corresponding to the application system.
[0064] It should be noted that the above error code can be an identifier for locating abnormal problems occurring in the application system. Accordingly, the above error code record table can be a table storing all error codes output by the application system. In this embodiment, the error code can be used as an important sign of abnormality in the application system due to its global uniqueness and accuracy in the microservice. Therefore, system developers can quickly locate abnormal problems through error codes, conduct timely inspections, and avoid additional risks.
[0065] It should be understood that the above application information may be identification information of the application system. The application information in this embodiment may include but is not limited to the identification and abbreviation of the application system. In this embodiment, a unified error code rule may be formulated in advance, and different error code identifications may be set for different applications to ensure that the error code is globally unique in each application system. Therefore, in this embodiment, the corresponding error code may be set for the application system according to its identification information.
[0066] Furthermore, the step S10 includes: collecting all error codes output by the application system through the preset message queue middleware; consuming the error codes through the consumption component in the preset message queue middleware to obtain processed error codes; persistently storing the processed error codes in a preset database; and generating an error code record table in the preset database based on the processed error codes.
[0067] It can be understood that the above-mentioned preset message queue middleware can be a container for storing error codes output by the application system, and the preset message queue middleware in this embodiment can be Kafka message queue middleware. Kafka is a high-throughput distributed publish-subscribe message system, which can be used to process information transmission between producers and consumers. For example, in this embodiment, Kafka can be used to collect logs of various services in the application system, so as to obtain all error codes output by the application system.
[0068] It should be understood that the above-mentioned preset database may be a database for storing error codes output by the application system.
[0069] In a specific implementation, the device can be connected to a unified log platform corresponding to the application system, which provides Kafka message queue middleware, and all error codes thrown by the application system are uniformly processed by the Kafka message queue middleware and then consumed by the consumer component of the present invention, thereby obtaining the processed error code, wherein the above-mentioned consumer component can be a component for reading and processing messages from the Kafka message queue middleware. Then, the device can collect all processed error codes and store them persistently in a preset database. At the same time, an error code record table can also be generated based on all processed error codes stored in the preset database for subsequent early warning and scanning.
[0070] Step S20: query the error code record table according to the error code occurrence count threshold and the warning buffer time to obtain the error code record to be warned.
[0071] It should be noted that the error code occurrence threshold may be the maximum frequency of the error code occurrence scanned by the error code scanning module in the device. For example, in this embodiment, the error code occurrence threshold may be set to 100 times. Correspondingly, the warning buffer time may be the buffer time for the error code scanning module to scan the error code. For example, in this embodiment, the warning buffer time may be set to 0.1s.
[0072] It should be noted that the above-mentioned error code record to be warned may be an error code record in the error code record table that requires a warning.
[0073] In actual applications, the device can use the error code occurrence threshold and warning buffer time as query conditions to query the error code record table. The query result is the newly generated error code set that needs to be warned, that is, the above-mentioned error code record to be warned.
[0074] Step S30: determining a target warning error code based on the warning failure record and the error code record to be warned.
[0075] It should be understood that the above-mentioned warning failure record may be a record corresponding to the error code of the previous warning failure.
[0076] It should be noted that the target warning error code may be an error code obtained by merging the error code that failed to warn previously and the newly generated error code to be warned, and excluding the error code that has been successfully warned before a specified time.
[0077] In this embodiment, all error codes that failed to warn before can be determined based on the warning failure record, and all error codes that failed to warn before can be merged with the newly generated error code to be warned, to obtain a merged error code record, and then, according to needs, exclude the error codes that have been successfully warned before the specified time from the merged error code record. At this time, the target warning error code can be obtained, thereby preventing the error code that has been successfully warned from being warned repeatedly.
[0078] Step S40: Generate a warning notification task based on the warning task parameters and the target warning error code, and perform fault warning through the warning notification task.
[0079] It should be noted that the above-mentioned warning task parameters may be parameter information such as the notifier, notification content, and notification time corresponding to this warning notification task. Among them, the above-mentioned warning notification task may be a task for realizing fault warning. In this embodiment, the device may first determine the warning task parameters such as the notifier, notification content, and notification time corresponding to this warning notification task, and assemble these warning task parameters to generate the corresponding warning notification task, and then the target warning error code may be added to the notification content, and the notification method corresponding to the warning notification task may be sent to the corresponding notifier at the corresponding notification time to realize fault warning.
[0080] It should be understood that in this solution, by scanning the error codes thrown by the application system and informing the system developers of the error code information in the form of text messages, phone calls, etc. according to the specific scenarios and pre-flexibly configured error code warning trigger conditions, the system developers can be informed of the error code information at the first time and promptly troubleshoot and locate the problem, thereby reducing or even avoiding risks in a timely manner and ensuring that the impact of the problem on the business is minimized.
[0081] In the specific implementation, refer to Figure 2 , Figure 2 This is a functional module diagram of the fault warning method of this application. Figure 2 As shown, in this embodiment, the device can be provided with an error code collection module, an error code scanning module and an early warning task generation and parameterized configuration module, wherein the error code collection module can consume the error codes in the log platform through the components in the Kafka message queue middleware to collect the error codes, and store them persistently in the error code record table for scanning and standby; the error code scanning module scans the historical early warning records and error code records by generating a scheduled early warning notification task to generate a new early warning record, that is, to obtain the error code record to be warned. Then the device can merge and deduplicate the error code records of the failed early warning and the error code records to be warned according to the needs, obtain the target early warning error code, and configure the early warning parameters according to the needs through the early warning task generation and parameterized configuration module, so as to generate the corresponding early warning notification task based on the early warning parameters and the target early warning error code, so as to send the early warning message for fault warning.
[0082] The present embodiment provides a fault warning method, which discloses generating an error code record table based on an error code output by an application system, wherein the error code is generated based on application information of the application system; querying the error code record table according to an error code occurrence threshold and a warning buffer time to obtain a record of error codes to be warned; determining a target warning error code based on the warning failure record and the record of error codes to be warned; generating a warning notification task based on warning task parameters, and performing a fault warning based on the warning notification task and the target warning error code; since the present embodiment generates an error code record table based on the error code output by the application system, a fault warning is performed based on a target warning error code determined based on the record of error codes to be warned obtained from the error code record table, thereby solving the technical problem in the prior art that application monitoring and warning tools or platforms are open to most applications within an enterprise, resulting in the inability to perform personalized warnings for different businesses.
[0083] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , Figure 3 A flow chart of the second embodiment of the fault warning method of the present application is provided.
[0084] In this embodiment, before step S30, the fault warning method further includes steps S301 to S303:
[0085] Step S301: determine whether the detection switch corresponding to the current fault detection task is in an on state.
[0086] It should be understood that the above detection switch can be a global switch corresponding to the current fault detection task, wherein the detection switch can have two states: on and off. In this embodiment, if the detection switch is in the on state, the task can be executed at this time; if the detection switch is in the off state, the task is directly exited at this time, thereby preventing component abnormalities from causing task errors.
[0087] Step S302: If yes, determine whether the current list of warning notification personnel is empty.
[0088] It should be noted that the above-mentioned current warning notification personnel list can be a list of personnel corresponding to the personnel to be notified for this fault warning. The current warning notification personnel list in this embodiment can be configured by day and person, and multiple notification personnel can be configured on the same day, which is not limited in this embodiment.
[0089] Step S303: If not, query the historical warning records based on the current time to obtain the warning failure records in the historical warning records.
[0090] It should be understood that the above-mentioned historical warning records can be warning records corresponding to all error codes before the current moment. In addition, the historical warning records in this embodiment can also be warning records corresponding to all error codes before any specified time, and this embodiment does not impose any restrictions on this.
[0091] It can be understood that the above-mentioned warning failure record can be a record corresponding to the error codes of all warning failures.
[0092] In actual applications, the device can first determine whether the detection switch of the current fault detection task is in the on state. If so, it continues to execute the task. Then it can determine whether the current warning notification personnel list is empty. If it is not empty, it continues to query all warning records before the specified time, and filter out failed warning records from historical warning records to obtain warning failure records, so that the error code of the warning failure can be re-warned later, thereby avoiding single warning failure due to special reasons such as network or system failure, thereby improving the accuracy of fault warning.
[0093] Furthermore, before step S40, the method further includes:
[0094] Step S401: determining a target error code based on error code properties corresponding to all error codes in the application system, wherein the target error code is an error code corresponding to a service that the application system performs normal verification on.
[0095] It should be noted that the above-mentioned error code properties may be properties used to evaluate whether the error code is a normal check or a fault in the application system.
[0096] It can be understood that the above target error code can be an error code corresponding to the business that the application system performs normal verification.
[0097] In this embodiment, all error codes can be classified according to the properties corresponding to each error code in the application system to determine the target error code of the business that performs normal verification in the application system and the error code that indicates an abnormality or failure in the application system.
[0098] Step S402: Generate an error code whitelist based on the target error code.
[0099] It should be noted that the above error code whitelist is a list consisting of all error codes that are normally checked in the application system.
[0100] Step S403: Filter the target warning error code according to the error code whitelist to obtain the filtered target warning error code.
[0101] It should be understood that the above-mentioned filtered target early warning error code may be an error code obtained by filtering the target error code in the error code whitelist from the target early warning error code.
[0102] Accordingly, the step S40 includes:
[0103] Step S40': generating an early warning notification task based on the early warning task parameters and the filtered target early warning error code, and performing fault early warning through the early warning notification task.
[0104] In this embodiment, the device can pre-set an error code whitelist, and add all target error codes in the application system (such as the content and format of file uploads, etc.) to the error code whitelist, and can set the start time and end time to be ignored, so that the target warning error code can be filtered based on the error code whitelist later to achieve fault warning for the filtered target warning error code, thereby improving the efficiency of fault warning.
[0105] Furthermore, the warning task parameters include: notification content and notification time; the step of generating a warning notification task based on the warning task parameters includes: determining the warning method corresponding to the current warning task; determining the user to be notified corresponding to the current warning task based on the warning method; generating a warning notification task based on the user to be notified, the notification content, the notification time and the warning method.
[0106] It should be understood that the above notification content is the content of notifying the user of the fault; the notification time may be the time when the user is notified of the fault.
[0107] It is understandable that the above-mentioned warning method can be a method used to notify the user of the existence of a fault, such as a telephone notification method, a text message notification method, an APP message notification, etc., and this embodiment does not limit this.
[0108] It should be noted that, as enterprise application functions continue to enrich and system logic becomes increasingly complex, this solution can inform application managers and developers through various means such as phone calls, text messages, and APP messages, quickly and accurately locate system problems based on the error code rules established in the early stage, and provide solutions in a timely manner to ensure that the business is not affected or blocked and losses are avoided. In addition, this solution can also configure warning trigger conditions and parameters on demand, and can filter out error codes that do not require warnings through whitelists, solving the pain point that the enterprise's general monitoring tool platform cannot configure warning trigger conditions and parameters on demand.
[0109] In this embodiment, a variety of warning methods can be provided, including telephone notification, SMS notification, APP message notification and other methods. Among them, telephone notification can set parameters such as notification content, dialing time, number of replays, replay time interval, called person list, etc.; SMS notification can set parameters such as SMS content, sender list, etc.; APP message notification can set parameters such as message notification content, sender list, etc. Each time before generating a notification task, various parameters need to be assembled. For example, for the content of telephone notification, the corresponding description can be: if no call is made, it can be empty, otherwise it must be transmitted; for the content of SMS notification, the corresponding description can be: if it is empty, no SMS will be sent; for the content of APP notification, the corresponding description can be: if it is empty, no message will be sent, etc.
[0110] In the specific implementation, refer to Figure 4 , Figure 4 This is a flow chart of the timing task in the fault warning method of this application. This solution can achieve fault warning through the timing task. The flow of the timing task is as follows Figure 4As shown, first, it is possible to determine whether the global switch of the current fault detection task is turned on. If it is turned on, the task will continue to be executed, otherwise the task will be exited directly. If the global switch is in the on state, it is determined whether the current list of early warning notification personnel is empty. If it is not empty, the task will continue to be executed, otherwise the task will be exited directly. If the current list of early warning notification personnel is not empty, all early warning records before the specified time are queried to obtain the early warning failure records in the historical early warning records, and then the error code occurrence threshold and the early warning buffer time can be used as query conditions to query in the error code record table to obtain the latest error code record, that is, the error code record to be warned. After that, the warning failure records and the error code records to be warned can be merged, and the records that have been successfully warned before the specified time can be excluded to obtain the target warning error code to prevent the error code that has been successfully warned from being warned repeatedly. Then, the target warning error code can be filtered according to the error code whitelist to obtain a set of filtered target warning error codes, and it is determined whether the set is empty. If it is empty, it means that there are no existing failed warning records or new error code warnings, and the task is exited directly; if it is not empty, the remaining filtered target warning error codes in the set can be used as the final error code of this warning. Finally, the various task parameters required for this warning can be assembled, the warning method can be selected, etc., the final error code set information can be added to the notification content, the warning notification task can be generated, and the fault warning can be performed through the warning notification task.
[0111] In this embodiment, it is disclosed to determine whether the detection switch corresponding to the current fault detection task is in the on state; if so, it is determined whether the current warning notification personnel list is empty; if not, the historical warning records are queried based on the current moment to obtain the warning failure records in the historical warning records, thereby avoiding single warning failures due to special reasons such as network or system failures, thereby improving the accuracy of fault warnings.
[0112] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be described in detail later. Figure 5 , Figure 5 A flowchart of the third embodiment of the fault warning method of the present application is provided.
[0113] In this embodiment, before step S10, the fault warning method further includes steps S01 to S03:
[0114] Step S01: Classify the microservices according to the risk types corresponding to all microservices in the application system to obtain several microservice sets.
[0115] It should be noted that the above risk types are risk types of businesses in microservices. The risk types in this embodiment may include but are not limited to system errors and business errors.
[0116] It should be understood that the above-mentioned microservice set may be a set consisting of microservices of the same risk type.
[0117] Step S02: number each microservice set to obtain a first number corresponding to each microservice set.
[0118] It should be understood that the above-mentioned first number can be the number corresponding to the microservices of different risk types. For example, for the risk type of system errors, it can be numbered as "S"; for the risk type of business errors, it can be numbered as "B", but this embodiment is not limited to this.
[0119] Step S03: Determine error codes corresponding to services of different risk levels in the microservice set based on the application information of the application system, the first number and the risk level identifier.
[0120] When executing different services, the application system outputs the error code corresponding to each service in real time in an explicit manner.
[0121] It should be noted that the above risk level identifier can be an identifier used to indicate the risk level of a fault, which can be represented by a number, and the smaller the number, the higher the level. For example, level 3 can represent normal business class verification, etc.; level 2 can represent illegal parameters, illegal operations, etc.; level 1 can represent business process errors, interface timeouts, third-party call exceptions, json conversion, etc., and this embodiment does not limit this.
[0122] In a specific implementation, the device can specify a unified error code rule, set different error code identifiers for different applications, and ensure that the error code in each application is globally unique. In this embodiment, the error code length can be set to 11 bits to clearly display the error category and risk level. The specific error code rule can be: 3-digit system abbreviation + 1-digit risk type + 1-digit risk level + 1-digit microservice abbreviation + 4-digit number (starting from 0000 to 9999). Specifically, the device can first classify all microservices in the application system into microservices with system errors and microservices with business errors, and number the microservices with system errors as "S" and the risk type of business errors as "B". Then, the abbreviation of the application system can be obtained according to the application information of the application system, and the corresponding error code can be composed based on the abbreviation of the application system, the number of the microservice and the risk level identifier. For example: a system is abbreviated as NPM, and it has a microservice abbreviated as System, and its system-class level 3 error code number is agreed to be NPMS3S0000; there is a microservice abbreviated as Approval, and its business-class level 2 error code number is agreed to be NPMB2A0001. In addition, in applications, error codes need to be explicitly thrown in places such as parameter verification, business verification, and exception capture to ensure that error codes can be fully collected.
[0123] In this embodiment, it is disclosed that microservices are classified according to the risk types corresponding to all microservices in the application system to obtain several microservice sets; each microservice set is numbered to obtain a first number corresponding to each microservice set; based on the application information of the application system, the first number and the risk level identifier, the error code corresponding to the business of different risk levels in the microservice set is determined, so that different error code identifiers can be set for different applications to ensure that the error code in each application is globally unique.
[0124] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the fault warning method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0125] This application also provides a fault warning device, please refer to Figure 6 , the fault warning device comprises:
[0126] A record table generating module 10, configured to generate an error code record table based on an error code output by an application system, wherein the error code is generated based on application information of the application system;
[0127] A record query module 20, used to query the error code record table according to the error code occurrence number threshold and the warning buffer time, and obtain the error code record to be warned;
[0128] An error code determination module 30, configured to determine a target warning error code based on the warning failure record and the error code record to be warned;
[0129] The fault warning module 40 is used to generate a warning notification task based on the warning task parameters and the target warning error code, and perform a fault warning through the warning notification task.
[0130] The fault warning device provided by the present application adopts the fault warning method in the above embodiment, which can solve the technical problem that the application monitoring warning tool or platform in the prior art is open to most applications within the enterprise, resulting in the inability to provide personalized warnings for different businesses. Compared with the prior art, the beneficial effects of the fault warning device provided by the present application are the same as the beneficial effects of the fault warning method provided by the above embodiment, and the other technical features in the fault warning device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0131] The present application provides a fault warning device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the fault warning method in the above-mentioned embodiment one.
[0132] Reference below Figure 7 , which shows a schematic diagram of the structure of a fault warning device suitable for implementing the embodiment of the present application. The fault warning device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The fault warning device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0133] like Figure 7As shown, the fault warning device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the fault warning device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the fault warning device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a fault warning device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0134] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0135] The fault warning device provided by the present application adopts the fault warning method in the above embodiment to solve the technical problem of fault warning. Compared with the prior art, the beneficial effects of the fault warning device provided by the present application are the same as the beneficial effects of the fault warning method provided by the above embodiment, and the other technical features in the fault warning device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0136] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0137] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0138] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the fault warning method in the above-mentioned embodiment.
[0139] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0140] The computer-readable storage medium may be included in the fault warning device; or may exist independently without being assembled into the fault warning device.
[0141] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the fault warning device, the fault warning device: generates an error code record table based on the error code output by the application system, and the error code is generated based on the application information of the application system; queries the error code record table according to the error code occurrence threshold and the warning buffer time to obtain the error code record to be warned; determines the target warning error code based on the warning failure record and the error code record to be warned; generates a warning notification task based on the warning task parameters and the target warning error code, and performs fault warning through the warning notification task.
[0142] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0143] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0144] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0145] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned fault warning method, and can solve the technical problem that the application monitoring and early warning tools or platforms in the prior art are open to most applications within the enterprise, resulting in the inability to provide personalized early warnings for different businesses. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the fault warning method provided by the above-mentioned embodiment, and will not be repeated here.
[0146] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned fault warning method when executed by a processor.
[0147] The computer program product provided by the present application can solve the technical problem that the application monitoring and early warning tools or platforms in the prior art are open to most applications within the enterprise, resulting in the inability to provide personalized early warnings for different businesses. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the fault early warning method provided by the above embodiment, and will not be elaborated here.
[0148] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A fault warning method, characterized in that: The method includes: generating an error code record table based on an error code output by the application system, wherein the error code is generated based on application information of the application system; According to the error code occurrence count threshold and the warning buffer time, query the error code record table to obtain the error code record to be warned; Determine a target warning error code based on the warning failure record and the error code record to be warned; A warning notification task is generated based on the warning task parameters and the target warning error code, and a fault warning is performed through the warning notification task.
2. The method according to claim 1, characterized in that The step of generating an error code record table based on the error code output by the application system comprises: Collect all error codes output by the application system through the preset message queue middleware; The error code is consumed by a consumption component in the preset message queue middleware to obtain a processed error code; The processed error code is persistently stored in a preset database; An error code record table is generated in the preset database based on the processed error code.
3. The method according to claim 1, characterized in that Before the step of determining the target warning error code based on the warning failure record and the error code record to be warned, the method further includes: Determine whether the detection switch corresponding to the current fault detection task is in the on state; If so, determine whether the current list of warning notification personnel is empty; If not, query the historical warning records based on the current time to obtain the warning failure records in the historical warning records.
4. The method according to claim 3, characterized in that Before the step of generating a warning notification task based on the warning task parameters and the target warning error code, and performing a fault warning through the warning notification task, the method further includes: Determine a target error code based on the error code properties corresponding to all error codes in the application system, the target error code being an error code corresponding to a service that the application system performs normal verification; Generate an error code whitelist based on the target error code; Filter the target warning error code according to the error code whitelist to obtain the filtered target warning error code; The step of generating a warning notification task based on the warning task parameters and the target warning error code, and performing a fault warning through the warning notification task includes: A warning notification task is generated based on the warning task parameters and the filtered target warning error code, and a fault warning is performed through the warning notification task.
5. The method according to any one of claims 1 to 4, characterized in that The warning task parameters include: notification content and notification time; the step of generating the warning notification task based on the warning task parameters includes: Determine the warning method corresponding to the current warning task; Determine the user to be notified corresponding to the current warning task based on the warning method; An early warning notification task is generated based on the user to be notified, the notification content, the notification time, and the early warning method.
6. The method according to any one of claims 1 to 4, characterized in that Before the step of generating an error code record table based on the error code output by the application system, the method further includes: Classify microservices according to the risk types corresponding to all microservices in the application system to obtain several microservice sets; Numbering each microservice set to obtain a first number corresponding to each microservice set; Determine error codes corresponding to services of different risk levels in the microservice set based on the application information of the application system, the first number, and the risk level identifier; When executing different services, the application system outputs the error code corresponding to each service in real time in an explicit manner.
7. A fault warning device, characterized in that: The device comprises: A record table generating module, used to generate an error code record table based on an error code output by an application system, wherein the error code is generated based on application information of the application system; A record query module, used to query the error code record table according to the error code occurrence number threshold and the warning buffer time, and obtain the error code record to be warned; An error code determination module, used to determine a target warning error code based on the warning failure record and the error code record to be warned; The fault warning module is used to generate a warning notification task based on the warning task parameters and the target warning error code, and perform fault warning through the warning notification task.
8. A fault warning device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the fault warning method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the fault warning method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the fault warning method according to any one of claims 1 to 6 are implemented.
