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

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

Info

Publication number
CN112685253A
CN112685253A CN202011601565.7A CN202011601565A CN112685253A CN 112685253 A CN112685253 A CN 112685253A CN 202011601565 A CN202011601565 A CN 202011601565A CN 112685253 A CN112685253 A CN 112685253A
Authority
CN
China
Prior art keywords
feedback
log
time
webpage
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011601565.7A
Other languages
Chinese (zh)
Inventor
余祖杭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011601565.7A priority Critical patent/CN112685253A/en
Publication of CN112685253A publication Critical patent/CN112685253A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention relates to cloud monitoring and provides a front-end error log collection method, a device, equipment and a 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; receiving a monitoring feedback packet generated based on the event monitoring request; determining a feedback webpage according to the monitoring feedback packet, and determining the feedback frequency of the feedback webpage; if the feedback frequency is greater than a configuration value, determining the generation time of the monitoring feedback packet, and determining a trigger terminal of the monitoring feedback packet; screening a target log from the trigger terminal according to the generation time; and extracting an error log from the target log according to the feedback webpage. The invention can acquire comprehensive error reporting information. In addition, the invention also relates to a block chain technology, and the error log can be stored in the block chain.

Description

Front-end error log collection method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of cloud monitoring, in particular to a front-end error log collection method, device, equipment and storage medium.
Background
At present, the front-end project is fully tested before being on-line, however, when unpredictable problems occur in devices, browsers, network environments and the like operated by the front-end page, the operation of the front-end page still fails. In order to locate the reason of the front-end page operation failure, currently, the error reporting information is obtained by embedding points in the front-end project, however, the error reporting information obtained by embedding the points is not comprehensive enough, and thus the production problem cannot be accurately located.
Therefore, how to acquire comprehensive error reporting information to accurately position to the production problem becomes a problem which needs to be solved urgently.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, an apparatus, a device and a storage medium for collecting a front-end error log, which can acquire comprehensive error information to accurately locate a production problem.
On one hand, the invention provides a front-end error log collecting method, which comprises the following steps:
generating an event monitoring request based on a preset event, and sending the event monitoring request to a preset browser;
receiving a monitoring feedback packet generated based on the event monitoring request;
determining a feedback webpage according to the monitoring feedback packet, and determining the feedback frequency of the feedback webpage, wherein the feedback webpage is a webpage generated by triggering the monitoring feedback packet;
if the feedback frequency is greater than a configuration value, determining the generation time of the monitoring feedback packet, and determining a trigger terminal of the monitoring feedback packet;
screening a target log from the trigger terminal according to the generation time, wherein the target log refers to a log with the log time in a time interval, and the time interval is generated according to the generation time and preset time;
and extracting an error report log from the target log according to the feedback webpage, wherein the error report log is a log generated when the operation of the feedback webpage fails.
According to a preferred embodiment of the present invention, the generating an event monitoring request based on a preset event includes:
acquiring a monitoring instruction template from an instruction template library, and determining the filling quantity of all filling events in the monitoring instruction template;
determining a preset number of the preset events;
processing all filling events in the monitoring instruction template based on the difference value between the filling quantity and the preset quantity to obtain a target template;
determining filling positions of all filling events in the target template;
and writing the preset event into the filling position to obtain the event monitoring request.
According to a preferred embodiment of the present invention, the sending the event monitoring request to the preset browser includes:
acquiring a device address of the electronic device and acquiring a browser address of the preset browser;
establishing a connection channel between the equipment address and the browser address;
and sending the event monitoring request to the preset browser through the connecting channel.
According to a preferred embodiment of the present invention, the determining a feedback webpage according to the monitoring feedback packet includes:
analyzing the message of the monitoring feedback packet to obtain the data information carried by the message;
acquiring a preset label, wherein the preset label is used for indicating a webpage;
acquiring information corresponding to the preset label from the data information as a webpage code;
and determining a webpage corresponding to the webpage code from a webpage mapping table as the feedback webpage.
According to a preferred embodiment of the present invention, the determining the feedback frequency of the feedback webpage includes:
determining a target feedback package corresponding to each feedback webpage from the monitoring feedback packages;
acquiring the receiving time of the target feedback packet;
acquiring the time with the minimum value from the receiving time as a first time, and acquiring the time with the maximum value from the receiving time as a second time;
determining the time difference between the second time and the first time to obtain target time;
determining the feedback quantity of each feedback webpage according to the target feedback packet;
and dividing the feedback quantity by the target time to obtain the feedback frequency.
According to a preferred embodiment of the present invention, the screening the target log from the trigger terminal according to the generation time includes:
taking the sum of the generation time and the preset time as a third time;
determining a time interval according to the generation time and the third time;
acquiring all logs on the trigger terminal, and acquiring the log time of each log in all the logs;
and determining the log with the log time in the time interval as the target log.
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:
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 with the trigger user as a user terminal;
and sending the error reporting information to the user terminal.
On the other hand, the invention also provides a front-end error log collecting device, which comprises:
the system comprises a sending unit, a receiving unit and a processing unit, wherein the sending unit is used for generating an event monitoring request based on a preset event and sending the event monitoring request to a preset browser;
a receiving unit, configured to receive a monitoring feedback packet generated based on the event monitoring request;
the determining unit is used for determining a feedback webpage according to the monitoring feedback packet and determining the feedback frequency of the feedback webpage, wherein the feedback webpage is a webpage generated by triggering the monitoring feedback packet;
the determining unit is further configured to determine the generation time of the monitoring feedback packet and determine a trigger terminal of the monitoring feedback packet if the feedback frequency is greater than a configuration value;
the screening unit is used for screening a target log from the trigger terminal according to the generation time, wherein the target log refers to a log with a log time in a time interval, and the time interval is generated according to the generation time and preset time;
and the extracting unit is used for extracting an error log from the target log according to the feedback webpage, wherein the error log is a log generated when the operation of the feedback webpage fails.
In another aspect, the present invention further provides an electronic device, including:
a memory storing computer readable instructions; and
and the processor executes the computer readable instructions stored in the memory to realize the front-end error log collection method.
In another aspect, the present invention further provides a computer-readable storage medium, where computer-readable instructions are stored in the computer-readable storage medium, and the computer-readable instructions are executed by a processor in an electronic device to implement the front-end error log collecting method.
According to the technical scheme, the event monitoring method and the event monitoring system can generate the event monitoring request based on the preset event and send the event monitoring request to the preset browser; receiving a monitoring feedback packet generated based on the event monitoring request; determining a feedback webpage according to the monitoring feedback packet, and determining the feedback frequency of the feedback webpage, wherein the feedback webpage is a webpage generated by triggering the monitoring feedback packet; if the feedback frequency is greater than a configuration value, determining the generation time of the monitoring feedback packet, and determining a trigger terminal of the monitoring feedback packet; screening a target log from the trigger terminal according to the generation time, wherein the target log refers to a log with the log time in a time interval, and the time interval is generated according to the generation time and preset time; and extracting an error report log from the target log according to the feedback webpage, wherein the error report log is a log generated when the operation of the feedback webpage fails. According to the method and the device, the webpage running on the preset browser is further monitored through the generated event monitoring request, when the monitoring feedback packet is received, the feedback webpage can be accurately determined from the monitoring feedback packet, the error log corresponding to the feedback webpage can be further extracted from the trigger terminal, and further comprehensive error reporting information can be obtained from the error log, so that the positioning of production problems is facilitated.
Drawings
FIG. 1 is a flowchart illustrating a method for collecting a front-end error log according to a preferred embodiment of the present invention.
FIG. 2 is a flow diagram of one embodiment of generating an event monitoring request of the present invention.
FIG. 3 is a flowchart of an embodiment of determining a feedback frequency of a feedback webpage according to the present invention.
FIG. 4 is a functional block diagram of a front-end error log collecting device according to a preferred embodiment of the present invention.
Fig. 5 is a schematic structural diagram of an electronic device implementing a method for acquiring a front-end error log according to a preferred embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a flowchart illustrating a method for collecting a front-end error log according to a preferred embodiment of the present invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs.
The front-end error log collection method is applied to one or more electronic devices, wherein the electronic devices are devices capable of automatically performing numerical calculation and/or information processing according to preset or stored computer readable instructions, and hardware of the electronic devices includes but is not limited to a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The electronic device may be any electronic product capable of performing human-computer interaction with a user, for example, a Personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), a game machine, an interactive Internet Protocol Television (IPTV), a smart wearable device, and the like.
The electronic device may include a network device and/or a user device. Wherein the network device includes, but is not limited to, a single network electronic device, an electronic device group consisting of a plurality of network electronic devices, or a Cloud Computing (Cloud Computing) based Cloud consisting of a large number of hosts or network electronic devices.
The network in which 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), and the like.
And S10, generating an event monitoring request based on a preset event, and sending the event monitoring request to a preset browser.
In at least one embodiment of the present invention, the preset event may include, but is not limited to: onerror event, etc.
The event monitoring request may be generated by being triggered by a user, and the information carried by the event monitoring request includes, but is not limited to: an event is monitored.
The preset browser may be any browser, for example, the preset browser may be a Firefox browser or the like.
Referring to fig. 2, fig. 2 is a flow diagram 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 the event monitoring request based on the preset event includes:
s100, acquiring a monitoring instruction template from an instruction template library, and determining the filling quantity of all filling events in the monitoring instruction template.
Wherein, a plurality of instruction templates are stored in the instruction template library. Each fill event includes a tag corresponding to the event.
S101, determining the preset number of the preset events.
And S102, processing all filling events in the monitoring instruction template based on the difference value between the filling quantity and the preset quantity to obtain a target template.
Specifically, the processing, by the electronic device, all filling events in the monitoring instruction template based on the difference between the filling number and the preset number to obtain a target template includes:
if the filling quantity is larger than the preset quantity, deleting the filling events of which the quantity is the difference value from the monitoring instruction template, and determining the deleted monitoring instruction template as the target template; or
And if the filling quantity is smaller than the preset quantity, newly adding filling events of which the quantity is the difference value in the monitoring instruction template to obtain the target template.
S103, determining the filling positions of all the filling events in the target template.
The fill location refers to the location of the fill event.
And S104, writing the preset event into the filling position to obtain the event monitoring request.
For example: the monitoring instruction template obtained from the instruction template library is as follows: event label 1, fill location 1; event tag 2 and filling position 2 ], wherein the filling number of the monitoring instruction template is determined to be 2, and the preset event comprises the following steps: the preset number is 3, and as the filling number 2 is smaller than the preset number 3, filling events are expanded in the monitoring instruction template to obtain a target template: event label 1, fill location 1; event tag 2, fill location 2; event label 3, fill position 3 ].
Through the embodiment, the monitoring instruction template can be processed according to the difference value between the preset number and the filling number, the problem that the event monitoring request cannot be generated when the preset number is not the filling number is avoided, the generation applicability of the event monitoring request is improved, and then the preset event can be accurately written into the filling position according to the mapping relation between all filling events and the filling position, so that the generation accuracy of the event monitoring request is improved.
In at least one embodiment of the present invention, the sending, by the electronic device, the event monitoring request to a preset browser includes:
acquiring a device address of the electronic device and acquiring a browser address of the preset browser;
establishing a connection channel between the equipment address and the browser address;
and sending the event monitoring request to the preset browser through the connecting channel.
Wherein the device address refers to an address of the electronic device.
By establishing the connection channel, the event monitoring request can be accurately sent to the preset browser, so that the monitoring object of event monitoring can be improved.
And S11, receiving a monitoring feedback packet generated based on the event monitoring request.
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 any information, detects whether there is an identifier of the event monitoring request in the any information, and determines the received any information as the monitoring feedback packet if there is the identifier of the event monitoring request in the any information.
And S12, determining a feedback webpage according to the monitoring feedback package, and determining the feedback frequency of the feedback webpage, wherein the feedback webpage is a webpage generated by triggering the monitoring feedback package.
In at least one embodiment of the invention, the feedback webpage may be any front-end webpage.
The feedback frequency refers to the frequency of the feedback webpage in the monitoring feedback packet.
In at least one embodiment of the present invention, the determining, by the electronic device, the feedback webpage according to the monitoring feedback packet includes:
analyzing the message of the monitoring feedback packet to obtain the data information carried by the message;
acquiring a preset label, wherein the preset label is used for indicating a webpage;
acquiring information corresponding to the preset label from the data information as a webpage code;
and determining a webpage corresponding to the webpage code from a webpage mapping table as the feedback webpage.
And the mapping relation between the webpage codes and the webpages is stored in the webpage mapping table.
Through the embodiment, the whole monitoring feedback packet does not need to be analyzed, so that the acquisition efficiency of the data information can be improved, the feedback webpage can be quickly determined, in addition, the webpage code can be accurately determined through the mapping relation between the preset label and the webpage, and the feedback webpage can be accurately determined.
Referring to fig. 3, fig. 3 is a flowchart of an embodiment of determining a feedback frequency of a feedback webpage according to the present invention. In at least one embodiment of the present invention, the electronic device determining the feedback frequency of the feedback webpage includes:
and S120, determining a target feedback packet corresponding to each feedback webpage from the monitoring feedback packets.
And S121, acquiring the receiving time of the target feedback packet.
The receiving time refers to a time when the electronic device receives the target feedback packet.
And S122, acquiring the time with the minimum value from the receiving time as a first time, and acquiring the time with the maximum value from the receiving time as a second time.
And S123, determining the time difference between the second time and the first time to obtain the target time.
And S124, determining the feedback quantity of each feedback webpage according to the target feedback package.
And S125, dividing the feedback quantity by the target time to obtain the feedback frequency.
The target time can be accurately determined according to the receiving time of the target feedback packet, and then the feedback frequency of the feedback webpage can be accurately determined according to the target time.
And S13, if the feedback frequency is greater than a configuration value, determining the generation time of the monitoring feedback packet, and determining the trigger terminal of the monitoring feedback packet.
In at least one embodiment of the present invention, the configuration value may be set according to the frequency of the feedback webpage.
The generation time refers to the time for the preset browser to generate the monitoring feedback packet.
The triggering terminal is a terminal for triggering the generation of the monitoring feedback packet. The trigger terminal may be a terminal for the user to execute the feedback webpage.
In at least one embodiment of the present invention, the determining, by the electronic device, the generation time of the monitoring feedback packet, and determining the trigger terminal of the monitoring feedback packet includes:
acquiring information indicating time from the data information as the generation time;
acquiring information indicating a terminal from the data information as a terminal address;
and determining the terminal corresponding to the terminal address as the trigger terminal.
By the embodiment, because the generation time and the terminal address are stored in the monitoring feedback packet, the generation time can be acquired by the tag indicating the time, the terminal address can be acquired by the tag indicating the terminal, and the trigger terminal can be accurately determined according to the terminal address.
And S14, screening a target log from the trigger terminal according to the generation time, wherein the target log refers to a log with the log time in a time interval, and the time interval is generated according to the generation time and preset time.
In at least one embodiment of the present invention, the target log refers to a log whose log time is in a time interval, and the target log includes an error-reporting log and a non-error-reporting log.
In at least one embodiment of the present invention, the electronic device, according to the generation time, screening a target log from the trigger terminal includes:
taking the sum of the generation time and the preset time as a third time;
determining a time interval according to the generation time and the third time;
acquiring all logs on the trigger terminal, and acquiring the log time of each log in all the logs;
and determining the log with the log time in the time interval as the target log.
The preset time can be determined according to the time for the trigger terminal to access the preset browser, and the value of the preset time is not limited by the invention.
Through the embodiment, because the monitoring feedback packet is used for feeding back the event monitoring request, a certain delay exists between the generation time of the monitoring feedback packet and the time of the trigger terminal accessing the feedback webpage, and the target log can be accurately screened from the trigger terminal according to the time interval, so that the analysis number of the log is reduced, and the acquisition efficiency of the subsequent error log is improved.
And S15, extracting an error log from the target log according to the feedback webpage, wherein the error log is a log generated when the operation of the feedback webpage fails.
It is emphasized that the error log may also be stored in a node of a block chain in order to further ensure the privacy and security of the error log.
In at least one embodiment of the present invention, the error log refers to a log of user behavior triggering generation of the monitoring feedback packet.
In at least one embodiment of the present invention, the extracting, by the electronic device, the error log from the target log according to the feedback webpage includes:
extracting an execution object from the target log;
comparing the execution object with the feedback webpage;
and if the execution object is the same as the feedback webpage, determining a target log corresponding to the execution object as the error report log.
Through the above embodiment, since the target log is generated by triggering 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.
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:
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 with the trigger user as a user terminal;
and sending the error reporting information to the user terminal.
Through the embodiment, comprehensive error reporting information can be acquired from the error reporting log, and further the comprehensive error reporting information can be sent to the user terminal for user analysis.
According to the technical scheme, the event monitoring method and the event monitoring system can generate the event monitoring request based on the preset event and send the event monitoring request to the preset browser; receiving a monitoring feedback packet generated based on the event monitoring request; determining a feedback webpage according to the monitoring feedback packet, and determining the feedback frequency of the feedback webpage, wherein the feedback webpage is a webpage generated by triggering the monitoring feedback packet; if the feedback frequency is greater than a configuration value, determining the generation time of the monitoring feedback packet, and determining a trigger terminal of the monitoring feedback packet; screening a target log from the trigger terminal according to the generation time, wherein the target log refers to a log with the log time in a time interval, and the time interval is generated according to the generation time and preset time; and extracting an error report log from the target log according to the feedback webpage, wherein the error report log is a log generated when the operation of the feedback webpage fails. According to the method and the device, the webpage running on the preset browser is further monitored through the generated event monitoring request, when the monitoring feedback packet is received, the feedback webpage can be accurately determined from the monitoring feedback packet, the error log corresponding to the feedback webpage can be further extracted from the trigger terminal, and further comprehensive error reporting information can be obtained from the error log, so that the positioning of production problems is facilitated.
Fig. 4 is a functional block diagram of a front-end error log collecting device according to a preferred embodiment of the present invention. The front-end error log collecting 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 herein is a series of computer readable instruction segments that can be accessed by the processor 13 and perform a fixed function and that are stored in the memory 12. In the present embodiment, the functions of the modules/units will be described in detail in the following embodiments.
The transmitting unit 110 generates an event monitoring request based on a preset event and transmits the event monitoring request to a preset browser.
In at least one embodiment of the present invention, the preset event may include, but is not limited to: onerror event, etc.
The event monitoring request may be generated by being triggered by a user, and the information carried by the event monitoring request includes, but is not limited to: an event is monitored.
The preset browser may be any browser, for example, the preset browser may be a Firefox browser or the like.
In at least one embodiment of the present invention, the sending unit 110 generates the event monitoring request based on the preset event, including:
and acquiring a monitoring instruction template from an instruction template library, and determining the filling quantity of all filling events in the monitoring instruction template.
Wherein, a plurality of instruction templates are stored in the instruction template library. Each fill event includes a tag corresponding to the event.
And determining the preset number of the preset events.
And processing all filling events in the monitoring instruction template based on the difference value between the filling quantity and the preset quantity to obtain a target template.
Specifically, the sending unit 110 processes all filling events in the monitoring instruction template based on the difference between the filling amount and the preset amount, and obtaining a target template includes:
if the filling quantity is larger than the preset quantity, deleting the filling events of which the quantity is the difference value from the monitoring instruction template, and determining the deleted monitoring instruction template as the target template; or
And if the filling quantity is smaller than the preset quantity, newly adding filling events of which the quantity is the difference value in the monitoring instruction template to obtain the target template.
Determining filling positions of all filling events in the target template.
The fill location refers to the location of the fill event.
And writing the preset event into the filling position to obtain the event monitoring request.
For example: the monitoring instruction template obtained from the instruction template library is as follows: event label 1, fill location 1; event tag 2 and filling position 2 ], wherein the filling number of the monitoring instruction template is determined to be 2, and the preset event comprises the following steps: the preset number is 3, and as the filling number 2 is smaller than the preset number 3, filling events are expanded in the monitoring instruction template to obtain a target template: event label 1, fill location 1; event tag 2, fill location 2; event label 3, fill position 3 ].
Through the embodiment, the monitoring instruction template can be processed according to the difference value between the preset number and the filling number, the problem that the event monitoring request cannot be generated when the preset number is not the filling number is avoided, the generation applicability of the event monitoring request is improved, and then the preset event can be accurately written into the filling position according to the mapping relation between all filling events and the filling position, so that the generation accuracy of the event monitoring request is improved.
In at least one embodiment of the present invention, the sending unit 110 sends the event monitoring request to a preset browser, where the event monitoring request includes:
acquiring a device address of the electronic device and acquiring a browser address of the preset browser;
establishing a connection channel between the equipment address and the browser address;
and sending the event monitoring request to the preset browser through the connecting channel.
Wherein the device address refers to an address of the electronic device.
By establishing the connection channel, the event monitoring request can be accurately sent to the preset browser, so that the monitoring object of event monitoring can be improved.
The receiving unit 111 receives a monitoring feedback packet generated based on the event monitoring request.
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 any information, and detects whether there is an identifier of the event monitoring request in the any information, and if there is an identifier of the event monitoring request in the any information, determines the received any information as the monitoring feedback packet.
The determining unit 112 determines a feedback webpage according to the monitoring feedback packet, and determines a feedback frequency of the feedback webpage, where the feedback webpage is a webpage generated by triggering the monitoring feedback packet.
In at least one embodiment of the invention, the feedback webpage may be any front-end webpage.
The feedback frequency refers to the frequency of the feedback webpage in the monitoring feedback packet.
In at least one embodiment of the present invention, the determining unit 112 determines the feedback webpage according to the monitoring feedback packet includes:
analyzing the message of the monitoring feedback packet to obtain the data information carried by the message;
acquiring a preset label, wherein the preset label is used for indicating a webpage;
acquiring information corresponding to the preset label from the data information as a webpage code;
and determining a webpage corresponding to the webpage code from a webpage mapping table as the feedback webpage.
And the mapping relation between the webpage codes and the webpages is stored in the webpage mapping table.
Through the embodiment, the whole monitoring feedback packet does not need to be analyzed, so that the acquisition efficiency of the data information can be improved, the feedback webpage can be quickly determined, in addition, the webpage code can be accurately determined through the mapping relation between the preset label and the webpage, and the feedback webpage can be accurately determined.
In at least one embodiment of the present invention, the determining unit 112 determines the feedback frequency of the feedback webpage by:
and determining a target feedback packet corresponding to each feedback webpage from the monitoring feedback packets.
And acquiring the receiving time of the target feedback packet.
The receiving time refers to a time when the electronic device receives the target feedback packet.
And acquiring the time with the minimum value from the receiving time as a first time, and acquiring the time with the maximum value from the receiving time as a second time.
And determining the time difference between the second time and the first time to obtain the target time.
And determining the feedback quantity of each feedback webpage according to the target feedback packet.
And dividing the feedback quantity by the target time to obtain the feedback frequency.
The target time can be accurately determined according to the receiving time of the target feedback packet, and then the feedback frequency of the feedback webpage can be accurately determined according to the target time.
If the feedback frequency is greater than the configuration value, the determining unit 112 determines the generation time of the monitoring feedback packet, and determines the trigger terminal of the monitoring feedback packet.
In at least one embodiment of the present invention, the configuration value may be set according to the frequency of the feedback webpage.
The generation time refers to the time for the preset browser to generate the monitoring feedback packet.
The triggering terminal is a terminal for triggering the generation of the monitoring feedback packet. The trigger terminal may be a terminal for the user to execute the feedback webpage.
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 trigger terminal of the monitoring feedback packet, including:
acquiring information indicating time from the data information as the generation time;
acquiring information indicating a terminal from the data information as a terminal address;
and determining the terminal corresponding to the terminal address as the trigger terminal.
By the embodiment, because the generation time and the terminal address are stored in the monitoring feedback packet, the generation time can be acquired by the tag indicating the time, the terminal address can be acquired by the tag indicating the terminal, and the trigger terminal can be accurately determined according to the terminal address.
The screening unit 113 screens a target log from the trigger terminal according to the generation time, where the target log is a log whose log time is in a time interval, and the time interval is generated according to the generation time and preset time.
In at least one embodiment of the present invention, the target log refers to a log whose log time is in a time interval, and the target log includes an error-reporting log and a non-error-reporting log.
In at least one embodiment of the present invention, the screening unit 113 screening the target log from the trigger terminal according to the generation time includes:
taking the sum of the generation time and the preset time as a third time;
determining a time interval according to the generation time and the third time;
acquiring all logs on the trigger terminal, and acquiring the log time of each log in all the logs;
and determining the log with the log time in the time interval as the target log.
The preset time can be determined according to the time for the trigger terminal to access the preset browser, and the value of the preset time is not limited by the invention.
Through the embodiment, because the monitoring feedback packet is used for feeding back the event monitoring request, a certain delay exists between the generation time of the monitoring feedback packet and the time of the trigger terminal accessing the feedback webpage, and the target log can be accurately screened from the trigger terminal according to the time interval, so that the analysis number of the log is reduced, and the acquisition efficiency of the subsequent error log is improved.
The extracting unit 114 extracts an error log from the target log according to the feedback webpage, where the error log is a log generated when the feedback webpage fails to operate.
It is emphasized that the error log may also be stored in a node of a block chain in order to further ensure the privacy and security of the error log.
In at least one embodiment of the present invention, the error log refers to a log of user behavior triggering generation of the monitoring feedback packet.
In at least one embodiment of the present invention, the extracting unit 114 extracting the error log from the target log according to the feedback webpage includes:
extracting an execution object from the target log;
comparing the execution object with the feedback webpage;
and if the execution object is the same as the feedback webpage, determining a target log corresponding to the execution object as the error report log.
Through the above embodiment, since the target log is generated by triggering 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.
In at least one embodiment of the present invention, after extracting an error log from the target log according to the feedback webpage, the extraction unit 114 extracts information indicating an entity from the error log as error information;
the determination unit 112 determines a triggering user of the event monitoring request;
the determining unit 112 determines the terminal bound with the trigger user as a user terminal;
the sending unit 110 sends the error information to the ue.
Through the embodiment, comprehensive error reporting information can be acquired from the error reporting log, and further the comprehensive error reporting information can be sent to the user terminal for user analysis.
According to the technical scheme, the event monitoring method and the event monitoring system can generate the event monitoring request based on the preset event and send the event monitoring request to the preset browser; receiving a monitoring feedback packet generated based on the event monitoring request; determining a feedback webpage according to the monitoring feedback packet, and determining the feedback frequency of the feedback webpage, wherein the feedback webpage is a webpage generated by triggering the monitoring feedback packet; if the feedback frequency is greater than a configuration value, determining the generation time of the monitoring feedback packet, and determining a trigger terminal of the monitoring feedback packet; screening a target log from the trigger terminal according to the generation time, wherein the target log refers to a log with the log time in a time interval, and the time interval is generated according to the generation time and preset time; and extracting an error report log from the target log according to the feedback webpage, wherein the error report log is a log generated when the operation of the feedback webpage fails. According to the method and the device, the webpage running on the preset browser is further monitored through the generated event monitoring request, when the monitoring feedback packet is received, the feedback webpage can be accurately determined from the monitoring feedback packet, the error log corresponding to the feedback webpage can be further extracted from the trigger terminal, and further comprehensive error reporting information can be obtained from the error log, so that the positioning of production problems is facilitated.
Fig. 5 is a schematic structural diagram of an electronic device implementing the method for collecting the front-end error log according to a preferred embodiment of the present invention.
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.
It will be appreciated by a person skilled in the art that the schematic diagram is only an example of the electronic device 1 and does not constitute a limitation of the electronic device 1, and that it may comprise more or less components than shown, or some components may be combined, or different components, e.g. the electronic device 1 may further comprise an input output device, a network access device, a bus, etc.
The Processor 13 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The processor 13 is an operation core and a control center of the electronic device 1, and is connected to each part of the whole electronic device 1 by various interfaces and lines, and executes an operating system of the electronic device 1 and various installed application programs, program codes, and the like.
Illustratively, the computer readable instructions may be partitioned into one or more modules/units that are stored in the memory 12 and executed by the processor 13 to implement the present invention. The one or more modules/units may be a series of computer readable instruction segments capable of performing specific functions, which are used for describing the execution process of the computer readable instructions in the electronic device 1. For example, the computer readable instructions may be partitioned into a sending unit 110, a receiving unit 111, a determining unit 112, a screening unit 113, and an extracting unit 114.
The memory 12 may be used for storing the computer readable instructions and/or modules, and the processor 13 implements various functions of the electronic device 1 by executing or executing the computer readable instructions and/or modules stored in the memory 12 and invoking data stored in the memory 12. The memory 12 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. The memory 12 may include non-volatile and volatile memories, such as: a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other storage device.
The memory 12 may be an external memory and/or an internal memory of the electronic device 1. Further, the memory 12 may be a memory having a physical form, such as a memory stick, a TF Card (Trans-flash Card), or the like.
The integrated modules/units of the electronic device 1 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the flow of the method according to the above embodiments may be implemented by hardware that is configured to be instructed by computer readable instructions, which may be stored in a computer readable storage medium, and when the computer readable instructions are executed by a processor, the steps of the method embodiments may be implemented.
Wherein the computer readable instructions comprise computer readable instruction code which may be in source code form, object code form, an executable file or some intermediate form, and the like. The computer-readable medium may include: any entity or device capable of carrying said computer readable instruction code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM).
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
With reference to fig. 1, the memory 12 in the electronic device 1 stores computer-readable instructions to implement a front-end error log collecting method, and the processor 13 can execute the computer-readable instructions to implement:
generating an event monitoring request based on a preset event, and sending the event monitoring request to a preset browser;
receiving a monitoring feedback packet generated based on the event monitoring request;
determining a feedback webpage according to the monitoring feedback packet, and determining the feedback frequency of the feedback webpage, wherein the feedback webpage is a webpage generated by triggering the monitoring feedback packet;
if the feedback frequency is greater than a configuration value, determining the generation time of the monitoring feedback packet, and determining a trigger terminal of the monitoring feedback packet;
screening a target log from the trigger terminal according to the generation time, wherein the target log refers to a log with the log time in a time interval, and the time interval is generated according to the generation time and preset time;
and extracting an error report log from the target log according to the feedback webpage, wherein the error report log is a log generated when the operation of the feedback webpage fails.
Specifically, the processor 13 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the computer readable instructions, which is not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The computer readable storage medium has computer readable instructions stored thereon, wherein the computer readable instructions when executed by the processor 13 are configured to implement the steps of:
generating an event monitoring request based on a preset event, and sending the event monitoring request to a preset browser;
receiving a monitoring feedback packet generated based on the event monitoring request;
determining a feedback webpage according to the monitoring feedback packet, and determining the feedback frequency of the feedback webpage, wherein the feedback webpage is a webpage generated by triggering the monitoring feedback packet;
if the feedback frequency is greater than a configuration value, determining the generation time of the monitoring feedback packet, and determining a trigger terminal of the monitoring feedback packet;
screening a target log from the trigger terminal according to the generation time, wherein the target log refers to a log with the log time in a time interval, and the time interval is generated according to the generation time and preset time;
and extracting an error report log from the target log according to the feedback webpage, wherein the error report log is a log generated when the operation of the feedback webpage fails.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. The plurality of units or devices may also be implemented by one unit or device through software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A front-end error log collection method is characterized by comprising the following steps:
generating an event monitoring request based on a preset event, and sending the event monitoring request to a preset browser;
receiving a monitoring feedback packet generated based on the event monitoring request;
determining a feedback webpage according to the monitoring feedback packet, and determining the feedback frequency of the feedback webpage, wherein the feedback webpage is a webpage generated by triggering the monitoring feedback packet;
if the feedback frequency is greater than a configuration value, determining the generation time of the monitoring feedback packet, and determining a trigger terminal of the monitoring feedback packet;
screening a target log from the trigger terminal according to the generation time, wherein the target log refers to a log with the log time in a time interval, and the time interval is generated according to the generation time and preset time;
and extracting an error report log from the target log according to the feedback webpage, wherein the error report log is a log generated when the operation of the feedback webpage fails.
2. The method for collecting front-end error log according to claim 1, wherein the generating an event monitoring request based on a preset event comprises:
acquiring a monitoring instruction template from an instruction template library, and determining the filling quantity of all filling events in the monitoring instruction template;
determining a preset number of the preset events;
processing all filling events in the monitoring instruction template based on the difference value between the filling quantity and the preset quantity to obtain a target template;
determining filling positions of all filling events in the target template;
and writing the preset event into the filling position to obtain the event monitoring request.
3. The method as claimed in claim 1, wherein said sending the event monitoring request to a predetermined browser includes:
acquiring a device address of the electronic device and acquiring a browser address of the preset browser;
establishing a connection channel between the equipment address and the browser address;
and sending the event monitoring request to the preset browser through the connecting channel.
4. The method as claimed in claim 1, wherein the determining a feedback webpage according to the monitoring feedback packet comprises:
analyzing the message of the monitoring feedback packet to obtain the data information carried by the message;
acquiring a preset label, wherein the preset label is used for indicating a webpage;
acquiring information corresponding to the preset label from the data information as a webpage code;
and determining a webpage corresponding to the webpage code from a webpage mapping table as the feedback webpage.
5. The front-end error log collection method of claim 1, wherein the determining the feedback frequency of the feedback webpage comprises:
determining a target feedback package corresponding to each feedback webpage from the monitoring feedback packages;
acquiring the receiving time of the target feedback packet;
acquiring the time with the minimum value from the receiving time as a first time, and acquiring the time with the maximum value from the receiving time as a second time;
determining the time difference between the second time and the first time to obtain target time;
determining the feedback quantity of each feedback webpage according to the target feedback packet;
and dividing the feedback quantity by the target time to obtain the feedback frequency.
6. The method for collecting front-end error-reporting logs according to claim 1, wherein the step of screening target logs from the trigger terminal according to the generation time comprises:
taking the sum of the generation time and the preset time as a third time;
determining a time interval according to the generation time and the third time;
acquiring all logs on the trigger terminal, and acquiring the log time of each log in all the logs;
and determining the log with the log time in the time interval as the target log.
7. The front-end error log collection method of claim 1, wherein after extracting the error log from the target log according to the feedback webpage, the method further comprises:
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 with the trigger user as a user terminal;
and sending the error reporting information to the user terminal.
8. The utility model provides a front end error log collection system which characterized in that, front end error log collection system includes:
the system comprises a sending unit, a receiving unit and a processing unit, wherein the sending unit is used for generating an event monitoring request based on a preset event and sending the event monitoring request to a preset browser;
a receiving unit, configured to receive a monitoring feedback packet generated based on the event monitoring request;
the determining unit is used for determining a feedback webpage according to the monitoring feedback packet and determining the feedback frequency of the feedback webpage, wherein the feedback webpage is a webpage generated by triggering the monitoring feedback packet;
the determining unit is further configured to determine the generation time of the monitoring feedback packet and determine a trigger terminal of the monitoring feedback packet if the feedback frequency is greater than a configuration value;
the screening unit is used for screening a target log from the trigger terminal according to the generation time, wherein the target log refers to a log with a log time in a time interval, and the time interval is generated according to the generation time and preset time;
and the extracting unit is used for extracting an error log from the target log according to the feedback webpage, wherein the error log is a log generated when the operation of the feedback webpage fails.
9. An electronic device, characterized in that the electronic device comprises:
a memory storing computer readable instructions; and
a processor executing computer readable instructions stored in the memory to implement the front-end error log collection method of any of claims 1 to 7.
10. A computer-readable storage medium characterized by: the computer-readable storage medium stores computer-readable instructions, which are executed by a processor in an electronic device to implement the front-end error log collecting method according to any one of claims 1 to 7.
CN202011601565.7A 2020-12-29 2020-12-29 Front-end error log collection method, device, equipment and storage medium Pending CN112685253A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011601565.7A CN112685253A (en) 2020-12-29 2020-12-29 Front-end error log collection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011601565.7A CN112685253A (en) 2020-12-29 2020-12-29 Front-end error log collection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112685253A true CN112685253A (en) 2021-04-20

