Alarm method, electronic equipment and storage medium
Log alarm tags are determined through custom and conventional tags, and alarm rules that meet user expectations are generated, which solves the problem of poor user experience in the existing technology, realizes more accurate alarm information prompts, and improves user experience.
Patent Information
- Application Number
- CN202510503517.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-08-15
AI Technical Summary
The alarm method in the prior art has poor user experience.
Determine the log alarm tag through custom and general tags, generate alarm rules that meet user expectations, and generate and prompt alarm information when the log data meets the alarm conditions.
Improve the user experience, make the alarm information more accurately meet user expectations, and improves the user's reminder efficiency of log data characteristics.
Smart Images

Figure CN120492282A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an alarm method, electronic equipment, and storage medium. Background Art
[0002] In the log collection and management scenario, an alarm mechanism can be set to alert users so that they can easily and quickly obtain characteristic information in the logs.
[0003] However, the alarm method in the related art has the problem of poor user experience. Summary of the Invention
[0004] The purpose of this application is to provide an alarm method, electronic device and storage medium, aiming to solve the technical problem of poor user experience in related technologies.
[0005] To achieve the above objectives, this application adopts the following technical solutions:
[0006] The present application provides an alarm method, comprising: determining a log alarm tag in response to a user's tag determination operation; the log alarm tag includes a custom tag and a regular tag; determining an alarm rule based on the log alarm tag; obtaining log data; generating an alarm message when the log data meets the alarm condition in the alarm rule; and prompting the user with the alarm message.
[0007] In this application, since custom tags can be customized by users, the alarm rules obtained through custom tags can ensure the generation of alarm information that meets user expectations, and can prompt users when data features that users expect to be reminded exist in the log data, thereby improving the user experience.
[0008] In some embodiments, the conventional tag includes at least one of the following: log level, time, service name, exception type;
[0009] In response to the user's tag determination operation, the log alarm tag is determined, including: displaying the candidate tag corresponding to the regular tag; displaying the custom tag input box; in response to the user's selection operation of the candidate tag, determining the regular tag; in response to the user's input operation in the custom tag input box, determining the custom tag; based on the regular tag and the custom tag, determining the log alarm tag.
[0010] In some embodiments, based on the log alarm tag, an alarm rule is determined, including: obtaining a template of the log data, parsing the template of the log data based on the log alarm tag, and obtaining an association relationship between the log alarm tag and the data type of the log data; the association relationship is used to determine the data corresponding to each log alarm tag from the log data; obtaining the alarm condition corresponding to the log alarm tag; and generating an alarm rule based on the association relationship and the alarm condition.
[0011] In some embodiments, obtaining the alarm condition corresponding to the log alarm tag includes: obtaining the alarm condition corresponding to the log alarm tag in response to the alarm condition input by the user; and / or obtaining historical log data; and determining the alarm condition corresponding to the log alarm tag based on the data corresponding to the log alarm tag in the historical log data.
[0012] In some embodiments, the alarm condition includes a single label condition and a multi-label joint condition; the single label condition corresponds to one label in the log alarm label; the multi-label joint condition corresponds to multiple labels in the log alarm label.
[0013] In some embodiments, the log alarm tag includes multiple tags; each tag corresponds to an alarm validity period; the method further includes: for each tag, obtaining the alarm validity period and current time of the tag; based on the alarm validity period and current time of the tag, determining or updating the log alarm tag used to generate the alarm rule; based on the log alarm tag used to generate the alarm rule, determining or updating the alarm rule;
[0014] Determine or update the log alarm tag used to generate the alarm rule based on the alarm validity period of the tag and the current time, including one of the following: when the current time is outside the alarm validity period of the tag and the log alarm tag used to generate the alarm rule includes the tag, delete the tag from the log alarm tag used to generate the alarm rule; when the current time is within the alarm validity period of the tag and the middle part of the log alarm tag used to generate the alarm rule includes the tag, add the tag to the log alarm tag used to generate the alarm rule;
[0015] The alarm validity period meets one of the following requirements: permanent validity, periodic validity, validity within a fixed time range, validity after the target time, periodic expiration, expiration within a fixed time range, expiration after the target time.
[0016] In some embodiments, prompting a user with alarm information includes: prompting a user or a preset user group according to a preset alarm format;
[0017] The preset alarm forms include at least one of the following: SMS, phone call, email;
[0018] The prompt information includes at least one of the following: alarm level and alarm content.
[0019] In some embodiments, the user or a preset user group is prompted according to a preset alarm form, including:
[0020] Based on the alarm level, the form type and / or form quantity of the preset alarm form is determined; the higher the alarm level, the lower the delay and error rate of the form corresponding to the determined form type; the higher the alarm level, the more forms are determined; based on the preset alarm form, the user or preset user group is prompted.
[0021] In some embodiments, the present application provides an electronic device comprising: a processor and a memory configured to store processor-executable instructions; wherein the processor is configured to execute the instructions to implement any of the above optional methods.
[0022] In some embodiments, the present application provides a computer-readable storage medium having instructions stored thereon. When the instructions in the computer-readable storage medium are executed by an electronic device, the electronic device is enabled to execute any of the above-mentioned optional methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0024] Figure 1 A flowchart of an alarm method provided in this application;
[0025] Figure 2 This is a structural diagram of an alarm device provided in this application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0027] In the description of this application, it should be understood that the terms "upper," "lower," "left," "right," "front," "back," "inner," "outer," and the like, indicating directions or positional relationships, are based on the directions or relative positional relationships shown in the accompanying drawings and are intended solely to facilitate the description of this application and simplify the description. They do not indicate or imply that the devices or components referred to must have a specific direction, be constructed, or operate in a specific direction. Therefore, they should not be construed as limitations on this application. Unless otherwise specified, the above-mentioned directionality descriptions may be flexibly set in actual application, provided that the relative positional relationships shown in the accompanying drawings are met.
[0028] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature specified as "first" or "second" may explicitly or implicitly include one or more of such features. Throughout this application, unless otherwise specified, "plurality" means two or more.
[0029] In the description of this application, it should be noted that, unless otherwise expressly specified or limited, the terms "mounted," "connected," "connected," and "connected" should be understood broadly. For example, they may refer to fixed connections, detachable connections, or integral connections. They may be directly connected, indirectly connected through an intermediary, or internally connected between two components. Those skilled in the art will understand the specific meanings of these terms in this application based on the specific circumstances.
[0030] In the embodiments of the present application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, article, or device comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of other identical elements in the process, article, or device comprising the element.
[0031] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0032] Exemplarily, the electronic device that executes the alarm method provided in the embodiments of the present application may be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook computer, cellular phone, personal digital assistant (PDA), augmented reality (AR) or virtual reality (VR) device. The embodiments of the present application do not impose any particular restrictions on the specific form of the electronic device. It can interact with the user through one or more methods such as a keyboard, touchpad, touch screen, remote control, voice interaction, or handwriting device.
[0033] In the description of this specification, specific features, structures, materials or characteristics may be combined in an appropriate manner in any one or more embodiments or examples.
[0034] like Figure 1 As shown, an alarm method provided in an embodiment of the present application includes S101-S105:
[0035] S101: In response to a user's tag determination operation, determine a log alarm tag.
[0036] Log alert tags include custom tags and regular tags.
[0037] For example, for exceptions caused by improper user operations in the system, you can customize the tag "operatorException." For example, for exceptions related to order information in the system, such as exceptions in important business processes such as order placement, payment, and refunds, you can customize the tag "orderException." For example, if a user wishes to monitor payment-related logs, they can customize the tag "pay," which will be added to the corresponding log metadata.
[0038] S102: Determine an alarm rule based on the log alarm tag.
[0039] S103: Obtain log data.
[0040] S104: When the log data meets the alarm condition in the alarm rule, generate alarm information.
[0041] S105: Prompt the user with warning information.
[0042] It should be noted that since custom tags can be customized by users, the alarm rules obtained through custom tags can ensure that alarm information that meets user expectations is generated, and can prompt users when data features that users expect to be reminded exist in the log data, thereby improving the user experience.
[0043] In some embodiments, the conventional tags include at least one of the following: log level, time, service name, exception type, status code, and error code. It should be understood that if at least one of the tags such as log level, time, service name, exception type, status code, and error code is present in the conventional tags, the alarm rule generated according to the conventional tags can execute the judgment of the alarm condition corresponding to the tag.
[0044] In some embodiments, in response to a user's label determination operation, a log alarm label is determined, including: displaying candidate labels corresponding to regular labels; displaying a custom label input box; determining a regular label in response to a user's selection operation of a candidate label; determining a custom label in response to a user's input operation in a custom label input box; and determining a log alarm label based on the regular label and the custom label.
[0045] In some embodiments, based on the log alarm tag, an alarm rule is determined, including: obtaining a template for log data, parsing the template for log data based on the log alarm tag, and obtaining an association relationship between the log alarm tag and the data type of the log data; the association relationship is used to determine the data corresponding to each log alarm tag from the log data; obtaining the alarm condition corresponding to the log alarm tag; and generating an alarm rule based on the association relationship and the alarm condition. It should be understood that by parsing to obtain the association relationship between the tag and the data type of the log data, the device can obtain the data corresponding to the tag from the log data based on the association relationship and determine whether an alarm needs to be executed. In some embodiments, the association relationship between the data type and the tag can be determined in the template corresponding to the log data through the association operation between the user's data type and the tag. Exemplarily, the user can connect the area where the data type is located in the template with the display area of the tag.
[0046] In some embodiments, the association relationship between the target tag and the data type of the data can be established by the user tagging the data in the log data that the user desires to be associated with the target tag.
[0047] In some embodiments, the log data may be marked based on the log warning tag. Exemplarily, the log data may be marked based on the association between the log warning tag and the data type of the log data.
[0048] In some embodiments, obtaining an alarm condition corresponding to a log alarm tag includes: obtaining an alarm condition corresponding to the log alarm tag in response to an alarm condition input by a user; and / or obtaining historical log data; and determining the alarm condition corresponding to the log alarm tag based on the data corresponding to the log alarm tag in the historical log data. Exemplarily, determining the alarm condition corresponding to the log alarm tag based on the data corresponding to the log alarm tag in the historical log data can be: determining the average of the data corresponding to the tag for a preset period of time (e.g., the nearly 30 days at the current time) as the threshold value in the alarm condition corresponding to the tag.
[0049] In some embodiments, the data used for judgment corresponding to the alarm condition can be in the form of at least one of quantity, ratio, and time. In some embodiments, the judgment method in the alarm condition can be one of the following: below a threshold, above a threshold, or within a target range. For example, in order to monitor order volume below a threshold or to monitor changes in user or customer focus, the log volume of a certain interface log is checked, and specifically, the rate of change of the log volume of the interface can be checked.
[0050] In some embodiments, the alarm conditions include single-label conditions (or single indicators) and multi-label joint conditions (or multi-label joint conditions); the single-label condition corresponds to one label in the log alarm label; the multi-label joint condition corresponds to multiple labels in the log alarm label. Exemplarily, the single indicator can be the error rate. The combined indicator can include two indicators: the order quantity and the order success rate. For example, when the order quantity is less than x orders, an alarm is triggered if the order success rate is less than 80%. When the order quantity is greater than x orders, an alarm is triggered if the order success rate is less than 95%.
[0051] In some embodiments, the multi-tag joint conditions can be combined together by AND, OR, NOT, addition, subtraction, etc.
[0052] In some embodiments, the alarm condition may also include log data acquisition parameters such as the number of log data collected, the collection time, the collection frequency, or the number of queries per second (qps), and the response time. In some embodiments, acquiring the log data includes acquiring the log data based on the log data acquisition parameters in the alarm condition.
[0053] In some embodiments, the log alarm tag includes multiple tags; each tag corresponds to an alarm validity period; the method also includes: for each tag, obtaining the alarm validity period and current time of the tag; based on the alarm validity period and current time of the tag, determining or updating the log alarm tag used to generate the alarm rule; based on the log alarm tag used to generate the alarm rule, determining or updating the alarm rule.
[0054] In some embodiments, based on the alarm validity period of the label and the current time, the log alarm label used to generate the alarm rule is determined or updated, including one of the following: when the current time is outside the alarm validity period of the label and the log alarm label used to generate the alarm rule includes the label, deleting the label from the log alarm label used to generate the alarm rule; when the current time is within the alarm validity period of the label and the middle part of the log alarm label used to generate the alarm rule includes the label, adding the label to the log alarm label used to generate the alarm rule.
[0055] In some embodiments, the alarm validity period satisfies one of the following: permanent validity, periodic validity, validity within a fixed time range, validity after a target time, periodic invalidation, invalidation within a fixed time range, invalidation after a target time.
[0056] In some embodiments, prompting the user with alarm information includes: prompting the user or a preset user group (or group) according to a preset alarm form.
[0057] In some embodiments, the preset alarm form includes at least one of the following: text message, phone call, and email.
[0058] In some embodiments, the prompt information includes at least one of the following: alarm level, alarm content.
[0059] In some embodiments, the user or a preset user group is prompted according to a preset alarm form, including:
[0060] Based on the alarm level, the type and / or number of preset alarm forms are determined; based on the preset alarm forms, the user or preset user group is notified. The higher the alarm level, the lower the latency and error rate of the corresponding form type; and the higher the alarm level, the greater the number of preset forms.
[0061] In some embodiments, if the problem corresponding to the alarm information cannot be resolved, the user can set the validity period or expiration time of the tag corresponding to the alarm information according to the user's expectations to update the alarm rules. In this way, unnecessary alarm information can be reduced. In some embodiments, the validity period or expiration time can also be set in conjunction with the time when the problem can be resolved. For example, if the tag corresponding to the alarm information can be resolved in three days, the expiration time is set to three days, or the validity period is set to take effect in three days.
[0062] The embodiments of the present application can divide the functional modules of electronic devices, etc. according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiments of the present application is schematic and is only a logical function division. In actual implementation, there may be other division methods.
[0063] In the case of dividing each functional module into corresponding functional modules, Figure 2 A possible structural diagram of the alarm device involved in the above embodiment is shown. Figure 2 As shown, the alarm device may include: a determination module 201 , an acquisition module 202 , a processing module 203 and an alarm module 204 .
[0064] The determination module 201 is configured to determine a log alarm tag in response to a tag determination operation by a user; the log alarm tag includes a custom tag and a regular tag;
[0065] The determination module 201 is further configured to determine an alarm rule based on the log alarm tag;
[0066] Acquisition module 202, used to acquire log data;
[0067] The processing module 203 is used to generate alarm information when the log data meets the alarm conditions in the alarm rules;
[0068] The alarm module 204 is used to prompt the user with alarm information.
[0069] In some embodiments, the conventional tag includes at least one of the following: log level, time, service name, exception type;
[0070] The processing module 203 is further used to display candidate tags corresponding to the regular tags;
[0071] The processing module 203 is further used to display a custom tag input box;
[0072] Determination module 201, for determining a regular tag in response to a user's selection operation on a candidate tag;
[0073] The determination module 201 is further configured to determine a custom tag in response to a user input operation in the custom tag input box;
[0074] The determination module 201 is further configured to determine a log alarm tag based on conventional tags and custom tags.
[0075] In some embodiments, the acquisition module 202 is further configured to acquire a template for log data;
[0076] The processing module 203 is further configured to parse the template of the log data based on the log alarm tag to obtain the association relationship between the log alarm tag and the data type of the log data; the association relationship is used to determine the data corresponding to each log alarm tag from the log data;
[0077] The acquisition module 202 is further used to obtain the alarm condition corresponding to the log alarm tag;
[0078] The processing module 203 is further configured to generate an alarm rule based on the association relationship and the alarm condition.
[0079] In some embodiments, the processing module 203 is further configured to obtain an alarm condition corresponding to a log alarm tag in response to an alarm condition input by a user;
[0080] The acquisition module 202 is also used to obtain historical log data;
[0081] The determination module 201 is further configured to determine an alarm condition corresponding to the log alarm tag based on data corresponding to the log alarm tag in the historical log data.
[0082] In some embodiments, the alarm condition includes a single label condition and a multi-label joint condition; the single label condition corresponds to one label in the log alarm label; the multi-label joint condition corresponds to multiple labels in the log alarm label.
[0083] In some embodiments, the log alarm tag includes multiple tags; each tag corresponds to an alarm validity period; the acquisition module 202 is further used to obtain the alarm validity period and current time of each tag;
[0084] The processing module 203 is further configured to determine or update the log alarm tag used to generate the alarm rule based on the alarm validity period of the tag and the current time;
[0085] The processing module 203 is further configured to determine or update an alarm rule based on the log alarm tag used to generate the alarm rule;
[0086] The processing module 203 is specifically configured to delete the tag from the log alarm tag used to generate the alarm rule when the current time is outside the alarm validity period of the tag and the log alarm tag used to generate the alarm rule includes the tag;
[0087] The processing module 203 is specifically configured to add the tag to the log alarm tag used to generate the alarm rule when the current time is within the alarm validity period of the tag and the middle portion of the log alarm tag used to generate the alarm rule includes the tag;
[0088] The alarm validity period meets one of the following requirements: permanent validity, periodic validity, validity within a fixed time range, validity after the target time, periodic expiration, expiration within a fixed time range, expiration after the target time.
[0089] In some embodiments, the alarm module 204 is used to prompt the user or a preset user group according to a preset alarm form;
[0090] The preset alarm forms include at least one of the following: SMS, phone call, email;
[0091] The prompt information includes at least one of the following: alarm level and alarm content.
[0092] In some embodiments, the determination module 201 is further configured to determine the form type and / or form quantity of the preset alarm form based on the alarm level; the higher the alarm level, the lower the delay and error rate of the form corresponding to the determined form type; the higher the alarm level, the more forms are determined;
[0093] The alarm module 204 is used to prompt the user or a preset user group based on a preset alarm form.
[0094] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. An alarm method, characterized in that: The method comprises: In response to a user's tag determination operation, determining a log warning tag; the log warning tag includes a custom tag and a regular tag; Determining an alarm rule based on the log alarm tag; Get log data; When the log data satisfies the alarm condition in the alarm rule, generating alarm information; Prompt the user with the warning information.
2. The method according to claim 1, characterized in that The conventional tags include at least one of the following: Log level, time, service name, exception type; The step of determining the log warning label in response to the user's label determination operation includes: Display candidate tags corresponding to the regular tags; Display the custom label input box; In response to a user selecting the candidate tag, determining the regular tag; In response to a user input operation in the custom tag input box, determining the custom tag; The log warning label is determined based on the regular label and the custom label.
3. The method according to claim 1, characterized in that The step of determining an alarm rule based on the log alarm tag includes: Get the template of the log data, Based on the log alarm tag, the template of the log data is parsed to obtain an association relationship between the log alarm tag and the data type of the log data; the association relationship is used to determine the data corresponding to each log alarm tag from the log data; Obtain the alarm condition corresponding to the log alarm tag; The alarm rule is generated based on the association relationship and the alarm condition.
4. The method according to claim 3, characterized in that The obtaining of the alarm condition corresponding to the log alarm tag includes: In response to the alarm condition input by the user, obtaining the alarm condition corresponding to the log alarm tag; and / or, Get historical log data; Based on the data corresponding to the log alarm tag in the historical log data, an alarm condition corresponding to the log alarm tag is determined.
5. The method according to claim 3 or 4, characterized in that The alarm condition includes a single label condition and a multi-label joint condition; the single label condition corresponds to one label in the log alarm label; the multi-label joint condition corresponds to multiple labels in the log alarm label.
6. The method according to any one of claims 1 to 4, characterized in that The log alarm tag includes multiple tags; each of the tags corresponds to the alarm validity period; The method further comprises: For each tag, obtain the alarm validity period and current time of the tag; Determine or update the log alarm tag for generating an alarm rule based on the alarm validity period of the tag and the current time; Determining or updating the alarm rule based on the log alarm tag used to generate the alarm rule; The determining or updating the log alarm tag for generating the alarm rule based on the alarm validity period of the tag and the current time includes one of the following: In a case where the current time is outside the alarm validity period of the tag and the log alarm tag used to generate the alarm rule includes the tag, deleting the tag from the log alarm tag used to generate the alarm rule; When the current time is within the alarm validity period of the tag and the middle portion of the log alarm tag for generating the alarm rule includes the tag, adding the tag to the log alarm tag for generating the alarm rule; The alarm validity period meets one of the following conditions: Permanently valid, periodically valid, valid within a fixed time range, effective after the target time, periodically invalid, invalid within a fixed time range, invalid after the target time.
7. The method according to claim 1, characterized in that Prompt the user with the warning information, including: Prompt users or preset user groups according to the preset alarm form; The preset alarm form includes at least one of the following: text message, phone call, email; The prompt information includes at least one of the following: alarm level and alarm content.
8. The method according to claim 7, characterized in that The method of prompting a user or a preset user group according to a preset alarm form includes: Based on the alarm level, determining the form type and / or form quantity of the preset alarm form; the higher the alarm level, the lower the delay and error rate of the form corresponding to the determined form type; the higher the alarm level, the more the number of the determined forms; Based on the preset alarm form, the user or the preset user group is prompted.
9. An electronic device, characterized in that: The electronic device comprises: processor; a memory configured to store instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions in the computer-readable storage medium are executed by an electronic device, the electronic device is enabled to perform the method according to any one of claims 1 to 8.