Front-end error log collection method, device, equipment and storage medium

By generating event monitoring requests and receiving feedback packets, and filtering target logs, the problem of difficulty in obtaining comprehensive front-end error information in the existing technology is solved, and the accurate location of production problems and the improvement of fault location efficiency are achieved.

CN112685253BActive Publication Date: 2024-09-27SHENZHEN SHENQUAN INTERACTIVE TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202011601565.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-29
Publication Date
2024-09-27
Estimated Expiration
2040-12-29

AI Technical Summary

Technical Problem

It is difficult to obtain comprehensive front-end error information with existing technology, resulting in the inability to accurately locate production problems.

Method used

By generating event monitoring requests, sending and receiving monitoring feedback packets to the preset browser, determining the feedback webpage and its feedback frequency, filtering the target logs to extract error logs, and obtaining comprehensive error information.

Benefits of technology

It achieves comprehensive acquisition of front-end error information, helps accurately locate production problems, and improves fault location efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112685253B
    Figure CN112685253B
Patent Text Reader

Abstract

The present invention relates to cloud monitoring, and provides a front-end error log collection method, device, equipment and storage medium. The method can generate an event monitoring request based on a preset event, and send the event monitoring request to a preset browser; receive a monitoring feedback package generated based on the event monitoring request; determine a feedback webpage according to the monitoring feedback package, and determine the feedback frequency of the feedback webpage; if the feedback frequency is greater than a configuration value, determine the generation time of the monitoring feedback package, and determine the trigger terminal of the monitoring feedback package; filter the target log from the trigger terminal according to the generation time; extract the error log from the target log according to the feedback webpage. The present invention can obtain comprehensive error information. In addition, the present invention also relates to blockchain technology, and the error log can be stored in a blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud monitoring technology, and in particular to a front-end error log collection method, device, equipment and storage medium. Background Art

[0002] Currently, the front-end project will be fully tested before it goes online. However, when unpredictable problems occur in the device, browser, network environment, etc. where the front-end page runs, the front-end page will still fail to run. In order to locate the cause of the front-end page failure, we currently use point tracking in the front-end project to obtain error information. However, the error information obtained through point tracking is not comprehensive enough, and thus it is impossible to accurately locate the production problem.

[0003] Therefore, how to obtain comprehensive error information to accurately locate production problems has become an issue that needs to be solved urgently. Summary of the invention

[0004] In view of the above, it is necessary to provide a front-end error log collection method, device, equipment and storage medium that can obtain comprehensive error information to accurately locate production problems.

[0005] On the one hand, the present invention provides a front-end error log collection method, the front-end error log collection method comprising:

[0006] Generate an event monitoring request based on a preset event, and send the event monitoring request to a preset browser;

[0007] Receiving a monitoring feedback package generated based on the event monitoring request;

[0008] Determining a feedback webpage according to the monitoring feedback package, and determining a feedback frequency of the feedback webpage, wherein the feedback webpage refers to a webpage that triggers the generation of the monitoring feedback package;

[0009] If the feedback frequency is greater than the configured value, determining the generation time of the monitoring feedback package and determining the triggering terminal of the monitoring feedback package;

[0010] Filter target logs from the trigger terminal according to the generation time, the target logs refer to logs whose log time is within a time interval, and the time interval is generated according to the generation time and a preset time;

[0011] An error log is extracted from the target log according to the feedback webpage, wherein the error log refers to a log generated when the feedback webpage fails to run.

[0012] According to a preferred embodiment of the present invention, generating an event monitoring request based on a preset event includes:

[0013] Acquire a monitoring instruction template from an instruction template library, and determine the filling quantity of all filling events in the monitoring instruction template;

[0014] Determining a preset number of the preset events;

[0015] Based on the difference between the filling quantity and the preset quantity, processing all the filling events in the monitoring instruction template to obtain a target template;

[0016] Determine the filling positions of all the filling events in the target template;

[0017] The preset event is written into the filling position to obtain the event monitoring request.

[0018] According to a preferred embodiment of the present invention, sending the event monitoring request to a preset browser includes:

[0019] Obtaining the device address of the electronic device itself, and obtaining the browser address of the preset browser;

[0020] Establishing a connection channel between the device address and the browser address;

[0021] The event monitoring request is sent to the preset browser through the connection channel.

[0022] According to a preferred embodiment of the present invention, determining a feedback webpage according to the monitoring feedback package includes:

[0023] Parsing the message of the monitoring feedback package to obtain the data information carried by the message;

[0024] Obtaining a preset tag, where the preset tag is used to indicate a web page;

[0025] Acquire information corresponding to the preset tag from the data information as a web page code;

[0026] A web page corresponding to the web page code is determined from the web page mapping table as the feedback web page.

[0027] According to a preferred embodiment of the present invention, determining the feedback frequency of the feedback webpage includes:

[0028] Determining a target feedback package corresponding to each of the feedback web pages from the monitoring feedback packages;

[0029] Obtaining the reception time of the target feedback packet;

