Alarm information sending method and device, storage medium and electronic device
By integrating the log collection module as a dependency into the target application, it automatically determines whether the interface call is successful and sends alarm information, which solves the problem that the log collection solution cannot automatically determine the interface call failure, simplifies configuration and maintenance, and improves operation and maintenance Efficiency and application stability.
Patent Information
- Application Number
- CN202411265802.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-11-22
AI Technical Summary
The existing log collection solution cannot automatically determine whether the interface function has failed to be called, resulting in many false positives and difficult deployment, poor popularity, and difficult to integrate seamlessly with Spring Boot applications.
By integrating the log collection module into the target application as a dependency, the execution information of the target operation is obtained, and the interface call is successful based on the execution information. If it is not successful, an alarm message is sent, and a preset whitelist is used to reduce false alarms.
Automatic configuration and dependency injection are realized, simplifying the configuration and maintenance of alarm collection tools, improving operation and maintenance efficiency, reducing false alarm rates, and reducing operation and maintenance costs.
Smart Images

Figure CN119011368A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to a method and device for sending alarm information, a storage medium, and an electronic device. Background Art
[0002] With the popularity of microservice architecture, the complexity of the system has increased, making it difficult to locate faults and troubleshoot problems. Existing alarm collection tools mostly exist in the form of independent services or plug-ins, which are not tightly integrated with business systems and cannot effectively utilize the advantages of the Spring Boot ecosystem, such as automatic configuration and dependency injection, resulting in complex configuration and high maintenance costs. For example, an open source alarm collection tool requires manual configuration of log paths, alarm rules, etc., and is difficult to integrate seamlessly with Spring Boot applications.
[0003] Log collection has always been an important part of operation and maintenance management. Currently, common log collection solutions can basically realize the rapid collection of logs, but they cannot automatically determine whether the interface function call fails. There are many false alarms, and they rely on multiple external components. They are difficult to deploy and have poor popularity, which requires certain technical personnel.
[0004] Regarding the problem in related technologies that the log collection solution cannot automatically determine whether the interface function call fails, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a method and device for sending alarm information, a storage medium and an electronic device, so as to at least solve the problem in the related art that the log collection solution cannot automatically determine whether the interface function call fails.
[0006] According to an embodiment of the embodiments of the present application, a method for sending alarm information is provided, including: obtaining execution information of a target operation through a log collection module, wherein the log collection module is integrated in a target application in the form of a dependency, and the target operation is an operation performed by the target application based on a target request; determining whether a target interface is successfully called according to the execution information, wherein the target interface is an interface corresponding to the target operation; and sending alarm information to a terminal device in case the target interface is not successfully called, wherein the terminal device is a device for configuring the target application.
[0007] In an exemplary embodiment, determining whether the target interface is successfully called based on the execution information includes: determining whether the execution information contains error information; when the execution information contains the error information, determining the error type corresponding to the error information; determining whether the target interface is successfully called based on the error type and a preset whitelist, wherein the preset whitelist includes: multiple error types.
[0008] In an exemplary embodiment, determining whether the target interface is called successfully based on the error type and the preset whitelist includes: determining whether the error type is an error type in the preset whitelist; if the error type is an error type in the preset whitelist, determining that the target interface is called successfully; if the error type is not an error type in the preset whitelist, determining that the target interface is not called successfully.
[0009] In an exemplary embodiment, after determining whether the execution information contains error information, the method further includes: if the execution information does not contain error information, determining whether a return value field is configured in the execution information template, wherein the execution information template is a template corresponding to the execution information; and if the return value field is not configured in the execution information template, determining that the target interface is successfully called.
[0010] In an exemplary embodiment, after determining whether a return value field is configured in an execution information template, the method further includes: in a case where the return value field is configured in the execution information template, determining whether a return value identification field is configured in the execution information template; in a case where the return value identification field is not configured in the execution information template, obtaining a first return value in the return value field in the execution information; determining whether the first return value is a first preset return value; in a case where the first return value is the first preset return value, determining that the target interface is successfully called; in a case where the first return value is not the first preset return value, determining that the target interface is not successfully called.
[0011] In an exemplary embodiment, after determining whether the return value identification field is configured in the execution information template, the method also includes: when the return value identification field is configured in the execution information template, determining the return value identification corresponding to the return value identification field in the execution information, and obtaining the second return value in the return value field corresponding to the return value identification; determining whether the second return value is the second preset return value; when the second return value is the second preset return value, determining that the target interface is successfully called; when the second return value is not the second preset return value, determining that the target interface is not successfully called.
[0012] In an exemplary embodiment, after determining whether the target interface is called successfully based on the execution information, the method also includes: if it is determined that the target interface is not called successfully, marking the operation log corresponding to the target operation as an abnormal log; if it is determined that the target interface is called successfully, marking the operation log corresponding to the target operation as a normal log.
[0013] According to another embodiment of the embodiments of the present application, a device for sending alarm information is also provided, including: an acquisition module, used to acquire execution information of a target operation through a log collection module, wherein the log collection module is integrated in a target application in the form of a dependency, and the target operation is an operation performed by the target application based on a target request; a determination module, used to determine whether a target interface is successfully called based on the execution information, wherein the target interface is an interface corresponding to the target operation; a sending module, used to send alarm information to a terminal device if the target interface is not successfully called, wherein the terminal device is a device for configuring the target application.
[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for sending alarm information when running.
[0015] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for sending alarm information through the computer program.
[0016] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the above-mentioned method for sending alarm information is implemented.
[0017] In an embodiment of the present application, the execution information of the target operation is obtained through a log collection module, wherein the log collection module is integrated into the target application in the form of a dependency, and the target operation is the operation performed by the target application based on the target request; whether the target interface is successfully called is determined according to the execution information, wherein the target interface is the interface corresponding to the target operation; in the case of unsuccessful calling of the target interface, an alarm message is sent to a terminal device, wherein the terminal device is a device for configuring the target application; the above technical solution is adopted to solve the problem that the log collection solution cannot automatically determine whether the interface function fails to be called. In an embodiment of the present application, the log collection module is integrated into the target application in the form of a dependency, automatic configuration and dependency injection are realized, and whether the interface is successfully called is determined based on the log collection module, thereby simplifying the configuration and maintenance of the alarm collection tool. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 It is a hardware environment diagram of a method for sending alarm information in an embodiment of the present application;
[0021] Figure 2 is a flowchart of a method for sending alarm information according to an embodiment of the present application;
[0022] Figure 3 is a timing diagram of a method for sending alarm information according to an embodiment of the present application;
[0023] Figure 4 is a structural block diagram of a device for sending alarm information according to an embodiment of the present application (I);
[0024] Figure 5 This is a structural block diagram (II) of a device for sending alarm information according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] According to one aspect of an embodiment of the present application, a method for sending alarm information is provided. The method for sending alarm information is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for sending alarm information can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0028] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0029] In this embodiment, a method for sending alarm information is provided, which is applied to the above terminal device. Figure 2 : is a flowchart of a method for sending alarm information according to an embodiment of the present application, the process includes the following steps:
[0030] Step S202, acquiring execution information of a target operation through a log collection module, wherein the log collection module is integrated into a target application in the form of a dependency, and the target operation is an operation performed by the target application based on a target request;
[0031] The above target application can be understood as a springboot application, and the above dependencies can be understood as Starter.
[0032] Step S204, determining whether the target interface is successfully called according to the execution information, wherein the target interface is the interface corresponding to the target operation;
[0033] Step S206: If the target interface is not successfully called, an alarm message is sent to a terminal device, wherein the terminal device is a device configured with the target application.
[0034] Through the above steps, the execution information of the target operation is obtained through the log collection module, wherein the log collection module is integrated in the target application in the form of a dependency, and the target operation is the operation performed by the target application based on the target request; whether the target interface is successfully called is determined according to the execution information, wherein the target interface is the interface corresponding to the target operation; if the target interface is not successfully called, an alarm message is sent to the terminal device, wherein the terminal device is a device for configuring the target application, which solves the problem in the related art that the log collection scheme cannot automatically determine whether the interface function fails to be called, and the embodiment of the present application integrates the log collection module into the target application in the form of a dependency, realizes automatic configuration and dependency injection, and determines whether the interface is successfully called based on the log collection module, thereby simplifying the configuration and maintenance of the alarm collection tool.
[0035] Optionally, in order to better understand the above step S204, the above step S204 can be implemented in the following ways: determine whether the execution information contains error information; when the execution information contains the error information, determine the error type corresponding to the error information; determine whether the target interface is successfully called according to the error type and the preset whitelist, wherein the preset whitelist includes: multiple error types.
[0036] In an embodiment of the present application, when the execution information includes error information, the error type corresponding to the error information is determined, and whether the target interface is successfully called is determined based on a preset whitelist, wherein the preset whitelist includes multiple error types.
[0037] Specifically, determining whether the target interface is called successfully according to the preset whitelist includes: determining whether the error type is an error type in the preset whitelist; if the error type is an error type in the preset whitelist, determining that the target interface is called successfully; if the error type is not an error type in the preset whitelist, determining that the target interface is not called successfully.
[0038] It should be noted that the mainstream development method usually customizes different error types to handle data returns for verification failures and other situations. If the number of interface failures is counted according to the above scheme, the probability of false alarms is extremely high. A preset whitelist (also understood as an error whitelist) function is provided in the embodiment of the present application. If the error type of the interface is included in the preset whitelist, the error is not determined as an interface call failure. For example, if the BusinessException error is caused by the failure to pass the credential name and link, it will not be recorded as an error log, only the operation log will be recorded, reducing false alarms and saving the energy of operation and maintenance personnel.
[0039] Optionally, after determining whether the execution information contains error information, the following scheme needs to be executed: if the execution information does not contain error information, determine whether a return value field is configured in the execution information template, wherein the execution information template is a template corresponding to the execution information; if the return value field is not configured in the execution information template, determine that the target interface is successfully called.
[0040] It should be noted that the terminal sends the execution information according to the execution information template. Specifically, when the return value field is configured in the execution information template, the execution information to be returned includes: the return value; when the return value field is not configured in the execution information template, the execution information not to be returned includes: the return value. Therefore, when the execution information does not contain error information and the return value field is not configured in the execution information template, it is determined that the target interface is successfully called.
[0041] Further, when the return value field is configured in the execution information template, determine whether the return value identification field is configured in the execution information template; when the return value identification field is not configured in the execution information template, obtain the first return value in the return value field in the execution information; determine whether the first return value is the first preset return value; when the first return value is the first preset return value, determine that the target interface is successfully called; when the first return value is not the first preset return value, determine that the target interface is not successfully called.
[0042] That is, when the return value identification field is configured in the execution information template, the execution information to be returned includes: the return value identification; when the return value identification field is not configured in the execution information template, the execution information not to be returned includes: the return value identification.
[0043] When the return value field is configured in the execution information template and the return value identification field is not configured, it is necessary to determine whether the first return value in the return value field is the first preset return value. If the first return value in the return value field is the first preset return value, it is determined that the target interface is called successfully; otherwise, it is determined that the target interface is not called successfully.
[0044] For example, the first preset return value may be 0, 1, 2, ..., which is not limited in the embodiment of the present application.
[0045] Optionally, after determining whether the return value identification field is configured in the execution information template, it also includes: when the return value identification field is configured in the execution information template, determining the return value identification corresponding to the return value identification field in the execution information, and obtaining the second return value in the return value field corresponding to the return value identification; determining whether the second return value is the second preset return value; when the second return value is the second preset return value, determining that the target interface is successfully called; when the second return value is not the second preset return value, determining that the target interface is not successfully called.
[0046] That is to say, when the return value field is configured in the execution information template and the return value identification field is configured, it is necessary to judge whether the return value identification field corresponds to the return value identification field, and the second return value in the return value field corresponding to the return value identification field are the second preset return value. If the second return value in the return value field is the second preset return value, it is determined that the target interface is called successfully; otherwise, it is determined that the target interface is not called successfully.
[0047] It should be noted that, when the return value identifier field is configured, the return value identifier needs to correspond to the return value.
[0048] It should be noted that the first preset return value may be the same as or different from the second preset return value, and this is not limited in the comparison of the embodiment of the present application.
[0049] In the embodiment of the present application, this log collection tool is based on the spring framework, which is easy to integrate and convenient for the mainstream springboot development framework to be quickly integrated. The annotation method can collect logs in real time more quickly, and supports asynchronous data transmission such as RocketMq, which does not affect the timeliness of business functions. The success identification setting and the preset whitelist setting can more accurately judge the function operation status, and issue warnings in time, so that operation and maintenance can discover problems earlier than users. Complete log records can more accurately judge the cause of the error, improve operation and maintenance efficiency, and reduce operation and maintenance costs.
[0050] Optionally, after determining whether the target interface is called successfully according to the execution information, it also includes: if it is determined that the target interface is not called successfully, marking the operation log corresponding to the target operation as an abnormal log; if it is determined that the target interface is called successfully, marking the operation log corresponding to the target operation as a normal log.
[0051] In an embodiment of the present application, the log information of unsuccessful calling of the target interface is marked as an abnormal log, and the log of successful calling of the target interface is marked as a normal log.
[0052] In order to better understand the process of the above-mentioned method for sending the alarm information, the implementation method flow of the above-mentioned alarm information sending is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0053] In this embodiment, a method for sending alarm information is provided. Figure 3 is a timing diagram of a method for sending alarm information according to an embodiment of the present application, such as Figure 3 As shown, the embodiment of the present application includes a requester, a log collection module, an execution method module, and a log collection platform module, and the specific steps are as follows:
[0054] Step S1: Sending request information to the log collection module, wherein the request information is used to request the application to perform a target operation;
[0055] Step S2: the log collection module records the start time of the execution method, wherein the method is the method corresponding to the target operation;
[0056] Step S3: the log collection target passes the request to the corresponding execution method module;
[0057] Step S4: the execution method module executes the method;
[0058] Step S5: The log collection module obtains the return information or error information of the execution method module after the execution is completed;
[0059] Step S6: The log collection module records the method execution time and log information, and determines the success / failure flag in the returned information according to the algorithm;
[0060] Step S7: asynchronously push the sorted log information to the log collection platform;
[0061] Step S8.1: The log collection platform saves log information;
[0062] Step S8.2: Return the method result to the front-end request source.
[0063] Description of the configuration fields in this embodiment of the application:
[0064] 1. businessKey: business key. The same key name can be set for interfaces on the same process to facilitate the statistics of log information of the same process. For example, if the business opportunity conversion process records the business opportunity number, the full process flow path of the business opportunity can be queried based on the business opportunity number in the log information.
[0065] 2. successReturnName: success identifier (equivalent to the return value identifier in the above embodiment) and successReturnValue: success value (supports multiple) (equivalent to the return value in the above embodiment), used in combination. If this attribute is set, the return value of the attribute corresponding to the success identifier in the returned information is the same as the success value (successReturnValue) to determine whether the interface request is successful. If the code value in the returned information R is not equal to 1, it is determined that the interface call failed.
[0066] 3. whiteExceptionList: error whitelist (equivalent to the preset whitelist in the above embodiment), because the mainstream development method usually customizes different error types to handle data returns in cases such as verification failure. If the number of interface failures is counted in this way, the probability of false alarms is very high. This application provides an error whitelist function. If the interface error type is included in the error whitelist, the error is not judged as an interface call failure.
[0067] For example, if a BusinessException is reported because the credential name and link are not passed, it will not be recorded as an error log. Only the operation log will be recorded, reducing false alarms and saving the energy of operation and maintenance personnel.
[0068] 4. If the method itself does not have a return value, confirm whether the interface call is successful based on whether an error is reported, and log it.
[0069] The algorithm determines the success / failure flag in the returned information, including:
[0070] 1. If there is error information, determine whether the error information is included in the whiteExceptionList (error whitelist). If so, the interface call is determined to be successful; if not, the interface call is determined to be failed.
[0071] 2. If there is no error message, it can be divided into the following three situations:
[0072] (1) No return value information exists: In this case, if the interface does not report an error, the interface call is considered successful.
[0073] (2) The return value exists but is not an object: If the successReturnValue configuration exists, the successReturnValue setting value is matched to see if it contains the interface return value. If it does, the interface call is considered successful. If the successReturnValue configuration is not available, the "no return value information" judgment logic is followed.
[0074] It should be noted that the above objects can be understood as: success flag + success value.
[0075] (3) The return value exists and is an object: If successReturnName and successReturnValue are set, determine whether the value of the successReturnName attribute of the return value is included in successReturnValue. If it is included, the interface is judged to be successful; if not, the interface fails. If successReturnName and successReturnValue are not configured, the "no return value information" judgment logic is followed.
[0076] Through the embodiments of the present application, Starter is integrated into the Spring Boot application to achieve automatic configuration and dependency injection, thereby simplifying the configuration and maintenance of the alarm collection tool; it is tightly integrated into the Spring Boot ecosystem, so that the alarm collection tool can seamlessly collaborate with the business system to improve the stability and development efficiency of the overall application; it makes full use of Spring Boot's automatic configuration, dependency injection and other features to provide developers with a more convenient and efficient alarm collection solution; by simplifying the configuration and improving the integration, the workload and cost of long-term maintenance are reduced, making the alarm collection tool easier to manage; thereby ensuring timely and effective collection and response to alarm information, thereby improving the stability and reliability of the entire system.
[0077] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0078] Figure 4 is a structural block diagram of a device for sending alarm information according to an embodiment of the present application; Figure 4 As shown, including:
[0079] An acquisition module 42, configured to acquire execution information of a target operation through a log collection module, wherein the log collection module is integrated in a target application in the form of a dependency, and the target operation is an operation performed by the target application based on a target request;
[0080] A determination module 44, configured to determine whether a target interface is successfully called according to the execution information, wherein the target interface is an interface corresponding to the target operation;
[0081] The sending module 46 is used to send an alarm message to a terminal device when the target interface is not successfully called, wherein the terminal device is a device configured with the target application.
[0082] Through the above-mentioned device, the execution information of the target operation is obtained through the log collection module, wherein the log collection module is integrated in the target application in the form of a dependency, and the target operation is the operation performed by the target application based on the target request; whether the target interface is successfully called is determined according to the execution information, wherein the target interface is the interface corresponding to the target operation; if the target interface is not successfully called, an alarm message is sent to the terminal device, wherein the terminal device is a device for configuring the target application, which solves the problem in the related art that the log collection scheme cannot automatically determine whether the interface function call fails. The embodiment of the present application integrates the log collection module into the target application in the form of a dependency, realizes automatic configuration and dependency injection, and determines whether the interface is successfully called based on the log collection module, thereby simplifying the configuration and maintenance of the alarm collection tool.
[0083] In an exemplary embodiment, the determination module 44 is used to determine whether the execution information contains error information; when the execution information contains the error information, determine the error type corresponding to the error information; and determine whether the target interface is successfully called based on the error type and a preset whitelist, wherein the preset whitelist includes: multiple error types.
[0084] In an exemplary embodiment, the determination module 44 is used to determine whether the error type is an error type in the preset whitelist; if the error type is an error type in the preset whitelist, it is determined that the target interface is successfully called; if the error type is not an error type in the preset whitelist, it is determined that the target interface is not successfully called.
[0085] In an exemplary embodiment, a determination module 44 is used to determine whether a return value field is configured in an execution information template when the execution information does not contain error information, wherein the execution information template is a template corresponding to the execution information; and to determine whether the target interface is successfully called when the return value field is not configured in the execution information template.
[0086] In an exemplary embodiment, a determination module 44 is used to determine whether a return value identification field is configured in the execution information template when the return value field is configured in the execution information template; to obtain a first return value in the return value field in the execution information when the return value identification field is not configured in the execution information template; to determine whether the first return value is a first preset return value; to determine that the target interface is successfully called when the first return value is the first preset return value; and to determine that the target interface is not successfully called when the first return value is not the first preset return value.
[0087] In an exemplary embodiment, the determination module 44 is used to determine the return value identifier corresponding to the return value identifier field in the execution information when the return value identifier field is configured in the execution information template, and obtain the second return value in the return value field corresponding to the return value identifier; determine whether the second return value is a second preset return value; if the second return value is the second preset return value, determine that the target interface is successfully called; if the second return value is not the second preset return value, determine that the target interface is not successfully called.
[0088] In an exemplary embodiment, Figure 5 is a structural block diagram of a device for sending alarm information according to an embodiment of the present application; Figure 5 As shown, the above-mentioned device also includes: a recording module 52, which is used to mark the operation log corresponding to the target operation as an abnormal log when it is determined that the target interface is not called successfully; and mark the operation log corresponding to the target operation as a normal log when it is determined that the target interface is called successfully.
[0089] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0090] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0091] S1, obtaining execution information of a target operation through a log collection module, wherein the log collection module is integrated in a target application in the form of a dependency, and the target operation is an operation performed by the target application based on a target request;
[0092] S2, determining whether the target interface is successfully called according to the execution information, wherein the target interface is an interface corresponding to the target operation;
[0093] S3: If the target interface is not successfully called, send an alarm message to a terminal device, wherein the terminal device is a device for configuring the target application.
[0094] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0095] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0096] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0097] S1, obtaining execution information of a target operation through a log collection module, wherein the log collection module is integrated in a target application in the form of a dependency, and the target operation is an operation performed by the target application based on a target request;
[0098] S2, determining whether the target interface is successfully called according to the execution information, wherein the target interface is an interface corresponding to the target operation;
[0099] S3: If the target interface is not successfully called, send an alarm message to a terminal device, wherein the terminal device is a device for configuring the target application.
[0100] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0101] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0102] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0103] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.
[0104] Optionally, in this embodiment, the computer program product may be configured to perform the following steps through a computer program:
[0105] S1, obtaining execution information of a target operation through a log collection module, wherein the log collection module is integrated in a target application in the form of a dependency, and the target operation is an operation performed by the target application based on a target request;
[0106] S2, determining whether the target interface is successfully called according to the execution information, wherein the target interface is an interface corresponding to the target operation;
[0107] S3: If the target interface is not successfully called, send an alarm message to a terminal device, wherein the terminal device is a device for configuring the target application.
[0108] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0109] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0110] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for sending warning information, It is characterized in that include: Acquire execution information of a target operation through a log collection module, wherein the log collection module is integrated in a target application in the form of a dependency, and the target operation is an operation performed by the target application based on a target request; Determining whether a target interface is successfully called according to the execution information, wherein the target interface is an interface corresponding to the target operation; In case that the target interface is not successfully called, an alarm message is sent to a terminal device, wherein the terminal device is a device for configuring the target application.
2. The method for sending warning information according to claim 1, It is characterized in that Determining whether the target interface is successfully called according to the execution information includes: Determining whether the execution information includes error information; In a case where the execution information includes the error information, determining an error type corresponding to the error information; Determine whether the target interface is successfully called according to the error type and a preset whitelist, wherein the preset whitelist includes: multiple error types.
3. The method for sending warning information according to claim 2, It is characterized in that Determining whether the target interface is successfully called according to the error type and the preset whitelist includes: Determine whether the error type is an error type in the preset whitelist; In the case where the error type is an error type in the preset whitelist, determining that the target interface is successfully called; When the error type is not an error type in the preset whitelist, it is determined that the target interface is not successfully called.
4. The method for sending warning information according to claim 2, It is characterized in that After determining whether the execution information includes error information, the method further includes: In the case that the execution information does not include error information, determining whether a return value field is configured in an execution information template, wherein the execution information template is a template corresponding to the execution information; In a case where the return value field is not configured in the execution information template, it is determined that the target interface is successfully called.
5. The method for sending warning information according to claim 4, It is characterized in that After determining whether the return value field is configured in the execution information template, the method further includes: In the case where the return value field is configured in the execution information template, determining whether a return value identification field is configured in the execution information template; If the return value identification field is not configured in the execution information template, obtaining a first return value in the return value field in the execution information; Determining whether the first return value is a first preset return value; When the first return value is the first preset return value, determining that the target interface is successfully called; When the first return value is not the first preset return value, it is determined that the target interface is not successfully called.
6. The method for sending warning information according to claim 5, It is characterized in that After determining whether a return value identification field is configured in the execution information template, the method further includes: In the case where the return value identification field is configured in the execution information template, determining the return value identification corresponding to the return value identification field in the execution information, and acquiring the second return value in the return value field corresponding to the return value identification; Determining whether the second return value is a second preset return value; When the second return value is the second preset return value, determining that the target interface is successfully called; In a case where the second return value is not the second preset return value, it is determined that the target interface is not successfully called.
7. The method for sending warning information according to claim 1, It is characterized in that After determining whether the target interface is successfully called according to the execution information, the method further includes: In the case where it is determined that the target interface is not successfully called, marking the operation log corresponding to the target operation as an abnormal log; When it is determined that the target interface is successfully called, the operation log corresponding to the target operation is marked as a normal log.
8. A device for sending warning information, It is characterized in that include: An acquisition module, configured to acquire execution information of a target operation through a log collection module, wherein the log collection module is integrated in a target application in the form of a dependency, and the target operation is an operation performed by the target application based on a target request; A determination module, configured to determine whether a target interface is successfully called according to the execution information, wherein the target interface is an interface corresponding to the target operation; The sending module is used to send an alarm message to a terminal device when the target interface is not successfully called, wherein the terminal device is a device for configuring the target application.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, It is characterized in that A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
