A unified alarm method, system and device based on multiple microservice scenarios
By generating preset instructions and calling corresponding components to process microservice operation data, the problem of difficulty in integrating alarm information among multiple microservices is solved, and the unified management and processing of alarm information is realized, and the stability and maintenance efficiency of the system are improved.
Patent Information
- Application Number
- CN202310206325.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-03
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2043-03-03
AI Technical Summary
In multiple microservice scenarios, the alarm service cannot integrate, count and process the alarm information, making it difficult for maintenance personnel to effectively manage and handle abnormal situations in the system.
By triggering the component to generate preset instructions, calling the input component to obtain the operation data of the microservice, the data processing component processes and analyzes the monitoring data, and if the preset conditions are met, an alarm information will be generated, and the alarm notification component will output alarm information to realize the alarm information Unified management and processing.
It realizes the unified collection and processing of alarm information among multiple microservices, avoids the difficulty of integrating alarm information, and improves the response efficiency and system stability of maintenance personnel.
Smart Images

Figure CN116192611B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a unified alarm method, system and device based on multiple microservice scenarios. Background Art
[0002] With the development of network technology, the businesses in Internet systems and even Internet of Things systems are becoming more and more complex. In order to provide better services for different businesses, building service systems for specific businesses through microservices has become a common way of building services in Internet systems.
[0003] In the process of using microservices to build services, each specific business will build a sub-service system through microservices, so that the service system or application can provide multiple business functions. However, each microservice will generate various indicators, logs, links and other information during operation, which requires maintenance personnel to monitor in order to maintain the normal and safe operation of the system. By adding an alarm function to the monitoring unit of the service system, the frequency of maintenance personnel checking the monitoring results can be effectively reduced, and maintenance personnel can be reminded of problems in the system in a timely manner.
[0004] However, due to the large number of microservices in a service system and their different business functions, in some scenarios, the alarm service usually monitors the parameters corresponding to different business functions in the service system separately, and issues an alarm when the parameters are abnormal so that maintenance personnel can handle them. However, the alarm service only lists the alarm information and reminds the maintenance personnel, and does not integrate, count, or process the generated alarm information. How to integrate the alarms generated by the monitoring content corresponding to different business functions has become an urgent problem to be solved. Summary of the invention
[0005] The present application provides a unified alarm method, system and device based on multiple microservice scenarios to solve the problem that the alarm service cannot integrate, count and process alarm information during the monitoring process between multiple business functions.
[0006] According to a first aspect of an embodiment of the present invention, a unified alarm method based on multiple microservice scenarios is provided, including: based on a preset instruction generated by a trigger component, calling an input component to obtain operation data of a microservice corresponding to the preset instruction; the microservice is used to form at least one service system or application; calling a data processing component to process the operation data to obtain monitoring data of the microservice; calling an alarm generation component to analyze the monitoring data, and if the monitoring data includes an alarm trigger parameter, obtaining the number of triggering times of an alarm task corresponding to the alarm trigger parameter; if the number of triggering times of the alarm task meets a preset condition, calling the alarm generation component to generate alarm information according to the alarm task; calling an alarm notification component to output the alarm information according to the microservice corresponding to the monitoring data that triggers the alarm task.
[0007] In an optional manner, the method further includes: comparing the triggering times of the alarm task with a preset number; if the triggering times of the alarm task is less than or equal to the preset number, determining that the triggering times of the alarm task meets the preset condition.
[0008] In an optional manner, the alarm task also includes an alarm level, and the method also includes: if the number of times the alarm task is triggered does not meet the preset condition, calling the alarm generation component to obtain the first time when the alarm task corresponding to the alarm trigger parameter was last triggered and generated alarm information; if the duration between the first time and the current time is greater than a first preset duration, increasing the alarm level corresponding to the alarm task; calling the alarm generation component to generate alarm information based on the alarm task after the alarm level is increased.
[0009] In an optional manner, the alarm information includes alarm prompt information and an alarm prompt mode, and the step of generating the alarm information according to the alarm task includes: calling the alarm generation component to generate the alarm prompt information according to the alarm trigger parameter; calling the alarm generation component to determine the alarm prompt mode according to the alarm level corresponding to the alarm task;
[0010] The calling of the alarm notification component to output the alarm information according to the microservice corresponding to the monitoring data that triggers the alarm task includes: calling the alarm notification component corresponding to the alarm prompt method to output the alarm prompt information according to the alarm prompt method and the microservice.
[0011] In an optional manner, the alarm notification component is called to output the alarm information according to the microservice corresponding to the monitoring data that triggers the alarm task, including: obtaining all the alarm information generated within a second preset time period; calling the alarm notification component to output the alarm information with the same alarm level together.
[0012] In an optional manner, before calling the input component to obtain the running data of the microservice corresponding to the preset instruction, the method also includes: obtaining alarm configuration information in response to an alarm creation instruction input by a user; and creating the alarm task according to the alarm configuration information.
[0013] In an optional manner, before calling the input component to obtain the running data of the microservice corresponding to the preset instruction, the method also includes: obtaining the running time of the microservice, and if the running time is greater than or equal to a third preset duration, calling the trigger component to generate the preset instruction; or, monitoring the running process of the microservice, and if the running process reaches a preset node, calling the trigger component to generate the preset instruction.
[0014] In an optional manner, after generating alarm information according to the alarm task, the method further includes: generating an alarm process record according to the alarm information; and storing the alarm process record.
[0015] According to a second aspect of an embodiment of the present invention, a unified alarm system based on multiple microservice scenarios is provided, including: a trigger component, used to generate preset instructions according to alarm data acquisition conditions; an input component, used to obtain operation data of the microservice corresponding to the preset instructions; a data processing component, used to process the operation data to obtain monitoring data of the microservice; an alarm generation component, used to analyze the monitoring data, if the monitoring data includes an alarm trigger condition, then obtain the triggering number of the alarm task corresponding to the alarm trigger parameter; and if the triggering number of the alarm task meets the preset condition, generate alarm information according to the alarm task; an alarm notification component, used to output the alarm information.
[0016] According to a third aspect of an embodiment of the present invention, a unified alarm device based on multiple microservice scenarios is provided, including: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform any operation of the unified alarm method based on multiple microservice scenarios as described above.
[0017] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein at least one executable instruction is stored in the storage medium. When the executable instruction is executed on a unified alarm system / device, the unified alarm system / device performs operations such as any one of the aforementioned unified alarm discovery methods based on multiple microservice scenarios.
[0018] The embodiment of the present invention provides a unified alarm method, system and device based on multiple microservice scenarios, the method comprising: first, based on the preset instruction generated by the trigger component, calling the input component to obtain the operation data of the microservice corresponding to the preset instruction, calling the data processing component to process the operation data to obtain the monitoring data of the microservice, calling the alarm generation component to analyze the monitoring data, and if the preset conditions are met, generating alarm information according to the alarm task, and finally calling the alarm notification component to output the alarm information. By applying the technical solution of the present invention, when it is necessary to monitor multiple microservices, the operation data of multiple microservices can be collected and unified alarm management can be performed, avoiding the difficulty of integrating alarm information caused by factors such as interaction between multiple microservices, and facilitating the statistics and processing of alarm information between multiple microservices.
[0019] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] Figure 1 This is a flowchart of a unified alarm method based on multiple microservice scenarios in an embodiment of the present application;
[0022] Figure 2 This is a flowchart of another unified alarm method based on multiple microservice scenarios in an embodiment of the present application;
[0023] Figure 3 This is a flowchart of another unified alarm method based on multiple microservice scenarios in an embodiment of the present application;
[0024] Figure 4 This is a flowchart of another unified alarm method based on multiple microservice scenarios in an embodiment of the present application;
[0025] Figure 5This is a flowchart of another unified alarm method based on multiple microservice scenarios in an embodiment of the present application;
[0026] Figure 6 This is a flowchart of another unified alarm method based on multiple microservice scenarios in an embodiment of the present application;
[0027] Figure 7 A schematic diagram of the structure of a unified alarm system based on multiple microservice scenarios provided by an embodiment of the present invention;
[0028] Figure 8 A schematic diagram of the structure of a unified alarm device based on multiple microservice scenarios provided by an embodiment of the present invention;
[0029] Fig. 9 A schematic diagram of the structure of another unified alarm system based on multiple microservice scenarios provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The following embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following embodiments do not represent all implementations consistent with the present application. They are only examples of systems and methods consistent with some aspects of the present application as detailed in the claims.
[0031] With the development of network technology, the services in Internet systems and even IoT systems are becoming more and more complex. In order to provide better services for different services, building service systems for specific services through microservices has become a common way to build services in Internet systems. In the process of building services using microservices, each specific business will build a sub-service system through microservices, so that the service system or application can provide multiple business functions.
[0032] Each microservice will generate various indicators, logs, links and other information when running, which requires maintenance personnel to monitor in order to maintain the normal and safe operation of the system. By adding an alarm function to the monitoring unit of the service system, the frequency of maintenance personnel checking the monitoring results can be effectively reduced, and maintenance personnel can be reminded of problems in the system in a timely manner.
[0033] However, due to the large number of microservices in a service system and their different business functions, in some scenarios, the alarm service usually monitors the parameters corresponding to different business functions in the service system separately, and issues an alarm when the parameters are abnormal so that maintenance personnel can handle them. However, the alarm service only lists the alarm information and reminds the maintenance personnel, and does not integrate, count, or process the generated alarm information. How to integrate the alarms generated by the monitoring content corresponding to different business functions has become an urgent problem to be solved.
[0034] To solve the above problems, the present application discloses a unified alarm method, system and device based on multiple microservice scenarios. By obtaining the operating data of each microservice, calling the corresponding components to process it and generate alarm information, and finally realizing the output of the alarm information, an alarm system can simultaneously provide unified alarm services for multiple microservices that can be combined into at least one service system.
[0035] The unified alarm method disclosed in the embodiment of the present invention is exemplarily described below.
[0036] Figure 1 A flowchart of a unified alarm method based on multiple microservice scenarios in an embodiment of the present application is shown. Figure 1 As shown, the method includes:
[0037] S110: Based on the preset instruction generated by the trigger component, call the input component to obtain the operation data of the microservice corresponding to the preset instruction.
[0038] Among them, the trigger component can generate preset instructions according to the alarm data acquisition conditions, and the alarm data acquisition conditions are conditions that limit the alarm system to collect microservice operation data. Only when the alarm data acquisition conditions are met, the trigger component will generate preset instructions, and the preset instructions can enable the alarm system to call the input component to obtain the operation data of the microservice corresponding to the preset instructions. The alarm data acquisition conditions can be one or more of time conditions, data conditions or pipeline conditions.
[0039] Exemplarily, the alarm data acquisition condition may be to obtain the operation data of the microservice once at a certain interval, for example, by obtaining the operation time of the microservice, to avoid the alarm of the microservice due to long-term operation. When the operation time is greater than or equal to the third preset time, the trigger component is called to generate a preset instruction. For example, when the third preset time is five minutes, the trigger component will generate a preset instruction every five minutes. The above is only a feasible implementation method of the third preset time, and the specific value of the third preset time is not limited in this application.
[0040] In some embodiments, pipeline conditions may be used, that is, the running process of the microservice is monitored, and when the running process reaches a preset node, the trigger component is called to generate a preset instruction. For another example, data conditions may be used, that is, after the trigger component monitors the presence of certain data in the microservice, a preset instruction is generated to enable the system to collect subsequent running data.
[0041] It should be understood that multiple microservices can be used to form at least one service system or application. In the actual monitoring process, there is a service system that only includes one microservice, so it is also possible to obtain only the operating data of one microservice, thereby providing an alarm service for a single microservice. However, since this case does not involve the statistics and processing of alarms between multiple microservices, in the embodiments of the present application, the method is still applied to the scenario of providing alarm services for multiple microservices.
[0042] S120: Calling a data processing component to process the operation data to obtain monitoring data of the microservice.
[0043] After obtaining the operation data, it is necessary to call the data processing component to process the operation data to obtain the detection data of different microservices, so that the different data obtained from the microservices can be identified, making the subsequently generated alarm information easier to count.
[0044] In some embodiments of the present application, data processing includes at least one of data cleaning, data filtering, and data visualization. Data cleaning mainly involves deleting duplicate values, supplementing missing values, performing consistency processing, and data arrangement on the collected data; data filtering mainly involves deleting interference information in the collected data; and visualization processing involves quantifying the collected data into a file that can be read by the user to avoid the user being unable to understand it.
[0045] After the above processing is performed on the operation data, the monitoring data corresponding to the microservice can be obtained.
[0046] It should be noted that in the process of processing the operation data, all the operation data need to be processed to obtain complete monitoring data. Therefore, after the processing is completed, it is necessary to monitor the processing completion of the operation data. Only when all the operation data are processed, will the monitoring data be compared with the alarm task. If there is unprocessed operation data, the operation data will be processed until all the operation data are processed to obtain complete monitoring data.
[0047] S130: calling the alarm generation component to analyze the monitoring data, and if the monitoring data includes an alarm trigger parameter, obtaining the triggering times of the alarm task corresponding to the alarm trigger parameter.
[0048] The alarm system calls the alarm generation component to analyze the monitoring data and determine whether the monitoring data includes alarm trigger parameters. It should be noted that if data conditions are used in S110 to determine whether it is necessary to collect operation data, it is not necessary to determine whether the monitoring data includes alarm trigger parameters, and directly obtain the triggering number of the alarm task corresponding to the alarm trigger parameters.
[0049] The number of alarms can be limited according to the alarm frequency, so as to avoid the frequent generation of the same alarm affecting the judgment of maintenance personnel.
[0050] S140: If the triggering times of the alarm task meet the preset conditions, the alarm generation component is called to generate alarm information according to the alarm task.
[0051] When the number of triggers meets the preset conditions, the corresponding alarm information is generated according to the alarm task. Specifically, the alarm information should at least include the name of the microservice where the exception occurs, the name or category of the exception, the system location where the exception occurs, etc., so as to remind the maintenance personnel to handle it.
[0052] S150: Calling the alarm notification component to output alarm information according to the microservice corresponding to the monitoring data that triggers the alarm task.
[0053] After the alarm information is generated, it is also necessary to remind the maintenance personnel to maintain the microservice, so it is necessary to call the alarm notification component to output the alarm information to the maintenance personnel. It should be noted that the output method is generally implemented through a wireless connection, such as output through email, SMS or phone.
[0054] Through the above technical solution, the operation data generated by different microservices can be processed, and the alarm information generated by different microservices can be summarized and counted, so as to realize unified alarm service for different microservices.
[0055] Figure 2 FIG. 1 is a flowchart showing another unified alarm method based on multiple microservice scenarios in an embodiment of the present application. Figure 2 As shown, the method also includes:
[0056] S210: Acquire alarm configuration information in response to an alarm creation instruction input by a user.
[0057] It should be understood that the alarm creation instruction and the alarm configuration information are both information input by the user. Exemplarily, the alarm configuration information can be a text file, and the user imports the text file with the alarm configuration information into the alarm system, and then sends the alarm creation instruction to the system, so that the system generates the corresponding alarm task.
[0058] The alarm configuration information should include the alarm number, the microservice to which the alarm belongs, the data characteristics when the alarm is generated, the triggering conditions of the alarm, the alarm level and other information.
[0059] S220: Create an alarm task according to the alarm configuration information.
[0060] Based on the information included in the alarm configuration information, a corresponding alarm task is generated. Specifically, the alarm task is the alarm configuration information in the alarm system, corresponding to the content of the alarm configuration information, and the alarm task includes all the information in the alarm configuration information.
[0061] The more important information in the alarm configuration information is the microservice to which the alarm belongs. This data can be used to determine which microservice the generated alarm belongs to, so that users or maintenance personnel can process and maintain the generated alarm.
[0062] It should be noted that steps S210 and S220 will only be executed in two cases, namely, when the alarm system first connects to one or several microservices to provide alarm services, alarm tasks corresponding to different microservices will be generated according to the file; or, when new and unrecognizable data appears in the connected microservices, the user imports the file again to generate supplementary alarm tasks corresponding to different microservices.
[0063] S230: Based on the preset instruction generated by the trigger component, call the input component to obtain the operation data of the microservice corresponding to the preset instruction.
[0064] S240: Calling a data processing component to process the operation data to obtain monitoring data of the microservice.
[0065] S250: calling the alarm generation component to analyze the monitoring data, and if the monitoring data includes an alarm trigger parameter, obtaining the triggering times of the alarm task corresponding to the alarm trigger parameter.
[0066] S260: If the triggering times of the alarm task meet the preset conditions, the alarm generation component is called to generate alarm information according to the alarm task.
[0067] S270: Call the alarm notification component to output alarm information according to the microservice corresponding to the monitoring data that triggers the alarm task.
[0068] The execution process of steps S230 to S270 in the method is the same as the execution process of steps S110 to S150 mentioned above, so steps S230 to S270 are not described in detail in this application.
[0069] By generating alarm tasks corresponding to different microservices, the method can provide alarm services for different systems. At the same time, when multiple microservices have been connected for alarm services, new alarm tasks can be generated to connect to other microservices and provide alarm services.
[0070] Figure 3 FIG. 2 shows a flowchart of another unified alarm method based on multiple microservice scenarios in an embodiment of the present application. Figure 3 As shown, the method also includes:
[0071] S310: Based on the preset instruction generated by the trigger component, call the input component to obtain the operation data of the microservice corresponding to the preset instruction.
[0072] S320: Call the data processing component to process the operation data to obtain monitoring data of the microservice.
[0073] The execution process of steps S310 to S320 in the method is the same as the execution process of steps S110 to S120 mentioned above, so steps S310 to S320 will not be described in detail in this application.
[0074] S330: calling the alarm generation component to analyze the monitoring data, and if the monitoring data includes an alarm trigger parameter, obtaining the triggering times of the alarm task corresponding to the alarm trigger parameter.
[0075] In this embodiment, the alarm task includes an alarm trigger parameter. It should be understood that the alarm trigger parameter should be a unique data generated when such an exception occurs in the microservice. When the monitoring data includes the unique data, it can be said that such an exception has occurred.
[0076] It should be noted that since different alarm tasks require corresponding different alarm trigger parameters to avoid alarm generation errors, and there are fewer anomalies that can be identified by a unique data, the unique data included in the alarm trigger parameters should be a data set, which includes at least one piece of data.
[0077] Therefore, determining whether the monitoring data satisfies the alarm trigger parameters may be to traverse the data included in the monitoring data, and if all the specific data in the alarm trigger parameters are included, then determining that the parameter information in the monitoring data satisfies the alarm trigger parameters.
[0078] After determining that the parameter information in the monitoring data meets the alarm trigger parameters, the number of triggers of this alarm task within the preset time period is obtained according to the number of information in the parameter information that meets the alarm trigger parameters. Obtaining the number of triggers within a certain time period is convenient for limiting the number of times the alarm information is generated, avoiding the generation of a large number of identical alarm messages in a short period of time. It should be understood that the processing of alarms may be a relatively long process, so the duration of the preset time period is usually longer. Exemplarily, the preset time period is 6 hours. The specific size of the preset time period is not limited in the embodiment of the present application, but in order to avoid a large number of identical alarm messages in a short period of time, the preset time period should also be set longer.
[0079] S340: Compare the triggering times of the alarm task with the preset times. If the triggering times of the alarm task are less than or equal to the preset times, determine that the triggering times of the alarm task meet the preset conditions.
[0080] The obtained triggering times of the alarm task are compared with the preset times. Only when the triggering times within the preset time period are less than or equal to the preset times, the triggering times will meet the preset condition. In other words, the preset condition is that the triggering times of the alarm task are less than or equal to the preset times.
[0081] Exemplarily, the preset number of times may be set to 1, that is, when an alarm task is triggered for the first time within a preset time period, subsequent generation and output of alarm information will be performed according to this alarm task.
[0082] S350: Calling the alarm generation component to generate alarm information according to the alarm task.
[0083] Only when the number of alarm task triggers meets the preset conditions within the preset time period, that is, the number of alarm task triggers is less than or equal to the preset number, will the alarm system call the alarm generation component to generate corresponding alarm information based on this alarm task.
[0084] S360: Call the alarm notification component to output alarm information according to the microservice corresponding to the monitoring data that triggers the alarm task.
[0085] By limiting the generation of the same alarm information, we can avoid generating a large amount of the same alarm information in a short period of time, which will affect the alarm service effect for different microservices.
[0086] Figure 4 FIG. 2 shows a flowchart of another unified alarm method based on multiple microservice scenarios in an embodiment of the present application. Figure 4 As shown, the method also includes:
[0087] S410: Based on the preset instruction generated by the trigger component, call the input component to obtain the operation data of the microservice corresponding to the preset instruction.
[0088] S420: Call the data processing component to process the operation data to obtain monitoring data of the microservice.
[0089] S430: calling the alarm generation component to analyze the monitoring data, and if the monitoring data includes an alarm trigger parameter, obtaining the triggering times of the alarm task corresponding to the alarm trigger parameter.
[0090] The execution process of steps S410 to S430 in the method is the same as the execution process of steps S310 to S330 mentioned above, so steps S410 to S430 will not be described in detail in this application.
[0091] S440: If the number of times the alarm task is triggered does not meet the preset condition, the alarm generation component is called to obtain the first time when the alarm task corresponding to the alarm trigger parameter was last triggered and generated alarm information.
[0092] It can be seen from the above embodiments that the triggering times of the alarm task will only meet the preset conditions when the triggering times are less than or equal to the preset times. When the triggering times are greater than the preset times, it can be determined that the triggering times of the alarm task do not meet the preset conditions. In this embodiment, when the triggering times do not meet the preset conditions, that is, when the alarm task is triggered more than the preset times within the preset time period, the triggered alarm task can be filtered out to avoid the same alarm in a short time. However, due to the preset time period, the same alarm may appear again after maintenance. At this time, since the alarm information has been generated once within the preset time period, it will not continue to be generated, and the notification of the alarm is missed.
[0093] Therefore, it is necessary to obtain the first time when the alarm task was triggered and the alarm information was generated last time, and control the generation of the alarm information.
[0094] S450: If it is determined that the duration between the first time and the current time is greater than the first preset duration, the alarm level corresponding to the alarm task is increased.
[0095] Specifically, when the duration between the first time and the current trigger time is greater than the first preset duration, it means that this alarm task has not been processed for a long time or has occurred again, and maintenance personnel need to handle it as soon as possible. Therefore, the alarm level corresponding to the alarm task needs to be increased, so that maintenance personnel can pay more attention to this alarm task.
[0096] It should be understood that the embodiment of the present application does not limit the size of the first preset duration, but the first preset duration should be smaller than the preset time period.
[0097] S460: Calling the alarm generation component to generate alarm information according to the alarm task after the alarm level is increased.
[0098] The alarm generation component is called to generate alarm information corresponding to the alarm task of this alarm level according to the alarm task after the alarm level is increased.
[0099] S470: Call the alarm notification component to output alarm information according to the microservice corresponding to the monitoring data that triggers the alarm task.
[0100] Through the above technical solution, the alarm system can re-notify problems that have not been processed for a long time or have reappeared, and remind maintenance personnel to handle them as soon as possible by raising the alarm level.
[0101] Figure 5 FIG. 4 is a flowchart of another unified alarm method based on multiple microservice scenarios in an embodiment of the present application. Figure 5 As shown, the method also includes:
[0102] S510: Based on the preset instruction generated by the trigger component, call the input component to obtain the operation data of the microservice corresponding to the preset instruction.
[0103] S520: Call the data processing component to process the operation data to obtain monitoring data of the microservice.
[0104] S530: Calling the alarm generation component to analyze the monitoring data, if the monitoring data includes an alarm trigger parameter, obtaining the triggering times of the alarm task corresponding to the alarm trigger parameter.
[0105] The execution process of steps S510 to S530 in the method is the same as the execution process of steps S110 to S130 mentioned above, so steps S510 to S530 will not be described in detail in this application.
[0106] S540: According to the alarm triggering parameters, the alarm generation component is called to generate alarm prompt information.
[0107] When the alarm task includes alarm trigger parameters and alarm levels, an alarm prompt message is generated according to the alarm trigger parameters. The alarm prompt message is used to remind maintenance personnel that an abnormality has occurred in the system operation. Therefore, the alarm prompt message should at least include the microservice that generated the abnormality, the specific information of the abnormality, and the time when the abnormality occurred.
[0108] S550: According to the alarm level corresponding to the alarm task, call the alarm generation component to determine the alarm prompt mode.
[0109] Different alert prompts can be determined by the alert level. The higher the alert level, the more direct the prompt. For example, reminders can be given by email, text message or phone call. When the alert level is low, reminders are given by email; when the alert level is high, reminders are given by phone; when the alert level is between the two, reminders are given by text message.
[0110] In some embodiments, reminders can also be made through APP or the like, and can be combined through vibration, message, ringing, etc., so as to distinguish different alarm levels and further implement specific operations to remind maintenance personnel.
[0111] S560: Calling an alarm notification component corresponding to the alarm prompt mode to output alarm prompt information according to the alarm prompt mode and the microservice.
[0112] Through the alarm prompt method, the alarm prompt information is sent to the maintenance personnel, so that the maintenance personnel can obtain the alarm status of the microservice in time.
[0113] In some embodiments, in order to further reduce the number of times alarms are generated, so as to facilitate maintenance personnel to view, all alarm information generated within a second preset time period is obtained, and then the alarm notification component is called to output the alarm information with the same alarm level together. The specific value of the second preset time period is not limited in this application, but it should not be too long to cause the alarm to be untimely. Outputting the alarm information with the same alarm level together can reduce the number of times the alarm is output, thereby facilitating maintenance personnel to view, i.e., maintenance of microservices.
[0114] Through the above method, the alarm levels can be effectively divided, reminding users to handle higher-level alarms in a timely manner.
[0115] Figure 6 FIG. 4 is a flowchart of another unified alarm method based on multiple microservice scenarios in an embodiment of the present application. Figure 6 As shown, the method also includes:
[0116] S610: Based on the preset instruction generated by the trigger component, call the input component to obtain the operation data of the microservice corresponding to the preset instruction.
[0117] S620: Call the data processing component to process the operation data to obtain monitoring data of the microservice.
[0118] S630: Calling the alarm generation component to analyze the monitoring data, if the monitoring data includes an alarm trigger parameter, obtaining the triggering times of the alarm task corresponding to the alarm trigger parameter.
[0119] S640: If the triggering times of the alarm task meet the preset conditions, call the alarm generation component to generate alarm information according to the alarm task.
[0120] S650: Call the alarm notification component to output alarm information according to the microservice corresponding to the monitoring data that triggers the alarm task.
[0121] The execution process of steps S610 to S650 in the method is the same as the execution process of steps S110 to S150 mentioned above, so steps S610 to S650 are not described in detail in this application.
[0122] S660: Generate an alarm process record based on the alarm information.
[0123] An alarm process record is generated according to the generated alarm information and the generation process of the alarm information. The alarm process record mainly includes the generation process of the alarm information.
[0124] It should be noted that the alarm process record still needs to be generated even if the monitoring data does not trigger the alarm task. In this case, the alarm process record includes the processing flow of the monitoring data.
[0125] S670: Store the alarm process record.
[0126] The alarm process records are stored for subsequent viewing. Through the above solution, maintenance personnel can clearly understand the generation of alarm information, which is convenient for subsequent maintenance and viewing.
[0127] Based on the above unified alarm method, the present application also provides a unified alarm system 700 based on multiple microservice scenarios, such as Figure 7 As shown, including:
[0128] The trigger component 710 is used to generate a preset instruction according to the alarm data acquisition condition.
[0129] The input component 720 is used to obtain the operation data of the microservice corresponding to the preset instruction.
[0130] The data processing component 730 is used to process the operation data to obtain the monitoring data of the microservice.
[0131] The alarm generation component 740 is used to analyze the monitoring data. If the monitoring data includes an alarm trigger condition, the triggering number of the alarm task corresponding to the alarm trigger parameter is obtained; and if the triggering number of the alarm task meets the preset condition, an alarm message is generated according to the alarm task.
[0132] The alarm notification component 750 is used to output alarm information.
[0133] In an optional manner, the alarm generation component 740 is further used to compare the triggering times of the alarm task with a preset number, and if the triggering times of the alarm task are less than or equal to the preset number, determine that the triggering times of the alarm task meet the preset conditions.
[0134] In an optional manner, the alarm task also includes an alarm level, and the alarm generation component 740 is also used to: if the number of times the alarm task is triggered meets the preset conditions, call the alarm generation component to obtain the first time when the alarm task corresponding to the alarm trigger parameter was last triggered and generated alarm information; if the duration between the first time and the current time is greater than the first preset duration, increase the alarm level corresponding to the alarm task; call the alarm generation component to generate alarm information based on the alarm task after the alarm level is increased.
[0135] In an optional manner, the alarm information includes alarm prompt information and alarm prompt mode, and the alarm generation component 740 is further used to: call the alarm generation component to generate alarm prompt information according to the alarm trigger parameter; call the alarm generation component to determine the alarm prompt mode according to the alarm level corresponding to the alarm task;
[0136] The alarm notification component 750 is also used to call the alarm notification component corresponding to the alarm prompt mode to output alarm prompt information according to the alarm prompt mode and microservice.
[0137] In an optional manner, the alarm notification component 750 is further used to: obtain all alarm information generated within a second preset time period; call the alarm notification component to output the alarm information with the same alarm level together.
[0138] In an optional manner, the system is further used to: obtain alarm configuration information in response to an alarm creation instruction input by a user; and create an alarm task according to the alarm configuration information.
[0139] In an optional manner, before calling the input component to obtain the running data of the microservice corresponding to the preset instruction, the system is also used to: obtain the running time of the microservice, if the running time is greater than or equal to the third preset time, call the trigger component to generate the preset instruction; or, monitor the running process of the microservice, if the running process reaches the preset node, call the trigger component to generate the preset instruction.
[0140] In an optional manner, the system is also used to: generate an alarm process record based on the alarm information; and store the alarm process record.
[0141] In some embodiments, in order to monitor the operation status of multiple microservices at the same time, Fig. 9 As shown, the unified alarm system 700 includes a trigger component 710, an input component 720, a data processing component 730, an alarm generation component 740 and an alarm notification component 750. When monitoring the operation of microservices, it is necessary to connect to different microservices through the trigger component 710 and the input component 720. The connection of three microservices in the figure is only an example, and other numbers of microservices can be connected.
[0142] At the same time, the alarm generation component 740 may include a throttle 741, which can determine the monitoring data that triggers the alarm task and reduce the number of generated alarm information. The throttling setting of the throttle 741 can be set and implemented based on the methods of steps S340 to S350 and steps S440 to S460 in the above unified alarm method embodiment.
[0143] Figure 8 A schematic diagram of the structure of a unified alarm device based on multiple microservice scenarios provided by an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.
[0144] Based on the above unified alarm method, the present application also provides a unified alarm device based on multiple microservice scenarios, such as Figure 8 As shown, the electronic device may include: a processor (processor) 802 , a communication interface (Communications Interface) 804 , a memory (memory) 806 , and a communication bus 808 .
[0145] The processor 802, the communication interface 804, and the memory 806 communicate with each other via a communication bus 808. The communication interface 804 is used to communicate with other devices such as a client or other server network elements. The processor 802 is used to execute a program 810, which can specifically execute the relevant steps in the above-mentioned unified alarm method embodiment.
[0146] Specifically, the program 810 may include program code including computer executable instructions.
[0147] The processor 802 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0148] The memory 806 is used to store the program 810. The memory 806 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0149] Program 810 may be specifically called by processor 802 to enable the electronic device to perform the following operations:
[0150] Based on the preset instruction generated by the trigger component, the input component is called to obtain the operation data of the microservice corresponding to the preset instruction.
[0151] Call the data processing component to process the running data to obtain the monitoring data of the microservice.
[0152] The alarm generation component is called to analyze the monitoring data. If the monitoring data includes an alarm trigger parameter, the triggering number of the alarm task corresponding to the alarm trigger parameter is obtained.
[0153] If the triggering times of the alarm task meet the preset conditions, the alarm generation component is called to generate alarm information according to the alarm task.
[0154] Call the alarm notification component to output alarm information based on the microservice corresponding to the monitoring data that triggers the alarm task.
[0155] In an optional manner, the method further includes: comparing the triggering times of the alarm task with a preset number; if the triggering times of the alarm task is less than or equal to the preset number, determining that the triggering times of the alarm task meets a preset condition.
[0156] In an optional manner, the alarm task also includes an alarm level, and the method also includes: if the number of times the alarm task is triggered does not meet the preset conditions, calling the alarm generation component to obtain the first time when the alarm task corresponding to the alarm trigger parameter was last triggered and generated alarm information; if the duration between the first time and the current time is greater than the first preset duration, raising the alarm level corresponding to the alarm task; calling the alarm generation component to generate alarm information based on the alarm task after the alarm level is raised.
[0157] In an optional manner, the alarm information includes alarm prompt information and an alarm prompt mode, and the step of generating the alarm information according to the alarm task includes: calling the alarm generation component to generate the alarm prompt information according to the alarm trigger parameter; calling the alarm generation component to determine the alarm prompt mode according to the alarm level corresponding to the alarm task;
[0158] Calling an alarm notification component to output alarm information according to a microservice corresponding to monitoring data that triggers an alarm task, including: calling an alarm notification component corresponding to an alarm prompt mode to output alarm prompt information according to the alarm prompt mode and the microservice.
[0159] In an optional manner, the alarm notification component is called to output alarm information according to the microservice corresponding to the monitoring data that triggers the alarm task, including: obtaining all alarm information generated within a second preset time period; calling the alarm notification component to output alarm information with the same alarm level together.
[0160] In an optional manner, before calling the input component to obtain the running data of the microservice corresponding to the preset instruction, the method also includes: obtaining alarm configuration information in response to the alarm creation instruction input by the user; and creating an alarm task according to the alarm configuration information.
[0161] In an optional manner, before calling the input component to obtain the running data of the microservice corresponding to the preset instruction, the method also includes: obtaining the running time of the microservice, if the running time is greater than or equal to a third preset time, calling the trigger component to generate the preset instruction; or, monitoring the running process of the microservice, if the running process reaches a preset node, calling the trigger component to generate the preset instruction.
[0162] In an optional manner, after generating alarm information according to the alarm task, the method further includes: generating an alarm process record according to the alarm information; and storing the alarm process record.
[0163] An embodiment of the present invention also provides a computer-readable storage medium, which stores at least one executable instruction. When the executable instruction is executed on a unified alarm system / device, the unified alarm system / device performs operations such as any of the aforementioned unified alarm discovery methods based on multiple microservice scenarios.
[0164] The embodiment of the present invention provides a unified alarm method, system and device based on multiple microservice scenarios, the method comprising: first, based on the preset instruction generated by the trigger component, calling the input component to obtain the operation data of the microservice corresponding to the preset instruction, calling the data processing component to process the operation data to obtain the monitoring data of the microservice, calling the alarm generation component to analyze the monitoring data, and if the preset conditions are met, generating alarm information according to the alarm task, and finally calling the alarm notification component to output the alarm information. By applying the technical solution of the present invention, when it is necessary to monitor multiple microservices, the operation data of multiple microservices can be collected and unified alarm management can be performed, avoiding the difficulty of integrating alarm information caused by factors such as interaction between multiple microservices, and facilitating the statistics and processing of alarm information between multiple microservices.
[0165] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. Similarly, in order to simplify the present invention and help understand one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. Wherein, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself is a separate embodiment of the present invention.
[0166] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive.
[0167] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A unified alarm method based on multiple microservice scenarios, characterized in that: include: Obtain the running time of the microservice, and if the running time is greater than or equal to a third preset duration, call the trigger component to generate a preset instruction; Alternatively, the running process of the microservice is monitored, and if the running process reaches a preset node, a trigger component is called to generate a preset instruction; Alternatively, if specific data is detected in the microservice, the trigger component is called to generate preset instructions; Based on the preset instruction generated by the trigger component, the input component is called to obtain the operation data of the microservice corresponding to the preset instruction; the microservice is used to form at least one service system or application program; Calling a data processing component to process the operation data to obtain monitoring data of the microservice; Calling an alarm generation component to analyze the monitoring data, and if the monitoring data includes an alarm trigger parameter, obtaining the triggering number of the alarm task corresponding to the alarm trigger parameter; If the triggering times of the alarm task meet the preset conditions, calling the alarm generation component to generate alarm information according to the alarm task; Calling an alarm notification component to output the alarm information according to the microservice corresponding to the monitoring data that triggers the alarm task; The unified alarm method also includes: Comparing the triggering times of the alarm task with the preset times, the alarm task also includes an alarm level; If the number of times the alarm task is triggered is less than or equal to the preset number, determining that the number of times the alarm task is triggered meets the preset condition; If the triggering times of the alarm task do not meet the preset condition, calling the alarm generation component to obtain the first time when the alarm task corresponding to the alarm trigger parameter was last triggered and generated alarm information; If the duration between the first time and the current time is greater than a first preset duration, raising the alarm level corresponding to the alarm task; Obtaining all the warning information generated within a second preset time period; The alarm notification component is called to output the alarm information with the same alarm level together.
2. According to claim 1, the unified alarm method based on multiple microservice scenarios is characterized in that: The alarm information includes alarm prompt information and alarm prompt mode, and the step of generating the alarm information according to the alarm task includes: According to the alarm trigger parameter, calling the alarm generation component to generate the alarm prompt information; According to the alarm level corresponding to the alarm task, calling the alarm generation component to determine the alarm prompt mode; The calling of the alarm notification component to output the alarm information according to the microservice corresponding to the monitoring data that triggers the alarm task includes: calling the alarm notification component corresponding to the alarm prompt method to output the alarm prompt information according to the alarm prompt method and the microservice.
3. The unified alarm method based on multiple microservice scenarios according to claim 1 is characterized in that: Before calling the input component to obtain the operation data of the microservice corresponding to the preset instruction, the method further includes: Responding to an alarm creation instruction input by a user, obtaining alarm configuration information; Create the alarm task according to the alarm configuration information.
4. The unified alarm method based on multiple microservice scenarios according to any one of claims 1 to 3, characterized in that: After generating the alarm information according to the alarm task, the method further includes: Generate an alarm process record according to the alarm information; The alarm process record is stored.
5. A unified alarm system based on multiple microservice scenarios, characterized in that: include: The trigger component is used to obtain conditions based on the alarm data and generate preset instructions; An input component, used to obtain the operation data of the microservice corresponding to the preset instruction; A data processing component, used to process the operation data to obtain monitoring data of the microservice; An alarm generation component is used to analyze the monitoring data, and if the monitoring data includes an alarm trigger parameter, obtain the triggering number of the alarm task corresponding to the alarm trigger parameter; and if the triggering number of the alarm task meets a preset condition, generate alarm information according to the alarm task; An alarm notification component, used to output the alarm information; The trigger component is further used to obtain the running time of the microservice, and if the running time is greater than or equal to a third preset duration, the trigger component is called to generate a preset instruction; Alternatively, the running process of the microservice is monitored, and if the running process reaches a preset node, a trigger component is called to generate a preset instruction; Alternatively, if specific data is detected in the microservice, the trigger component is called to generate preset instructions; The alarm generation component is further used to compare the triggering number of the alarm task with the preset number, and the alarm task also includes an alarm level; if the triggering number of the alarm task is less than or equal to the preset number, it is determined that the triggering number of the alarm task meets the preset condition; The alarm generation component is further used to call the alarm generation component to obtain the first time when the alarm task corresponding to the alarm trigger parameter was last triggered and generated alarm information if the number of triggering times of the alarm task does not meet the preset condition; If the duration between the first time and the current time is greater than a first preset duration, raising the alarm level corresponding to the alarm task; Obtaining all the warning information generated within a second preset time period; The alarm notification component is called to output the alarm information with the same alarm level together.
6. A unified alarm device based on multiple microservice scenarios, characterized in that: include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of a unified alarm method based on multiple microservice scenarios as described in any one of claims 1-4.