[0030] Obtaining a time with a minimum value from the receiving time as a first time, and obtaining a time with a maximum value from the receiving time as a second time;

[0031] Determine a time difference between the second time and the first time to obtain a target time;

[0032] Determining the feedback quantity of each feedback webpage according to the target feedback package;

[0033] The feedback frequency is obtained by dividing the feedback quantity by the target time.

[0034] According to a preferred embodiment of the present invention, filtering the target log from the trigger terminal according to the generation time includes:

[0035] The sum of the generation time and the preset time is taken as the third time;

[0036] determining a time interval according to the generation time and the third time;

[0037] Obtain all logs on the trigger terminal, and obtain the log time of each log in all the logs;

[0038] The log whose log time is within the time interval is determined as the target log.

[0039] According to a preferred embodiment of the present invention, after extracting the error log from the target log according to the feedback webpage, the method further includes:

[0040] Extracting information indicating an entity from the error log as error information;

[0041] Determining a triggering user of the event monitoring request;

[0042] Determining a terminal bound to the triggering user as a user terminal;

[0043] The error message is sent to the user terminal.

[0044] On the other hand, the present invention further provides a front-end error log collection device, the front-end error log collection device comprising:

[0045] A sending unit, configured to generate an event monitoring request based on a preset event, and send the event monitoring request to a preset browser;

[0046] A receiving unit, configured to receive a monitoring feedback package generated based on the event monitoring request;

[0047] a determining unit, configured to determine a feedback webpage according to the monitoring feedback package, and determine a feedback frequency of the feedback webpage, wherein the feedback webpage refers to a webpage that triggers the generation of the monitoring feedback package;

[0048] The determining unit is further configured to determine, if the feedback frequency is greater than a configured value, a generation time of the monitoring feedback packet and a triggering terminal of the monitoring feedback packet;

[0049] a screening unit, configured to screen target logs from the trigger terminal according to the generation time, wherein the target logs refer to logs whose log time is within a time interval, and the time interval is generated according to the generation time and a preset time;

[0050] The extracting unit is used to extract an error log from the target log according to the feedback webpage, wherein the error log refers to a log generated when the feedback webpage fails to run.

[0051] On the other hand, the present invention further provides an electronic device, comprising:

[0052] a memory storing computer readable instructions; and

[0053] The processor executes the computer-readable instructions stored in the memory to implement the front-end error log collection method.

[0054] On the other hand, the present invention further proposes a computer-readable storage medium, in which computer-readable instructions are stored. The computer-readable instructions are executed by a processor in an electronic device to implement the front-end error log collection method.

[0055] It can be seen from the above technical scheme that the present invention can generate an event monitoring request based on a preset event, and send the event monitoring request to a preset browser; receive a monitoring feedback package generated based on the event monitoring request; determine a feedback webpage according to the monitoring feedback package, and determine the feedback frequency of the feedback webpage, the feedback webpage refers to the webpage that triggers the generation of the monitoring feedback package; if the feedback frequency is greater than the configuration value, determine the generation time of the monitoring feedback package, and determine the trigger terminal of the monitoring feedback package; filter the target log from the trigger terminal according to the generation time, the target log refers to the log whose log time is in the time interval, and the time interval is generated according to the generation time and the preset time; extract the error log from the target log according to the feedback webpage, the error log refers to the log generated when the feedback webpage fails to run. The present invention further monitors the webpage running on the preset browser through the generated event monitoring request, and when the monitoring feedback package is received, the feedback webpage can be accurately determined from the monitoring feedback package, and then the error log corresponding to the feedback webpage can be extracted from the trigger terminal, and comprehensive error information can be obtained from the error log, which is conducive to the location of production problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a flow chart of a preferred embodiment of the front-end error log collection method of the present invention.

[0057] Figure 2 It is a flow chart of an embodiment of the present invention for generating an event monitoring request.

[0058] Figure 3 It is a flow chart of an embodiment of the present invention for determining the feedback frequency of a feedback webpage.

[0059] Figure 4 It is a functional module diagram of a preferred embodiment of the front-end error log collection device of the present invention.

[0060] Figure 5 It is a structural schematic diagram of an electronic device of a preferred embodiment of the present invention for implementing a front-end error log collection method. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0062] like Figure 1 FIG. 1 is a flow chart of a preferred embodiment of the front-end error log collection method of the present invention. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.

[0063] The front-end error log collection method is applied to one or more electronic devices, and the electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored computer-readable instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0064] The electronic device may be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.

[0065] The electronic device may include a network device and / or a user device. The network device includes, but is not limited to, a single network electronic device, an electronic device group consisting of multiple network electronic devices, or a cloud consisting of a large number of hosts or network electronic devices based on cloud computing.

[0066] The network where the electronic device is located includes, but is not limited to: the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.

[0067] S10, generating an event monitoring request based on a preset event, and sending the event monitoring request to a preset browser.

[0068] In at least one embodiment of the present invention, the preset event may include, but is not limited to: onerror event and the like.

[0069] The event monitoring request may be generated by a user trigger, and the information carried by the event monitoring request includes, but is not limited to: monitoring events.

[0070] The preset browser may be any browser, for example, the preset browser may be Firefox or the like.

[0071] See also Figure 2 , Figure 2 is a flow chart of an embodiment of the present invention for generating an event monitoring request. In at least one embodiment of the present invention, the electronic device generating an event monitoring request based on a preset event includes:

[0072] S100, obtaining a monitoring instruction template from an instruction template library, and determining the filling quantity of all filling events in the monitoring instruction template.

[0073] The instruction template library stores a plurality of instruction templates. Each filling event includes a label corresponding to the event.

[0074] S101, determining a preset number of preset events.

[0075] S102, based on the difference between the filling quantity and the preset quantity, processing all the filling events in the monitoring instruction template to obtain a target template.

[0076] Specifically, the electronic device processes all the filling events in the monitoring instruction template based on the difference between the filling quantity and the preset quantity, and obtains the target template including:

[0077] If the filling quantity is greater than the preset quantity, the filling events whose quantity is the difference are deleted in the monitoring instruction template, and the monitoring instruction template after the deletion is determined as the target template; or

[0078] If the filling quantity is less than the preset quantity, a filling event having a quantity equal to the difference is added to the monitoring instruction template to obtain the target template.

[0079] S103: Determine the filling positions of all the filling events in the target template.

[0080] The fill position refers to the position of the fill event.

[0081] S104, writing the preset event into the filling position to obtain the event monitoring request.

[0082] For example: the monitoring instruction template obtained from the instruction template library is: [event label 1, fill position 1; event label 2, fill position 2]. After determination, the fill quantity of the monitoring instruction template is 2, and the preset events include: event A, event B, event C, and the preset quantity is 3. Since the fill quantity 2 is less than the preset quantity 3, the fill events are expanded in the monitoring instruction template, and the target template is: [event label 1, fill position 1; event label 2, fill position 2; event label 3, fill position 3].

[0083] Through the above implementation, the monitoring instruction template can be processed according to the difference between the preset number and the filling number, thereby avoiding the problem of not being able to generate the event monitoring request when the preset number is not the filling number, and improving the applicability of the generation of the event monitoring request. Furthermore, based on the mapping relationship between all the filling events and the filling position, the preset event can be accurately written into the filling position, thereby improving the generation accuracy of the event monitoring request.

[0084] In at least one embodiment of the present invention, the electronic device sending the event monitoring request to the preset browser includes:

[0085] Obtaining the device address of the electronic device itself, and obtaining the browser address of the preset browser;

[0086] Establishing a connection channel between the device address and the browser address;

[0087] The event monitoring request is sent to the preset browser through the connection channel.

[0088] The device address refers to the address of the electronic device.

[0089] By establishing the connection channel, the event monitoring request can be accurately sent to the preset browser, thereby improving the monitoring objects of event monitoring.

[0090] S11, receiving a monitoring feedback package generated based on the event monitoring request.

[0091] In at least one embodiment of the present invention, when it is detected that there is any information in the connection channel, the electronic device receives the arbitrary information and detects whether there is an identifier of the event monitoring request in the arbitrary information. If the identifier of the event monitoring request exists in the arbitrary information, the received arbitrary information is determined as the monitoring feedback package.

[0092] S12, determining a feedback webpage according to the monitoring feedback package, and determining a feedback frequency of the feedback webpage, wherein the feedback webpage refers to a webpage that triggers generation of the monitoring feedback package.

[0093] In at least one embodiment of the present invention, the feedback webpage may be any front-end webpage.

[0094] The feedback frequency refers to the frequency of the feedback web pages in the monitoring feedback package.

[0095] In at least one embodiment of the present invention, the electronic device determining the feedback webpage according to the monitoring feedback package includes:

[0096] Parsing the message of the monitoring feedback package to obtain the data information carried by the message;

[0097] Obtaining a preset tag, where the preset tag is used to indicate a web page;

[0098] Acquire information corresponding to the preset tag from the data information as a web page code;

[0099] A web page corresponding to the web page code is determined from the web page mapping table as the feedback web page.

[0100] The web page mapping table stores the mapping relationship between web page codes and web pages.

[0101] Through the above implementation, since there is no need to parse the entire monitoring feedback package, the efficiency of obtaining the data information can be improved, and the feedback web page can be quickly determined. In addition, through the mapping relationship between the preset tag and the web page, the web page encoding can be accurately determined, and the feedback web page can be accurately determined.

[0102] See also Figure 3 , Figure 3is a flow chart of an embodiment of the present invention for determining the feedback frequency of a feedback webpage. In at least one embodiment of the present invention, the electronic device determines the feedback frequency of the feedback webpage including:

[0103] S120: Determine a target feedback package corresponding to each of the feedback web pages from the monitoring feedback package.

[0104] S121, obtaining the reception time of the target feedback packet.

[0105] The receiving time refers to the time when the electronic device receives the target feedback packet.

[0106] S122, obtaining a time with a minimum value from the receiving time as a first time, and obtaining a time with a maximum value from the receiving time as a second time.