Family

ID=75454537

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011601565.7A Pending CN112685253A (en) 2020-12-29 2020-12-29 Front-end error log collection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112685253A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110252057A1 (en) * 2010-04-07 2011-10-13 Apple Inc. Journaling on mobile devices
CN102684934A (en) * 2011-03-17 2012-09-19 阿里巴巴集团控股有限公司 Method and system for monitoring property of web application program and web server
WO2013165180A1 (en) * 2012-05-03 2013-11-07 (주)네오위즈게임즈 Log monitoring method, server therefor and recording medium
CN108334446A (en) * 2017-12-29 2018-07-27 五八有限公司 A kind of method of calibration of web page template, device and computer readable storage medium
CN108628741A (en) * 2018-04-10 2018-10-09 平安科技(深圳)有限公司 Webpage test method, device, electronic equipment and medium
CN109471976A (en) * 2018-11-07 2019-03-15 北京字节跳动网络技术有限公司 Processing method, device, electronic equipment and the storage medium of web page operation data
CN111752793A (en) * 2020-05-27 2020-10-09 中国平安财产保险股份有限公司 System abnormity monitoring method and device, computer equipment and storage medium
CN111897713A (en) * 2020-06-22 2020-11-06 广州市玄武无线科技股份有限公司 Friendly prompt method and system based on PAAS platform front-end engine abnormity
CN112134865A (en) * 2020-09-15 2020-12-25 深圳市欢太科技有限公司 Log information reporting method, electronic equipment and readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110252057A1 (en) * 2010-04-07 2011-10-13 Apple Inc. Journaling on mobile devices
CN102684934A (en) * 2011-03-17 2012-09-19 阿里巴巴集团控股有限公司 Method and system for monitoring property of web application program and web server
WO2013165180A1 (en) * 2012-05-03 2013-11-07 (주)네오위즈게임즈 Log monitoring method, server therefor and recording medium
CN108334446A (en) * 2017-12-29 2018-07-27 五八有限公司 A kind of method of calibration of web page template, device and computer readable storage medium
CN108628741A (en) * 2018-04-10 2018-10-09 平安科技(深圳)有限公司 Webpage test method, device, electronic equipment and medium
CN109471976A (en) * 2018-11-07 2019-03-15 北京字节跳动网络技术有限公司 Processing method, device, electronic equipment and the storage medium of web page operation data
CN111752793A (en) * 2020-05-27 2020-10-09 中国平安财产保险股份有限公司 System abnormity monitoring method and device, computer equipment and storage medium
CN111897713A (en) * 2020-06-22 2020-11-06 广州市玄武无线科技股份有限公司 Friendly prompt method and system based on PAAS platform front-end engine abnormity
CN112134865A (en) * 2020-09-15 2020-12-25 深圳市欢太科技有限公司 Log information reporting method, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN112667240A (en) Program code conversion method and related device
CN109656797B (en) Log data association method and device
CN111797351A (en) Page data management method and device, electronic equipment and medium
CN112433705A (en) Script generation method and device, electronic equipment and storage medium
CN110825731A (en) Data storage method and device, electronic equipment and storage medium
CN113050900A (en) Screen sharing method, device, equipment and storage medium
CN112506486A (en) Search system establishing method and device, electronic equipment and readable storage medium
CN110750443A (en) Webpage testing method and device, computer equipment and storage medium
CN112363935A (en) Data joint debugging method and device, electronic equipment and storage medium
CN112947911A (en) Interface script generation method, device, equipment and storage medium
CN112948418A (en) Dynamic query method, device, equipment and storage medium
CN114116108A (en) Dynamic rendering method, device, equipment and storage medium
CN112527414B (en) Front-end-based data processing method, device, equipment and storage medium
CN112711398A (en) Method, device and equipment for generating buried point file and storage medium
CN113918467A (en) Financial system testing method, device, equipment and storage medium
CN112784566A (en) Document generation method, device, equipment and storage medium
CN112711696A (en) Request access method, device, electronic equipment and storage medium
CN112632163A (en) Big data report exporting method and related equipment
CN111881209A (en) Data synchronization method and device for heterogeneous database, electronic equipment and medium
CN116360769A (en) Code generation method, device, equipment and storage medium
CN112685253A (en) Front-end error log collection method, device, equipment and storage medium
CN114003784A (en) Request recording method, device, equipment and storage medium
CN115794621A (en) Code coverage test method, device, equipment and storage medium
CN112181485B (en) Script execution method and device, electronic equipment and storage medium
CN114610386A (en) Interaction method, device, equipment and storage medium of H5 and application program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination