System abnormality monitoring method, device, computer equipment and storage medium
DOM snapshot technology captures and locates error events in computer systems in real time, solving the problem of insufficient information in traditional technologies, and achieving rapid and accurate error handling and system response improvement.
Patent Information
- Application Number
- CN202010462855.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-27
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-05-27
AI Technical Summary
The prior art is difficult to accurately capture and locate error events in computer systems, especially when an exception occurs at the front end. The traditional error information collection method cannot provide sufficient positioning information, resulting in difficulty in reproducing and processing.
DOM snapshot technology is used to capture error events in the computer system in real time, and send them to designated personnel by generating error messages and DOM snapshots, providing sufficient information to facilitate problem location.
It realizes the rapid and accurate capture and positioning of error events in computer systems, reduces system burden, improves response speed, and reduces the losses caused by abnormal situations in production environments.
Smart Images

Figure CN111752793B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment and storage medium for monitoring system anomalies. Background Art
[0002] With the development of computer technology, computers have gradually become popular in people's lives. When users use a specific system in computing, if they encounter a bug in the system, it is difficult to reproduce and trace the error location.
[0003] The traditional way of collecting error information cannot provide enough positioning information, especially when anomalies occur on the front end. At the same time, although traditional business monitoring tools can provide some information about error events, the error information they provide is relatively small, making it difficult to reproduce and unable to provide sufficient information to accurately locate the error. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a system abnormality monitoring method, apparatus, computer equipment and storage medium to accurately capture computer error events, while providing sufficient relevant error information and improving the computer's response speed.
[0005] In order to solve the above technical problems, the embodiment of the present application provides a method for monitoring system abnormalities, which adopts the following technical solutions:
[0006] A method for monitoring system abnormalities comprises the following steps:
[0007] When it is detected that a user logs into the target system, at least one DOM snapshot is generated for the user's operation process on the page in the target system according to preset rules;
[0008] Monitoring the target system and capturing error events of the front end of the target system in real time;
[0009] When the error event is captured, an error message is generated, and a corresponding DOM snapshot is obtained according to the error message, and the error message and the corresponding DOM snapshot are sent to a designated person.
[0010] Furthermore, the step of generating at least one DOM snapshot for the user's operation process on the page in the target system according to a preset rule includes:
[0011] Record the user's operation process on the target system page according to the preset rules, and record the corresponding page name to generate at least one DOM snapshot;
[0012] When the error event is captured, the steps of generating error information and obtaining a corresponding DOM snapshot according to the error information include:
[0013] When the error event is captured, the name of the current error page where the error event currently occurs is obtained, error information is generated according to the name of the current error page, and the error information is stored;
[0014] According to the current error page name, detecting whether a DOM snapshot containing the current error page name has been generated;
[0015] If it has been generated, get the corresponding DOM snapshot;
[0016] If not, check whether the page name of the DOM snapshot currently being drawn includes the current error page name. If so, obtain the content in the DOM snapshot currently being drawn and generate a DOM snapshot copy as the corresponding DOM snapshot. If not, obtain all DOM snapshots drawn after the user logs into the target system and the DOM snapshot currently being drawn, sort them in the order of generation, and splice them into a complete DOM snapshot as the corresponding DOM snapshot.
[0017] Furthermore, the DOM snapshot carries time period information, and the time period information is a period of time from when the DOM snapshot is drawn to when the DOM snapshot is drawn. When the error event is captured, the name of the current error page where the error event currently occurs is obtained, and the step of generating error information according to the current error page name includes:
[0018] When the error event is captured, the current error page name and error reporting time of the error event are obtained, and error reporting information is generated according to the current error page name and error reporting time;
[0019] If it has been generated, the step of obtaining the corresponding DOM snapshot includes:
[0020] If it has been generated, then check whether the error reporting time exists in the time period information, and if so, obtain the corresponding DOM snapshot;
[0021] If so, the steps of obtaining the content in the DOM snapshot currently being drawn and generating a DOM snapshot copy as the corresponding DOM snapshot include:
[0022] If so, all contents in the DOM snapshot currently being drawn before the error reporting time are obtained, and a DOM snapshot copy is generated as the corresponding DOM snapshot.
[0023] Furthermore, the step of generating at least one DOM snapshot for the user's operation process on the page in the system according to the preset rules includes:
[0024] Generate a DOM snapshot for all operations performed by the user on each current page of the system, or generate a DOM snapshot for the user's operation process on the page in the system in sequence according to a preset time interval.
[0025] Furthermore, the step of real-time capturing of error events on the front end of the target system includes:
[0026] The error events of the front end of the target system are captured in real time through the SDK of the pre-configured real-time error capture tool.
[0027] Furthermore, after the step of generating at least one DOM snapshot for the user's operation process on the page in the system according to the preset rules, the method further includes: regularly cleaning up the DOM snapshots whose storage time exceeds the preset time period.
[0028] Further, when the error event is captured, an error message is generated, a corresponding DOM snapshot is obtained according to the error message, and the step of sending the error message and the corresponding DOM snapshot to a designated person includes:
[0029] When the error event is captured, an error message is generated, and a corresponding DOM snapshot is obtained according to the error message;
[0030] Call the preset feedback pop-up window API to display the feedback pop-up window on the current page of the front end;
[0031] When it is detected that the user inputs feedback data in the feedback pop-up window, the feedback data is obtained;
[0032] The obtained error information, DOM snapshot and feedback data are compressed and sent to the designated person via email.
[0033] In order to solve the above technical problems, the embodiment of the present application further provides a system abnormality monitoring device, which adopts the following technical solution:
[0034] A monitoring device for system abnormality, comprising:
[0035] A generation module is used to generate at least one DOM snapshot of the user's operation process on the page in the target system according to preset rules after detecting that the user has logged into the target system;
[0036] A capture module, used to monitor the target system and capture error events of the front end of the target system in real time; and
[0037] The acquisition module is used to generate error information when the error event is captured, obtain the corresponding DOM snapshot according to the error information, and send the error information and the corresponding DOM snapshot to a designated person.
[0038] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0039] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned system abnormality monitoring method when executing the computer program.
[0040] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0041] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-mentioned system abnormality monitoring method.
[0042] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0043] When an exception occurs on the front end, the error message can be immediately notified to the designated personnel, and sufficient information will be provided through DOM snapshots to help locate the problem. The use of DOM snapshots instead of the traditional method of recording large amounts of log data reduces the burden on the computer and improves the computer's response speed. It also makes it easier for relevant technical personnel to quickly locate and handle problems, thereby reducing the losses caused by bugs or abnormal situations in the production environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0045] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0046] Figure 2 A flowchart of an embodiment of a method for monitoring system abnormalities according to the present application;
[0047] Figure 3 is a structural schematic diagram of an embodiment of a monitoring device for system abnormality according to the present application;
[0048] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application.
[0049] Figure numerals: 200, computer equipment; 201, memory; 202, processor; 203, network interface; 300, system abnormality monitoring device; 301, generation module; 302, capture module; 303, acquisition module. DETAILED DESCRIPTION
[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0051] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0052] 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 accompanying drawings.
[0053] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0054] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0055] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.
[0056] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0057] It should be noted that the system abnormality monitoring method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the system abnormality monitoring device is generally set in the server / terminal device.
[0058] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0059] Continue to refer Figure 2 , shows a flow chart of an embodiment of a method for monitoring system abnormalities according to the present application. The method for monitoring system abnormalities comprises the following steps:
[0060] S1: When it is detected that a user logs into the system, at least one DOM snapshot is generated for the user's operation process on the page in the system according to preset rules.
[0061] In this embodiment, by generating a DOM (Document Object Mode) snapshot, the computer records the user's operation process on the page in the system.
[0062] At the same time, by recording operation information in the form of DOM snapshots, it is also possible to collect agent operation habits, which is helpful for product optimization and improvement and improves the operating efficiency of agents.
[0063] Among them, in step S1, the step of generating at least one DOM snapshot for the user's operation process on the page in the system according to the preset rules includes:
[0064] Generate a DOM snapshot for all operations performed by the user on each current page of the system.
[0065] In this embodiment, a DOM snapshot is generated corresponding to all operations of the user in the current page of the system, and a DOM snapshot is generated corresponding to all operations of the user in the next page of the system, so as to realize recording the user's operation process. For example: when the agent logs in to the telephone sales system, the front-end DOM snapshot is triggered to start generating, and a complete DOM snapshot at that moment is drawn. The generated snapshots can be associated and sorted by time to facilitate subsequent viewing. At the same time, compared with the method of generating only one snapshot for all operations of the user in the system, the realization of splitting all the user's operation processes into multiple snapshots for recording and storage is equivalent to splitting the original operation log into multiple short logs. This method has low requirements on the size of server memory and is suitable for a variety of different servers.
[0066] Alternatively, in step S1, the step of generating at least one DOM snapshot for the user's operation process on a page in the system according to a preset rule includes:
[0067] A DOM snapshot is generated according to the preset time interval for each user's operation process on the page in the system.
[0068] In this embodiment, DOM snapshots are drawn at fixed time intervals, which facilitates subsequent search for DOM snapshots and tracing of user operation processes.
[0069] Further, in step S1, that is, after the step of generating at least one DOM snapshot according to the preset rules for the user's operation process on the page in the system, it also includes: regularly cleaning up DOM snapshots whose storage time exceeds the preset time period.
[0070] In this embodiment, the DOM snapshots can be cleaned up regularly through a scheduled task to reduce the required memory size.
[0071] S2: Monitor the target system and capture error events of the front end of the target system in real time.
[0072] In this embodiment, the operation of the target system is monitored by the Sentry (an open source real-time error capture tool) business monitoring tool, and when an error event occurs, it can be captured in real time. A common capture form is to capture errors. If something that seems abnormal appears, it can be captured, such as a sudden freeze of the page, no response from the system after the user clicks a menu or button, a blank pop-up window, and a page load failure.
[0073] Specifically, in step S2, the step of real-time capturing of error events on the front end of the target system includes:
[0074] The front end of the target system is subjected to real-time capture of error events through the SDK of a pre-configured real-time error capture tool.
[0075] In this embodiment, the SDK of Sentry is referenced through javascript. Among them, the SDK is自带 by Sentry, and Sentry captures data by using the SDK when the application is running. The command to reference the SDK can be: pip install--upgrade sentry-sdk==0.10.2. In this application, the SDK of Sentry is added to the front-end code, and Sentry is initialized by passing a parameter object to the init() method. The specific command can be: import sentry_sdk, sentry_sdk.init("https: / / ae5f2eaff8404dbdb2e0d75f7466449d@sentry.i o / mine"). By referencing the SDK of the real-time error capture tool for error event capture, the capture efficiency is improved.
[0076] S3: When the error event is captured, an error message is generated, and a corresponding DOM snapshot is obtained according to the error message, and the error message and the corresponding DOM snapshot are sent to the designated person.
[0077] In this embodiment, the Sentry business log monitoring tool is integrated. When an exception occurs in the front end, Sentry can capture the error information in the first time and generate an error message to achieve real-time monitoring and capture of error events. At the same time, a DOM snapshot of the relevant error event is provided, and the information provided is sufficient to facilitate relevant technical personnel to analyze and locate problems. At the same time, a recording function can be added to record the operation process of the user in the front end. If an error occurs during the generation of the DOM snapshot, the recording function can make up for the possible lack of information provided. This application can well help developers analyze and locate problems, thereby reducing the losses caused by bugs or abnormal situations in the production environment.
[0078] Specifically, in step S1, that is, the step of generating at least one DOM snapshot according to the preset rules for the operation process of the user on the page in the target system includes:
[0079] Record the operation process of the user on the page in the target system according to the preset rules, and record the corresponding page name to generate at least one DOM snapshot;
[0080] In step S3, that is, when the error event is captured, the step of generating an error message and obtaining a corresponding DOM snapshot according to the error message includes:
[0081] When the error event is captured, the name of the current error page where the error event currently occurs is obtained, error information is generated according to the name of the current error page, and the error information is stored;
[0082] According to the current error page name, detecting whether a DOM snapshot containing the current error page name has been generated;
[0083] If it has been generated, get the corresponding DOM snapshot;
[0084] If not, check whether the page name of the DOM snapshot currently being drawn includes the current error page name. If so, obtain the content in the DOM snapshot currently being drawn and generate a DOM snapshot copy as the corresponding DOM snapshot. If not, obtain all DOM snapshots drawn after the user logs into the target system and the DOM snapshot currently being drawn, sort them in the order of generation, and splice them into a complete DOM snapshot as the corresponding DOM snapshot.
[0085] In this embodiment, if it is not generated, and the page name of the DOM snapshot currently being drawn does not include the current error page name, then all DOM snapshots drawn after the user logs into the target system and the DOM snapshot currently being drawn are obtained, sorted in the order of generation, and spliced into a complete DOM snapshot as the DOM snapshot corresponding to the error event, which is sent to the designated person together with the error message. Of course, the above splicing method can also be not adopted, but all DOM snapshots and the DOM snapshot currently being drawn are sorted in the order of generation and compressed into a file for sending. If the DOM snapshot is generated according to the above method of "generating a DOM snapshot corresponding to all operations of the user in each current page of the system", the DOM snapshot carries one and only one page name; if the DOM snapshot is generated according to the above method of "generating a DOM snapshot corresponding to the operation process of the user on the page in the system according to the preset time interval", the DOM snapshot carries at least one page name. Determining the corresponding DOM snapshot by the page name is simple and fast, and improves the judgment and response speed of the computer.
[0086] More specifically, the DOM snapshot carries time period information, and the time period information is a period of time from when the DOM snapshot is drawn to when the DOM snapshot is drawn. When the error event is captured, the name of the current error page where the error event currently occurs is obtained, and the step of generating error information according to the current error page name includes:
[0087] When the error event is captured, the current error page name and error reporting time of the error event are obtained, and error reporting information is generated according to the current error page name and error reporting time;
[0088] If it has been generated, the step of obtaining the corresponding DOM snapshot includes:
[0089] If it has been generated, then check whether the error reporting time exists in the time period information, and if so, obtain the corresponding DOM snapshot;
[0090] If so, the steps of obtaining the content in the DOM snapshot currently being drawn and generating a DOM snapshot copy as the corresponding DOM snapshot include:
[0091] If so, all contents in the DOM snapshot currently being drawn before the error reporting time are obtained, and a DOM snapshot copy is generated as the corresponding DOM snapshot.
[0092] In this embodiment, verification is performed by adding a time period to ensure that the acquired DOM snapshot has a corresponding relationship with the error event, further preventing the occurrence of computer acquisition errors, wherein all the content in the above DOM snapshot before the error time may include operation traces, time, page name and other information.
[0093] In particular, in step S3, when the error event is captured, an error message is generated, and a corresponding DOM snapshot is obtained according to the error message, and the step of sending the error message and the corresponding DOM snapshot to a designated person includes:
[0094] When the error event is captured, an error message is generated, and a corresponding DOM snapshot is obtained according to the error message;
[0095] Call the preset feedback pop-up window API to display the feedback pop-up window on the current page of the front end;
[0096] When it is detected that the user inputs feedback data in the feedback pop-up window, the feedback data is obtained;
[0097] The obtained error information, DOM snapshot and feedback data are compressed and sent to the designated person via email.
[0098] In this embodiment, when an error event is captured, the user's feedback is obtained through a feedback pop-up window to provide more help. By configuring the email template and the email sending mechanism, the relevant error information is sent to the relevant technical personnel through email, and the email carries enough information to help locate the problem. In addition, the relevant technical personnel can also use stack tracking, the last error event monitored, the pre-marking of places where problems may occur (the computer can mark the places where problems have occurred multiple times based on the processed historical error locations), the data captured by Sentry when the error occurs (including the user ID, url, etc. when the error occurs) and the DOM snapshot short log information to comprehensively analyze and locate the problem, reduce the time required to locate the problem, and thus reduce the loss caused by bugs or abnormal situations in the production environment. In this application, the Sentry business log monitoring tool also includes many APIs, such as alarm levels, tag settings, breadcrumbs (traces of events that occurred before the problem occurred) and other APIs available for use.
[0099] In this embodiment, the system abnormality monitoring method is executed on the electronic device (eg Figure 1 The server / terminal device shown in the figure can send the error information and the corresponding DOM snapshot to the designated person through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.
[0100] This application can prompt error information to the designated personnel immediately when an exception occurs at the front end, and provide clearer and more sufficient information through DOM snapshots to help locate the problem. The DOM snapshot method is used instead of the traditional method of recording a large amount of log data, which reduces the burden on the computer and improves the computer's response speed. At the same time, it is convenient for relevant technical personnel to quickly locate and handle problems, thereby reducing the losses caused by bugs or abnormal situations in the production environment.
[0101] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0102] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0103] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a monitoring device for system abnormality, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0104] like Figure 3 As shown, the monitoring device 300 for system anomalies described in this embodiment includes: a generating module 301, a capturing module 302 and an acquiring module 303. Among them: the generating module 301 is used to generate at least one DOM snapshot of the user's operation process on the page in the target system according to a preset rule after detecting that the user logs in to the target system; the capturing module 302 is used to monitor the target system and perform real-time capture of error events on the front end of the target system; the acquiring module 303 is used to generate error information when the error event is captured, and obtain the corresponding DOM snapshot according to the error information, and send the error information and the corresponding DOM snapshot to a designated person.
[0105] In this embodiment, when an exception occurs at the front end, the error message can be prompted to notify the designated personnel immediately, and sufficient information can be provided through the DOM snapshot to help locate the problem. The DOM snapshot method is used instead of the traditional method of recording a large amount of log data, which reduces the burden on the computer and improves the computer's response speed. At the same time, it is convenient for relevant technical personnel to quickly locate and handle problems, thereby reducing the losses caused by bugs or abnormal situations in the production environment.
[0106] In some optional implementations of this embodiment, the generation module 301 is further used to generate a DOM snapshot corresponding to all operations of the user in each current page of the system. In another embodiment of the present application, the generation module 301 can also be used to generate a DOM snapshot corresponding to the operation process of the user on the page in the system in sequence according to a preset time interval. The capture module 302 is further used to capture the error event of the front end of the target system in real time through the SDK of the pre-configured real-time error capture tool.
[0107] Furthermore, the generation module 301 is used to record the operation process of the user on the page in the target system according to the preset rules, and record the corresponding page name to generate at least one DOM snapshot. The acquisition module 303 includes a first acquisition submodule, a detection submodule, a second acquisition submodule and a third acquisition submodule; wherein the first acquisition submodule is used to acquire the current error page name where the error event currently occurs when the error event is captured, generate error information according to the current error page name, and store the error information; the detection submodule is used to detect whether a DOM snapshot containing the current error page name has been generated according to the current error page name; the second acquisition submodule is used to acquire the corresponding DOM snapshot when a DOM snapshot containing the current error page name has been generated. The third acquisition submodule is used to detect whether the page name of the DOM snapshot currently being drawn includes the current error page name when the DOM snapshot whose page name includes the current error page name has not been generated; when the page name of the DOM snapshot being drawn includes the current error page name, obtain the content in the DOM snapshot currently being drawn and generate a DOM snapshot copy as the corresponding DOM snapshot; when the page name of the DOM snapshot being drawn does not include the current error page name, obtain all DOM snapshots drawn after the user logs into the target system and the DOM snapshot currently being drawn, sort them in the order of generation, and splice them into a complete DOM snapshot as the corresponding DOM snapshot.
[0108] In particular, the DOM snapshot carries time period information, and the time period information is a period of time from the start of drawing the DOM snapshot to the completion of drawing the DOM snapshot. The second acquisition submodule includes a detection unit and an acquisition unit; the detection unit is used to detect whether the error time exists in the time period information when a DOM snapshot whose page name includes the current error page name has been generated. The acquisition unit is used to obtain the corresponding DOM snapshot when the error time exists in the time period information. The third acquisition submodule is also used to obtain all the contents before the error time in the DOM snapshot currently being drawn when the page name of the DOM snapshot being drawn includes the current error page name, and generate a DOM snapshot copy as the corresponding DOM snapshot.
[0109] The acquisition module 303 also includes a calling submodule, a feedback submodule and a sending submodule; wherein the calling submodule is used to call a preset feedback pop-up window API to display the feedback pop-up window to the current page of the front end; the feedback submodule is used to obtain the feedback data after detecting that the user enters feedback data in the feedback pop-up window; the sending submodule is used to compress the obtained error information, DOM snapshot and feedback data, and send it to the designated person via email.
[0110] In some optional implementations of this embodiment, the apparatus 300 further includes: a clearing module, configured to periodically clear DOM snapshots whose storage time exceeds a preset time period.
[0111] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0112] The computer device 200 includes a memory 201, a processor 202, and a network interface 203 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 200 having components 201-203, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0113] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0114] The memory 201 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 201 can be an internal storage unit of the computer device 200, such as a hard disk or memory of the computer device 200. In other embodiments, the memory 201 can also be an external storage device of the computer device 200, such as a plug-in hard disk equipped on the computer device 200, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 201 can also include both the internal storage unit of the computer device 200 and its external storage device. In this embodiment, the memory 201 is generally used to store the operating system and various application software installed on the computer device 200, such as program codes of a system abnormality monitoring method, etc. In addition, the memory 201 can also be used to temporarily store various data that have been output or will be output.
[0115] The processor 202 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 202 is generally used to control the overall operation of the computer device 200. In this embodiment, the processor 202 is used to run the program code stored in the memory 201 or process data, such as running the program code of the monitoring method for the system abnormality.
[0116] The network interface 203 may include a wireless network interface or a wired network interface. The network interface 203 is generally used to establish a communication connection between the computer device 200 and other electronic devices.
[0117] In this embodiment, error information is promptly notified to designated personnel, and sufficient information is provided through DOM snapshots to help locate the problem. The DOM snapshot method is used instead of the traditional method of recording a large amount of log data, which reduces the burden on the computer, improves the computer's response speed, and makes it easier for relevant technical personnel to quickly locate and handle problems.
[0118] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores a system abnormality monitoring program, and the system abnormality monitoring program can be executed by at least one processor so that the at least one processor performs the steps of the system abnormality monitoring method as described above.
[0119] In this embodiment, error information is promptly notified to designated personnel, and sufficient information is provided through DOM snapshots to help locate the problem. The DOM snapshot method is used instead of the traditional method of recording a large amount of log data, which reduces the burden on the computer, improves the computer's response speed, and makes it easier for relevant technical personnel to quickly locate and handle problems.
[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods 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, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0121] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A method for monitoring system abnormality, characterized in that: The steps include: When it is detected that a user logs into the target system, at least one DOM snapshot is generated for the user's operation process on the page in the target system according to preset rules; Monitoring the target system and capturing error events of the front end of the target system in real time; When the error event is captured, an error message is generated, and a corresponding DOM snapshot is obtained according to the error message, and the error message and the corresponding DOM snapshot are sent to a designated person; The step of generating at least one DOM snapshot for the user's operation process on the page in the target system according to the preset rules includes: Record the user's operation process on the target system page according to the preset rules, and record the corresponding page name to generate at least one DOM snapshot; When the error event is captured, the steps of generating error information and obtaining a corresponding DOM snapshot according to the error information include: When the error event is captured, the name of the current error page where the error event currently occurs is obtained, error information is generated according to the name of the current error page, and the error information is stored; According to the current error page name, detecting whether a DOM snapshot containing the current error page name has been generated; If it has been generated, get the corresponding DOM snapshot; If not, check whether the page name of the DOM snapshot currently being drawn includes the name of the current error page. If so, obtain the content in the DOM snapshot currently being drawn, generate a DOM snapshot copy as the corresponding DOM snapshot. If not, obtain all DOM snapshots drawn after the user logs into the target system and the DOM snapshot currently being drawn, sort them in the order of generation, and splice them into a complete DOM snapshot as the corresponding DOM snapshot. The DOM snapshot carries time period information, and the time period information is a period of time from when the DOM snapshot is drawn to when the DOM snapshot is drawn. When the error event is captured, the name of the current error page where the error event currently occurs is obtained, and the step of generating error information according to the current error page name includes: When the error event is captured, the current error page name and error reporting time of the error event are obtained, and error reporting information is generated according to the current error page name and error reporting time; If it has been generated, the step of obtaining the corresponding DOM snapshot includes: If it has been generated, then check whether the error reporting time exists in the time period information, and if so, obtain the corresponding DOM snapshot; If so, the steps of obtaining the content in the DOM snapshot currently being drawn and generating a DOM snapshot copy as the corresponding DOM snapshot include: If so, all contents in the DOM snapshot currently being drawn before the error reporting time are obtained, and a DOM snapshot copy is generated as the corresponding DOM snapshot.
2. The system abnormality monitoring method according to claim 1, characterized in that: The steps of generating at least one DOM snapshot for the user's operation process on the page in the system according to the preset rules include: Generate a DOM snapshot for all operations performed by the user on each current page of the system, or generate a DOM snapshot for the user's operation process on the page in the system in sequence according to a preset time interval.
3. The system abnormality monitoring method according to claim 1, characterized in that: The step of real-time capturing of error events on the front end of the target system comprises: The error events of the front end of the target system are captured in real time through the SDK of the pre-configured real-time error capture tool.
4. The method for monitoring system abnormality according to claim 1, characterized in that: After the step of generating at least one DOM snapshot according to the preset rules for the user's operation process on the page in the system, the method further includes: regularly cleaning up DOM snapshots whose storage time exceeds the preset time length.
5. The method for monitoring system abnormality according to claim 1, characterized in that: When the error event is captured, an error message is generated, a corresponding DOM snapshot is obtained according to the error message, and the step of sending the error message and the corresponding DOM snapshot to a designated person includes: When the error event is captured, an error message is generated, and a corresponding DOM snapshot is obtained according to the error message; Call the preset feedback pop-up window API to display the feedback pop-up window on the current page of the front end; When it is detected that the user inputs feedback data in the feedback pop-up window, the feedback data is obtained; The obtained error information, DOM snapshot and feedback data are compressed and sent to the designated person via email.
6. A system abnormality monitoring device, characterized in that: include: A generation module is used to generate at least one DOM snapshot of the user's operation process on the page in the target system according to preset rules after detecting that the user has logged into the target system; A capture module, used to monitor the target system and capture error events of the front end of the target system in real time; as well as An acquisition module, used for generating error information when the error event is captured, obtaining a corresponding DOM snapshot according to the error information, and sending the error information and the corresponding DOM snapshot to a designated person; At least one DOM snapshot is generated based on the preset rules for the user's operation process on the page in the target system, including: Record the user's operation process on the target system page according to the preset rules, and record the corresponding page name to generate at least one DOM snapshot; When the error event is captured, error information is generated, and a corresponding DOM snapshot is obtained according to the error information, including: When the error event is captured, the name of the current error page where the error event currently occurs is obtained, error information is generated according to the name of the current error page, and the error information is stored; According to the current error page name, detecting whether a DOM snapshot containing the current error page name has been generated; If it has been generated, get the corresponding DOM snapshot; If not, check whether the page name of the DOM snapshot currently being drawn includes the name of the current error page. If so, obtain the content in the DOM snapshot currently being drawn, generate a DOM snapshot copy as the corresponding DOM snapshot. If not, obtain all DOM snapshots drawn after the user logs into the target system and the DOM snapshot currently being drawn, sort them in the order of generation, and splice them into a complete DOM snapshot as the corresponding DOM snapshot. The DOM snapshot carries time period information, which is a period of time from when the DOM snapshot is drawn to when the DOM snapshot is drawn. When the error event is captured, the name of the current error page where the error event currently occurs is obtained, and the error information generated according to the current error page name includes: When the error event is captured, the current error page name and error reporting time of the error event are obtained, and error reporting information is generated according to the current error page name and error reporting time; If it has been generated, obtaining the corresponding DOM snapshot includes: If it has been generated, then check whether the error reporting time exists in the time period information, and if so, obtain the corresponding DOM snapshot; If so, the content in the DOM snapshot currently being drawn is obtained, and a DOM snapshot copy is generated as the corresponding DOM snapshot including: If so, all contents in the DOM snapshot currently being drawn before the error reporting time are obtained, and a DOM snapshot copy is generated as the corresponding DOM snapshot.
7. A computer device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the method for monitoring system abnormalities as claimed in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for monitoring system abnormalities according to any one of claims 1 to 5 are implemented.