[0107] S123: Determine the time difference between the second time and the first time to obtain a target time.

[0108] S124: Determine the feedback quantity of each feedback webpage according to the target feedback package.

[0109] S125: Divide the feedback quantity by the target time to obtain the feedback frequency.

[0110] The target time can be accurately determined by the reception time of the target feedback package, and further the feedback frequency of the feedback webpage can be accurately determined according to the target time.

[0111] S13: If the feedback frequency is greater than the configured value, determine the generation time of the monitoring feedback package and determine the triggering terminal of the monitoring feedback package.

[0112] In at least one embodiment of the present invention, the configuration value may be set according to the frequency of the feedback webpage.

[0113] The generation time refers to the time when the preset browser generates the monitoring feedback package.

[0114] The trigger terminal refers to a terminal that triggers the generation of the monitoring feedback package. The trigger terminal may be a terminal where a user executes the feedback webpage.

[0115] In at least one embodiment of the present invention, the electronic device determines the generation time of the monitoring feedback packet, and determines the triggering terminal of the monitoring feedback packet includes:

[0116] Acquire information indicating time from the data information as the generation time;

[0117] Acquire information indicating a terminal from the data information as a terminal address;

[0118] A terminal corresponding to the terminal address is determined as the triggering terminal.

[0119] Through the above implementation, since the generation time and terminal address are stored in the monitoring feedback package, the generation time can be obtained through the label indicating the time, and the terminal address can be obtained through the label indicating the terminal, and then the triggering terminal can be accurately determined according to the terminal address.

[0120] S14, filtering target logs from the trigger terminal according to the generation time, wherein the target logs refer to logs whose log times are within a time interval, and the time interval is generated according to the generation time and a preset time.

[0121] In at least one embodiment of the present invention, the target log refers to a log whose log time is within a time interval, and the target log includes an error log and a non-error log.

[0122] In at least one embodiment of the present invention, the electronic device filtering the target log from the trigger terminal according to the generation time includes:

[0123] The sum of the generation time and the preset time is taken as the third time;

[0124] determining a time interval according to the generation time and the third time;

[0125] Obtain all logs on the trigger terminal, and obtain the log time of each log in all the logs;

[0126] The log whose log time is within the time interval is determined as the target log.

[0127] The preset time may be determined according to the time when the triggering terminal accesses the preset browser, and the present invention does not limit the value of the preset time.

[0128] Through the above implementation, since the monitoring feedback package is used to feedback the event monitoring request, there is a certain delay between the generation time of the monitoring feedback package and the time when the trigger terminal accesses the feedback web page, and then the target log can be accurately screened out from the trigger terminal according to the time interval, thereby reducing the number of logs analyzed and improving the efficiency of obtaining subsequent error logs.

[0129] S15, extracting an error log from the target log according to the feedback webpage, wherein the error log refers to a log generated when the feedback webpage fails to run.

[0130] It should be emphasized that in order to further ensure the privacy and security of the above error log, the above error log can also be stored in a node of a blockchain.

[0131] In at least one embodiment of the present invention, the error log refers to a log of the user behavior that triggers the generation of the monitoring feedback package.

[0132] In at least one embodiment of the present invention, the electronic device extracting the error log from the target log according to the feedback webpage includes:

[0133] Extracting an execution object from the target log;

[0134] comparing the execution object with the feedback webpage;

[0135] If the execution object is the same as the feedback webpage, the target log corresponding to the execution object is determined as the error log.

[0136] Through the above implementation, since the target log is triggered and generated in the time interval, the target log includes an error log, and the error log can be accurately extracted from the target log according to the feedback webpage.

[0137] In at least one embodiment of the present invention, after extracting the error log from the target log according to the feedback webpage, the method further includes:

[0138] Extracting information indicating an entity from the error log as error information;

[0139] Determining a triggering user of the event monitoring request;

[0140] Determining a terminal bound to the triggering user as a user terminal;

[0141] The error message is sent to the user terminal.

[0142] Through the above implementation, comprehensive error information can be obtained from the error log, and then the comprehensive error information can be sent to the user terminal for user analysis.

[0143] It can be seen from the above technical scheme that the present invention can generate an event monitoring request based on a preset event, and send the event monitoring request to a preset browser; receive a monitoring feedback package generated based on the event monitoring request; determine a feedback webpage according to the monitoring feedback package, and determine the feedback frequency of the feedback webpage, the feedback webpage refers to the webpage that triggers the generation of the monitoring feedback package; if the feedback frequency is greater than the configuration value, determine the generation time of the monitoring feedback package, and determine the trigger terminal of the monitoring feedback package; filter the target log from the trigger terminal according to the generation time, the target log refers to the log whose log time is in the time interval, and the time interval is generated according to the generation time and the preset time; extract the error log from the target log according to the feedback webpage, the error log refers to the log generated when the feedback webpage fails to run. The present invention further monitors the webpage running on the preset browser through the generated event monitoring request, and when the monitoring feedback package is received, the feedback webpage can be accurately determined from the monitoring feedback package, and then the error log corresponding to the feedback webpage can be extracted from the trigger terminal, and comprehensive error information can be obtained from the error log, which is conducive to the location of production problems.

[0144] like Figure 4 As shown, it is a functional module diagram of a preferred embodiment of the front-end error log collection device of the present invention. The front-end error log collection device 11 includes a sending unit 110, a receiving unit 111, a determining unit 112, a screening unit 113 and an extracting unit 114. The module / unit referred to in the present invention refers to a series of computer-readable instruction segments that can be acquired by the processor 13 and can perform fixed functions, which are stored in the memory 12. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.

[0145] The sending unit 110 generates an event monitoring request based on a preset event, and sends the event monitoring request to a preset browser.

[0146] In at least one embodiment of the present invention, the preset event may include, but is not limited to: onerror event and the like.

[0147] The event monitoring request may be generated by a user trigger, and the information carried by the event monitoring request includes, but is not limited to: monitoring events.

[0148] The preset browser may be any browser, for example, the preset browser may be Firefox or the like.

[0149] In at least one embodiment of the present invention, the sending unit 110 generates an event monitoring request based on a preset event, including:

[0150] A monitoring instruction template is obtained from an instruction template library, and the filling quantity of all filling events in the monitoring instruction template is determined.

[0151] The instruction template library stores a plurality of instruction templates. Each filling event includes a label corresponding to the event.

[0152] A preset number of the preset events is determined.

[0153] Based on the difference between the filling quantity and the preset quantity, all the filling events are processed in the monitoring instruction template to obtain a target template.

[0154] Specifically, the sending unit 110 processes all the filling events in the monitoring instruction template based on the difference between the filling quantity and the preset quantity, and obtains the target template including:

[0155] If the filling quantity is greater than the preset quantity, the filling events whose quantity is the difference are deleted in the monitoring instruction template, and the monitoring instruction template after the deletion is determined as the target template; or

[0156] If the filling quantity is less than the preset quantity, a filling event having a quantity equal to the difference is added to the monitoring instruction template to obtain the target template.

[0157] The filling positions of all the filling events in the target template are determined.

[0158] The fill position refers to the position of the fill event.

[0159] The preset event is written into the filling position to obtain the event monitoring request.

[0160] For example: the monitoring instruction template obtained from the instruction template library is: [event label 1, fill position 1; event label 2, fill position 2]. After determination, the fill quantity of the monitoring instruction template is 2, and the preset events include: event A, event B, event C, and the preset quantity is 3. Since the fill quantity 2 is less than the preset quantity 3, the fill events are expanded in the monitoring instruction template, and the target template is: [event label 1, fill position 1; event label 2, fill position 2; event label 3, fill position 3].

[0161] Through the above implementation, the monitoring instruction template can be processed according to the difference between the preset number and the filling number, thereby avoiding the problem of not being able to generate the event monitoring request when the preset number is not the filling number, and improving the applicability of the generation of the event monitoring request. Furthermore, based on the mapping relationship between all the filling events and the filling position, the preset event can be accurately written into the filling position, thereby improving the generation accuracy of the event monitoring request.

[0162] In at least one embodiment of the present invention, the sending unit 110 sends the event monitoring request to the preset browser including:

[0163] Obtaining the device address of the electronic device itself, and obtaining the browser address of the preset browser;

[0164] Establishing a connection channel between the device address and the browser address;

[0165] The event monitoring request is sent to the preset browser through the connection channel.

[0166] The device address refers to the address of the electronic device.

[0167] By establishing the connection channel, the event monitoring request can be accurately sent to the preset browser, thereby improving the monitoring objects of event monitoring.

[0168] The receiving unit 111 receives a monitoring feedback package generated based on the event monitoring request.

[0169] In at least one embodiment of the present invention, when it is detected that there is any information in the connection channel, the receiving unit 111 receives the arbitrary information and detects whether there is an identifier of the event monitoring request in the arbitrary information. If there is an identifier of the event monitoring request in the arbitrary information, the received arbitrary information is determined as the monitoring feedback package.

[0170] The determining unit 112 determines a feedback webpage according to the monitoring feedback package, and determines a feedback frequency of the feedback webpage, wherein the feedback webpage refers to a webpage that triggers the generation of the monitoring feedback package.

[0171] In at least one embodiment of the present invention, the feedback webpage may be any front-end webpage.

[0172] The feedback frequency refers to the frequency of the feedback web pages in the monitoring feedback package.

[0173] In at least one embodiment of the present invention, the determining unit 112 determines the feedback webpage according to the monitoring feedback package, including:

[0174] Parsing the message of the monitoring feedback package to obtain the data information carried by the message;

[0175] Obtaining a preset tag, where the preset tag is used to indicate a web page;

[0176] Acquire information corresponding to the preset tag from the data information as a web page code;

[0177] A web page corresponding to the web page code is determined from the web page mapping table as the feedback web page.

[0178] The web page mapping table stores the mapping relationship between web page codes and web pages.

[0179] Through the above implementation, since there is no need to parse the entire monitoring feedback package, the efficiency of obtaining the data information can be improved, and the feedback web page can be quickly determined. In addition, through the mapping relationship between the preset tag and the web page, the web page encoding can be accurately determined, and the feedback web page can be accurately determined.

[0180] In at least one embodiment of the present invention, the determining unit 112 determines the feedback frequency of the feedback webpage including:

[0181] A target feedback package corresponding to each of the feedback web pages is determined from the monitoring feedback package.

[0182] The receiving time of the target feedback packet is obtained.

[0183] The receiving time refers to the time when the electronic device receives the target feedback packet.

[0184] A time with a minimum value is obtained from the receiving time as the first time, and a time with a maximum value is obtained from the receiving time as the second time.

[0185] A time difference between the second time and the first time is determined to obtain a target time.

[0186] The feedback quantity of each feedback webpage is determined according to the target feedback package.

[0187] The feedback frequency is obtained by dividing the feedback quantity by the target time.

[0188] The target time can be accurately determined by the reception time of the target feedback package, and further the feedback frequency of the feedback webpage can be accurately determined according to the target time.

[0189] If the feedback frequency is greater than the configured value, the determining unit 112 determines the generation time of the monitoring feedback package and determines the triggering terminal of the monitoring feedback package.

[0190] In at least one embodiment of the present invention, the configuration value may be set according to the frequency of the feedback webpage.

[0191] The generation time refers to the time when the preset browser generates the monitoring feedback package.

[0192] The trigger terminal refers to a terminal that triggers the generation of the monitoring feedback package. The trigger terminal may be a terminal where a user executes the feedback webpage.

[0193] In at least one embodiment of the present invention, the determining unit 112 determines the generation time of the monitoring feedback packet, and determines the triggering terminal of the monitoring feedback packet includes:

[0194] Acquire information indicating time from the data information as the generation time;

[0195] Acquire information indicating a terminal from the data information as a terminal address;

[0196] A terminal corresponding to the terminal address is determined as the triggering terminal.

[0197] Through the above implementation, since the generation time and terminal address are stored in the monitoring feedback package, the generation time can be obtained through the label indicating the time, and the terminal address can be obtained through the label indicating the terminal, and then the triggering terminal can be accurately determined according to the terminal address.

[0198] The screening unit 113 screens target logs from the trigger terminal according to the generation time, wherein the target logs refer to logs whose log time is within a time interval, and the time interval is generated according to the generation time and a preset time.

[0199] In at least one embodiment of the present invention, the target log refers to a log whose log time is within a time interval, and the target log includes an error log and a non-error log.

[0200] In at least one embodiment of the present invention, the filtering unit 113 filters the target log from the trigger terminal according to the generation time, including:

[0201] The sum of the generation time and the preset time is taken as the third time;

[0202] determining a time interval according to the generation time and the third time;

[0203] Obtain all logs on the trigger terminal, and obtain the log time of each log in all the logs;

[0204] The log whose log time is within the time interval is determined as the target log.

[0205] The preset time may be determined according to the time when the triggering terminal accesses the preset browser, and the present invention does not limit the value of the preset time.

[0206] Through the above implementation, since the monitoring feedback package is used to feedback the event monitoring request, there is a certain delay between the generation time of the monitoring feedback package and the time when the trigger terminal accesses the feedback web page, and then the target log can be accurately screened out from the trigger terminal according to the time interval, thereby reducing the number of logs analyzed and improving the efficiency of obtaining subsequent error logs.

[0207] The extracting unit 114 extracts an error log from the target log according to the feedback webpage, where the error log refers to a log generated when the feedback webpage fails to run.

[0208] It should be emphasized that in order to further ensure the privacy and security of the above error log, the above error log can also be stored in a node of a blockchain.

[0209] In at least one embodiment of the present invention, the error log refers to a log of the user behavior that triggers the generation of the monitoring feedback package.

[0210] In at least one embodiment of the present invention, the extracting unit 114 extracts the error log from the target log according to the feedback webpage, including:

[0211] Extracting an execution object from the target log;

[0212] comparing the execution object with the feedback webpage;

[0213] If the execution object is the same as the feedback webpage, the target log corresponding to the execution object is determined as the error log.

[0214] Through the above implementation, since the target log is triggered and generated in the time interval, the target log includes an error log, and the error log can be accurately extracted from the target log according to the feedback webpage.

[0215] In at least one embodiment of the present invention, after extracting the error log from the target log according to the feedback webpage, the extracting unit 114 extracts information indicating an entity from the error log as error information;

[0216] The determining unit 112 determines a triggering user of the event monitoring request;

[0217] The determining unit 112 determines a terminal bound to the triggering user as a user terminal;

[0218] The sending unit 110 sends the error information to the user terminal.

[0219] Through the above implementation, comprehensive error information can be obtained from the error log, and then the comprehensive error information can be sent to the user terminal for user analysis.

[0220] It can be seen from the above technical scheme that the present invention can generate an event monitoring request based on a preset event, and send the event monitoring request to a preset browser; receive a monitoring feedback package generated based on the event monitoring request; determine a feedback webpage according to the monitoring feedback package, and determine the feedback frequency of the feedback webpage, the feedback webpage refers to the webpage that triggers the generation of the monitoring feedback package; if the feedback frequency is greater than the configuration value, determine the generation time of the monitoring feedback package, and determine the trigger terminal of the monitoring feedback package; filter the target log from the trigger terminal according to the generation time, the target log refers to the log whose log time is in the time interval, and the time interval is generated according to the generation time and the preset time; extract the error log from the target log according to the feedback webpage, the error log refers to the log generated when the feedback webpage fails to run. The present invention further monitors the webpage running on the preset browser through the generated event monitoring request, and when the monitoring feedback package is received, the feedback webpage can be accurately determined from the monitoring feedback package, and then the error log corresponding to the feedback webpage can be extracted from the trigger terminal, and comprehensive error information can be obtained from the error log, which is conducive to the location of production problems.

[0221] like Figure 5 , which is a schematic diagram of the structure of an electronic device of a preferred embodiment of the present invention for implementing the front-end error log collection method.

[0222] In one embodiment of the present invention, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and computer-readable instructions stored in the memory 12 and executable on the processor 13, such as a front-end error log collection program.

[0223] Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. The electronic device 1 may include more or fewer components than shown in the diagram, or a combination of certain components, or different components. For example, the electronic device 1 may also include input and output devices, network access devices, buses, etc.

[0224] The processor 13 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 13 is the computing core and control center of the electronic device 1, and uses various interfaces and lines to connect various parts of the entire electronic device 1, and executes the operating system of the electronic device 1 and various installed applications, program codes, etc.

[0225] Exemplarily, the computer-readable instructions may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules / units may be a series of computer-readable instruction segments capable of completing specific functions, which are used to describe the execution process of the computer-readable instructions in the electronic device 1. For example, the computer-readable instructions may be divided into a sending unit 110, a receiving unit 111, a determining unit 112, a screening unit 113, and an extracting unit 114.

[0226] The memory 12 can be used to store the computer-readable instructions and / or modules, and the processor 13 implements various functions of the electronic device 1 by running or executing the computer-readable instructions and / or modules stored in the memory 12, and calling the data stored in the memory 12. The memory 12 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device, etc. The memory 12 can include non-volatile and volatile memories, such as: a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other storage devices.

[0227] The memory 12 may be an external memory and / or an internal memory of the electronic device 1. Furthermore, the memory 12 may be a memory in a physical form, such as a memory stick, a TF card (Trans-flash Card), and the like.

[0228] If the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also instruct the relevant hardware to complete it through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium. When the computer-readable instructions are executed by the processor, the steps of the above-mentioned various method embodiments can be implemented.

[0229] The computer-readable instructions include computer-readable instruction codes, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer-readable instruction code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM).

[0230] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0231] Combination Figure 1 The memory 12 in the electronic device 1 stores computer-readable instructions to implement a front-end error log collection method, and the processor 13 can execute the computer-readable instructions to implement:

[0232] Generate an event monitoring request based on a preset event, and send the event monitoring request to a preset browser;

[0233] Receiving a monitoring feedback package generated based on the event monitoring request;

[0234] Determining a feedback webpage according to the monitoring feedback package, and determining a feedback frequency of the feedback webpage, wherein the feedback webpage refers to a webpage that triggers the generation of the monitoring feedback package;

[0235] If the feedback frequency is greater than the configured value, determining the generation time of the monitoring feedback package and determining the triggering terminal of the monitoring feedback package;

[0236] Filter target logs from the trigger terminal according to the generation time, the target logs refer to logs whose log time is within a time interval, and the time interval is generated according to the generation time and a preset time;

[0237] An error log is extracted from the target log according to the feedback webpage, wherein the error log refers to a log generated when the feedback webpage fails to run.

[0238] Specifically, the specific implementation method of the processor 13 for the above-mentioned computer readable instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0239] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0240] The computer-readable storage medium stores computer-readable instructions, wherein the computer-readable instructions are used to implement the following steps when executed by the processor 13:

[0241] Generate an event monitoring request based on a preset event, and send the event monitoring request to a preset browser;

[0242] Receiving a monitoring feedback package generated based on the event monitoring request;

[0243] Determining a feedback webpage according to the monitoring feedback package, and determining a feedback frequency of the feedback webpage, wherein the feedback webpage refers to a webpage that triggers the generation of the monitoring feedback package;

[0244] If the feedback frequency is greater than the configured value, determining the generation time of the monitoring feedback package and determining the triggering terminal of the monitoring feedback package;

[0245] Filter target logs from the trigger terminal according to the generation time, the target logs refer to logs whose log time is within a time interval, and the time interval is generated according to the generation time and a preset time;

[0246] An error log is extracted from the target log according to the feedback webpage, wherein the error log refers to a log generated when the feedback webpage fails to run.

[0247] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0248] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0249] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0250] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. The multiple units or devices mentioned can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0251] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A front-end error log collection method, It is characterized in that The front-end error log collection method includes: Generate an event monitoring request based on a preset event, and send the event monitoring request to a preset browser, wherein generating the event monitoring request based on the preset event includes: obtaining a monitoring instruction template from an instruction template library, and determining the filling quantity of all filling events in the monitoring instruction template; determining the preset quantity of the preset event; processing all the filling events in the monitoring instruction template based on the difference between the filling quantity and the preset quantity to obtain a target template; determining the filling position of all the filling events in the target template; writing the preset event into the filling position to obtain the event monitoring request; Receiving a monitoring feedback package generated based on the event monitoring request; Determine a feedback webpage according to the monitoring feedback package, and determine the feedback frequency of the feedback webpage, wherein the feedback webpage refers to the webpage that triggers the generation of the monitoring feedback package, and the feedback frequency refers to the frequency of the feedback webpage in the monitoring feedback package; If the feedback frequency is greater than the configured value, determining the generation time of the monitoring feedback package and determining the triggering terminal of the monitoring feedback package; Filter target logs from the trigger terminal according to the generation time, the target logs refer to logs whose log time is within a time interval, and the time interval is generated according to the generation time and a preset time; An error log is extracted from the target log according to the feedback webpage, wherein the error log refers to a log generated when the feedback webpage fails to run.

2. The front-end error log collection method according to claim 1, It is characterized in that The sending the event monitoring request to the preset browser includes: Obtaining the device address of the electronic device itself, and obtaining the browser address of the preset browser; Establishing a connection channel between the device address and the browser address; The event monitoring request is sent to the preset browser through the connection channel.

3. The front-end error log collection method according to claim 1, It is characterized in that Determining the feedback webpage according to the monitoring feedback package includes: Parsing the message of the monitoring feedback package to obtain the data information carried by the message; Obtaining a preset tag, where the preset tag is used to indicate a web page; Acquire information corresponding to the preset tag from the data information as a web page code; A web page corresponding to the web page code is determined from the web page mapping table as the feedback web page.

4. The front-end error log collection method according to claim 1, It is characterized in that Determining the feedback frequency of the feedback webpage includes: Determining a target feedback package corresponding to each of the feedback web pages from the monitoring feedback packages; Obtaining the reception time of the target feedback packet; Obtaining a time with a minimum value from the receiving time as a first time, and obtaining a time with a maximum value from the receiving time as a second time; Determine a time difference between the second time and the first time to obtain a target time; Determining the feedback quantity of each feedback webpage according to the target feedback package; The feedback frequency is obtained by dividing the feedback quantity by the target time.

5. The front-end error log collection method according to claim 1, It is characterized in that The filtering of the target log from the trigger terminal according to the generation time includes: The sum of the generation time and the preset time is taken as the third time; determining a time interval according to the generation time and the third time; Obtain all logs on the trigger terminal, and obtain the log time of each log in all the logs; The log whose log time is within the time interval is determined as the target log.

6. The front-end error log collection method according to claim 1, It is characterized in that After extracting the error log from the target log according to the feedback webpage, the method further includes: Extracting information indicating an entity from the error log as error information; Determining a triggering user of the event monitoring request; Determining a terminal bound to the triggering user as a user terminal; The error message is sent to the user terminal.

7. A front-end error log collection device, It is characterized in that The device includes a unit for implementing the front-end error log collection method according to any one of claims 1 to 6, and the front-end error log collection device includes: A sending unit, configured to generate an event monitoring request based on a preset event, and send the event monitoring request to a preset browser; A receiving unit, configured to receive a monitoring feedback package generated based on the event monitoring request; a determining unit, configured to determine a feedback webpage according to the monitoring feedback package, and determine a feedback frequency of the feedback webpage, wherein the feedback webpage refers to a webpage that triggers the generation of the monitoring feedback package, and the feedback frequency refers to the frequency of the feedback webpage in the monitoring feedback package; The determining unit is further configured to determine, if the feedback frequency is greater than a configured value, a generation time of the monitoring feedback packet and a triggering terminal of the monitoring feedback packet; a screening unit, configured to screen target logs from the trigger terminal according to the generation time, wherein the target logs refer to logs whose log time is within a time interval, and the time interval is generated according to the generation time and a preset time; The extracting unit is used to extract an error log from the target log according to the feedback webpage, wherein the error log refers to a log generated when the feedback webpage fails to run.

8. An electronic device, It is characterized in that The electronic device comprises: a memory storing computer-readable instructions; and The processor executes the computer-readable instructions stored in the memory to implement the front-end error log collection method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, Features: The computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions are executed by a processor in an electronic device to implement the front-end error log collection method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and system for monitoring property of web application program and web server

    CN102684934A

  • Webpage template checking method and device and computer readable storage medium

    CN108334446A

  • Webpage test method and device, electronic device and medium

    CN108628741A

  • Method, device, electronic device and storage medium for processing web page operation data

    CN109471976A

  • System exception monitoring method and device, computer equipment and storage medium

    CN111752793A