Method and device for monitoring front-end errors, computer equipment and readable storage medium
By obtaining and judging the reporting time and cumulative number of error data in front-end error monitoring, the classification collection of error data and the preset acquisition frequency of error data are realized, and the problems of poor real-time, low efficiency and poor accuracy of front-end error monitoring in the existing technology are solved, reducing the pressure on the server by redundant data.
Patent Information
- Application Number
- CN202411690938.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-18
AI Technical Summary
In the existing front-end error monitoring methods, the error message data is messy and difficult to quickly locate the fault, resulting in poor real-time, low efficiency and poor accuracy. At the same time, the burial point reporting generates a large amount of redundant data, which is stressed by the server.
By obtaining the last reporting time of the current time, the target error type and the cumulative number of current reporting times, we can determine whether the front-end error data is obtained and reported at the current time, and update the reporting time and cumulative number of times, so as to realize the data collection and reporting of classified collection frequency and preset collection frequency.
Improve the real-time, efficiency and accuracy of front-end error monitoring, reduce the generation of redundant data, and reduce the pressure on the server.
Smart Images

Figure CN119645759A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of front-end development technology, and in particular to a method, apparatus, computer device and readable storage medium for monitoring front-end errors. Background Art
[0002] With the rapid development of the World Wide Web (web) applications, JavaScript and other front-end technologies have become increasingly important in web development. However, due to multiple factors such as the network environment and browser compatibility, various errors may occur during the operation of the front-end code, which in turn affects the user experience. Therefore, an efficient front-end error monitoring method is urgently needed to improve the user experience.
[0003] In related technologies, front-end error monitoring mainly relies on point-of-care reporting, which can capture error information generated during the running of the front-end code and report the front-end error information to the server. Developers record the point-of-care reporting data received by the server and take corresponding measures to manage front-end operation abnormalities.
[0004] However, when front-end error monitoring is performed based on relevant technologies, the collected error information data is disorganized and it is difficult to quickly locate specific fault information, resulting in poor real-time, low efficiency, and poor accuracy of front-end error monitoring. In addition, the process of tracking and reporting will generate a large amount of redundant data, which will cause great pressure on the server. Summary of the invention
[0005] The purpose of this application is to provide a method, device, computer equipment and readable storage medium for monitoring front-end errors, which can achieve the classification and collection of front-end error information, and collect various types of front-end error information based on a preset collection frequency, thereby improving the real-time, efficiency and accuracy of front-end error monitoring, and greatly reducing the effect of redundant data.
[0006] The embodiment of the present application is implemented as follows:
[0007] A first aspect of an embodiment of the present application provides a method for monitoring a front-end error, the method comprising:
[0008] Get the current time, the last reporting time corresponding to the target error type, and the current cumulative number of reports corresponding to the target error type;
[0009] Determine whether to obtain and report the front-end error data of the target error type at the current time according to the current time, the last reporting time, and the current cumulative number of reports;
[0010] If so, obtain and report the front-end error data at the current time, update the last reporting time, and update the current cumulative number of reports.
[0011] As a possible implementation method, whether to obtain and report the front-end error data of the target error type at the current time is determined according to the current time, the last reporting time, and the current cumulative number of reports, including:
[0012] Determine whether to obtain and report the front-end error data of the target error type at the current time based on the current time, the last reporting time, the current cumulative number of reports, the preset collection and reporting cycle length, and the preset cumulative number of reports.
[0013] As a possible implementation method, whether to obtain and report the front-end error data of the target error type at the current time is determined according to the current time, the last reporting time, the current cumulative number of reports, the preset collection and reporting cycle length, and the preset cumulative number of times, including:
[0014] If the current cumulative number of reports is less than the preset cumulative number, and the time difference between the current time and the last reporting time is greater than or equal to the preset collection and reporting cycle length, it is determined to obtain and report the front-end error data of the target error type at the current time.
[0015] As a possible implementation method, whether to obtain and report the front-end error data of the target error type at the current time is determined according to the current time, the last reporting time, and the current cumulative number of reports, including:
[0016] Determine whether to obtain and report the front-end error data of the target error type at the current time based on the current time, the last reporting time, the current cumulative number of reports, the preset cumulative number of reports, and the preset duration threshold.
[0017] As a possible implementation method, whether to obtain and report the front-end error data of the target error type at the current time is determined according to the current time, the last reporting time, the current cumulative number of reports, the preset cumulative number of reports, and the preset duration threshold, including:
[0018] If the current cumulative number of reports is greater than or equal to the preset cumulative number of reports, and the time difference between the current time and the last reporting time is greater than or equal to the preset duration threshold, and the front-end error data of the target error type is not obtained between the current time and the last reporting time, then it is determined to obtain and report the front-end error data of the target error type at the current time.
[0019] As a possible implementation method, the current cumulative number of reports is updated, including:
[0020] Update the current cumulative number of reports to the value corresponding to one report.
[0021] As a possible implementation method, whether to obtain and report the front-end error data of the target error type at the current time is determined according to the current time, the last reporting time, the current cumulative number of reports, the preset cumulative number of reports, and the preset duration threshold, including:
[0022] If the current cumulative number of reports is greater than or equal to the preset cumulative number of times, and the time difference between the current time and the last reporting time is less than the preset duration threshold, and the front-end error data of the target error type is obtained between the current time and the last reporting time, then it is determined to obtain and report the front-end error data of the target error type at the current time.
[0023] As a possible implementation method, after determining to obtain and report the front-end error data of the target error type at the current time, it also includes:
[0024] If the current cumulative number of reports is greater than or equal to the preset cumulative number of times, and the time difference between the current time and the last reporting time is less than the preset duration threshold, front-end error data of the target error type is obtained between the current time and the last reporting time, and the time difference between the current time and the last reporting time is less than or equal to the preset cooling time, then it is determined that the front-end error data of the target error type will not be obtained and reported within the preset cooling time after the current time.
[0025] According to a second aspect of an embodiment of the present application, a device for monitoring front-end errors is provided, the device comprising:
[0026] An acquisition module is used to obtain the current time, the last reporting time corresponding to the target error type, and the current cumulative number of reports corresponding to the target error type;
[0027] A judgment module is used to determine whether to obtain and report the front-end error data of the target error type at the current time according to the current time, the last reporting time and the current cumulative number of reports;
[0028] If so, the update reporting module is used to obtain and report the front-end error data at the current time, update the last reporting time, and update the current cumulative number of reports.
[0029] According to a third aspect of an embodiment of the present application, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the method for monitoring front-end errors described in the first aspect is implemented.
[0030] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the method for monitoring front-end errors described in the first aspect is implemented.
[0031] The beneficial effects of the embodiments of the present application include:
[0032] A method for monitoring front-end errors provided by an embodiment of the present application is to obtain the current occurrence time point of the front-end error data of the target error type, the last reporting time corresponding to the target error type, and the cumulative number of reports of the front-end error data of the target error type before the current time point, and determine whether to obtain and report the front-end error data of the target error type at the current time point according to the current occurrence time point of the front-end error data of the target error type, the last reporting time corresponding to the target error type, and the cumulative number of reports of the front-end error data of the target error type before the current time point; if so, obtain and report the front-end error data at the current time, and replace the current time with the last reporting time corresponding to the target error type, and update the current cumulative number of reports of the target error type. Among them, the front-end error data is classified in advance according to the attributes of the front-end error data generated by the front-end program running, and data collection and data reporting are performed on various types of front-end error data based on whether the time difference between the current time and the last reporting meets the preset collection frequency. In this way, the front-end error information can be collected by classification, and various types of front-end error information can be collected based on the preset collection frequency, so as to improve the real-time, efficiency and accuracy of the front-end error monitoring, and greatly reduce the effect of redundant data. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 This is a system framework diagram for reporting errors in the existing monitoring front-end.
[0035] Figure 2 A flowchart of a first method for monitoring front-end errors provided in an embodiment of the present application;
[0036] Figure 3 A flowchart of a second method for monitoring front-end errors provided in an embodiment of the present application;
[0037] Figure 4A flowchart of a third method for monitoring front-end errors provided in an embodiment of the present application;
[0038] Figure 5 A schematic diagram of the structure of a device for monitoring front-end errors provided in an embodiment of the present application;
[0039] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0041] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0042] At present, front-end error monitoring mainly relies on tracking point reporting, which can capture the error information generated during the operation of the front-end code and report the front-end error information to the server. Developers record the tracking point reporting data received by the server and take corresponding measures to manage the front-end operation anomalies. However, this solution has the problem that the collected error information data is disorganized and it is difficult to quickly locate the specific fault information, which leads to poor real-time performance, low efficiency and accuracy of front-end error monitoring. In addition, a large amount of redundant data will be generated during the tracking point reporting process, which will cause great pressure on the server.
[0043] To this end, the embodiment of the present application provides a method for monitoring front-end errors, by obtaining the current time, the last reporting time corresponding to the target error type, and the current cumulative number of reports corresponding to the target error type; and judging whether the current time obtains and reports the front-end error data of the target error type according to the current time, the last reporting time corresponding to the target error type, and the current cumulative number of reports corresponding to the target error type; if it is determined that the front-end error data of the target error type is obtained and reported at the current time, the last reporting time of the target error type is updated, and the current cumulative number of reports of the target error type is updated. In this way, the front-end error information can be collected by classification, and various types of front-end error information can be collected based on the preset collection frequency, so as to improve the real-time, efficiency and accuracy of the front-end error monitoring, and greatly reduce the effect of redundant data.
[0044] Figure 1 This is a system framework diagram for an existing tracking point reporting monitoring front-end error, see Figure 1 The existing method of monitoring front-end errors is often implemented by point reporting. The front-end monitoring script is embedded in the Web end. The front-end error data generated during the operation of the front-end program is collected in real time through the front-end monitoring script, and the collected front-end error data is analyzed and integrated, and the analysis and integration results are rendered. The online errors are located through the rendered front-end error data, and the front-end error information is displayed through a visualization platform.
[0045] The following is a detailed explanation of the method for monitoring front-end errors provided in an embodiment of the present application in conjunction with the accompanying drawings.
[0046] Figure 2 A flowchart of a method for monitoring front-end errors provided by the present application, which can be applied to a computer device or a server, see Figure 2 , an embodiment of the present application provides a method for monitoring front-end errors, comprising:
[0047] S201. Obtain the current time, the last reporting time corresponding to the target error type, and the current cumulative number of reports corresponding to the target error type.
[0048] Optionally, the front-end code will generate front-end error data during its operation. The front-end error data will be classified and graded in advance based on the attributes of the front-end error data. The error level corresponding to the front-end error data may be general, serious, urgent, etc. The error type corresponding to the front-end error data may be P0 type accident, P1 type accident, P2 type accident, etc. This application does not make any specific limitations on this.
[0049] Optionally, the target error type is used to indicate a certain error type among the error types corresponding to the front-end error data. The target error type can be any one of the P0 type accident, P1 type accident, and P2 type accident. This application does not make any specific limitations on this.
[0050] Optionally, the last reporting time corresponding to the target error type is used to indicate the time node when the front-end error data of the target error type was most recently reported to the server before the current time, and the current time is used to indicate the current time node when the front-end error data of the target error type is collected again after the front-end error data of the target error type was received for the last time. For example, the time point when the front-end error data of a P0 type accident was last received was 15:00:00, and the current time is 15:05:15 when the front-end error data of a P0 type accident is received again.
[0051] Optionally, the current cumulative number of reports corresponding to the target error type is used to indicate the sum of the number of times the front-end error data of the target error type is reported to the server before the current time node. For example, the front-end error data of a P0 type accident is obtained and reported to the server at 14:50:00, and 1 is added to the initial cumulative number of reports of 0. The front-end error data of the P0 type accident is obtained and reported to the server at 15:00:00, and 1 is added to the cumulative number of reports of 1. When the front-end error data of the P0 type accident is received again at the current time 15:05:15, the current cumulative number of reports of the P0 type accident is 2.
[0052] It is worth noting that, while collecting front-end error data, the embodiment of the present application reports the collected front-end error data to the server to ensure the real-time nature of front-end error monitoring.
[0053] S202: Determine whether to obtain and report the front-end error data of the target error type at the current time according to the current time, the last reporting time, and the current cumulative number of reports.
[0054] Optionally, based on the time node when the front-end error data of the target error type is currently generated, the time node when the front-end error data of the target error type was last reported to the server, and the current cumulative number of reports of the front-end error data of the target error type, determine whether to continue to obtain the front-end error data of the target error type at the current time node, and synchronously report the front-end error data of the target error type to the server.
[0055] S203: If yes, obtain and report the front-end error data at the current time, update the last reporting time, and update the current cumulative number of reports.
[0056] Optionally, when it is determined to collect front-end error data of the target error type at the current time node, the front-end error data of the target error type is collected and reported to the server synchronously, and the current time is used as the last reporting time to update the old current reporting time, and the current cumulative number of reports corresponding to the target error type is synchronously updated.
[0057] In an embodiment of the present application, by obtaining the current occurrence time point of the front-end error data of the target error type, the last reporting time corresponding to the target error type, and the cumulative number of reports of the front-end error data of the target error type before the current time point, and according to the current occurrence time point of the front-end error data of the target error type, the last reporting time corresponding to the target error type, and the cumulative number of reports of the front-end error data of the target error type before the current time point, it is determined whether to obtain and report the front-end error data of the target error type at the current time point; if so, the front-end error data is obtained and reported at the current time, and the current time is replaced by the last reporting time corresponding to the target error type, and the current cumulative number of reports of the target error type is updated. Among them, the front-end error data is classified in advance according to the attributes of the front-end error data generated by the front-end program running, and data collection and data reporting are performed on various types of front-end error data based on whether the time difference between the current time and the last reporting meets the preset collection frequency. In this way, the front-end error information can be collected by classification, and various types of front-end error information can be collected based on the preset collection frequency, so as to improve the real-time, efficiency and accuracy of the front-end error monitoring, and greatly reduce the effect of redundant data.
[0058] For a possible implementation, see Figure 3 The operation of step S202 may specifically be:
[0059] S301. Determine whether to obtain and report the front-end error data of the target error type at the current time according to the current time, the last reporting time, the current cumulative number of reports, the preset collection and reporting cycle length, and the preset cumulative number of reports.
[0060] Optionally, the preset collection and reporting cycle duration is a collection frequency set by the user based on the error level or error category of the front-end error data. The preset collection and reporting cycle duration can be 10 minutes, 30 minutes, 1 hour, 2 hours, etc. This application does not make any specific limitations on this.
[0061] Exemplarily, the collection and reporting cycle of the front-end error data of P0 type accidents is preset to 10 minutes, and the error level of P0 type accidents is emergency accidents; the collection and reporting cycle of the front-end error data of P1 type accidents is preset to 30 minutes, and the error level of P1 type accidents is serious accidents; the collection and reporting cycle of the front-end error data of P2 type accidents is preset to 2 hours, and the error level of P2 type accidents is general accidents.
[0062] Optionally, the preset cumulative number is a reporting limit of the cumulative reporting number preset by the user, and the preset cumulative number can be 3 times, 5 times, 7 times, etc., and this application does not make specific restrictions on this. It is worth noting that this application takes the preset cumulative number of 3 times as an example, but it does not mean that the preset cumulative number can only be 3 times.
[0063] Optionally, based on the current occurrence time of the front-end error data of the target error type, the last reporting time of the front-end error data of the target error type, the current cumulative reporting times of the front-end error data of the target error type, the preset collection and reporting cycle duration corresponding to the target error type, and the preset cumulative times, it is determined whether to collect the front-end error data of the target error type at the current occurrence time of the front-end error data of the target error type.
[0064] In an optional implementation manner, the operation of step S301 may specifically be:
[0065] If the current cumulative number of reports is less than the preset cumulative number, and the time difference between the current time and the last reporting time is greater than or equal to the preset collection and reporting cycle length, it is determined to obtain and report the front-end error data of the target error type at the current time.
[0066] Optionally, when the current cumulative number of reports of the front-end error data of the target error type is less than the preset cumulative number limit, and the time difference between the current occurrence time point of the front-end error data of the target error type and the most recent reporting time of the target error type is greater than the preset collection and reporting cycle length corresponding to the target error type, it is determined to obtain and report the front-end error data of the target error type at the current occurrence time point of the front-end error data of the target error type.
[0067] Exemplarily, the preset target error type is a P0 type accident, the current cumulative number of reports of the front-end error data of the P0 type accident is 2 times, the preset cumulative number is 3 times, the most recent reporting time of the front-end error data of the P0 type accident before the current time point is 15:00:00, and the collection and reporting cycle duration corresponding to the P0 type accident is 10 minutes. If the current time node of the front-end error data of the P0 type accident is 15:10:15, the cumulative number of reports of the front-end error data of the P0 type accident before the current time point is 2 times less than the preset cumulative number of 3 times, and the time difference between the current occurrence time point 15:10:15 of the front-end error data of the P0 type accident and the last reporting time 15:00:00 of the front-end error data of the P0 type accident is greater than the preset collection and reporting cycle duration of 10 minutes, then the P0 type accident generated at 15:10:15 is collected. The front-end error data of the accident is collected and reported to the server, and the last reporting time of the P0 type accident is updated to 15:10:15, and the cumulative reporting number of the P0 type accident is updated to 3 times; if the current time node of the front-end error data of the P0 type accident is 15:05:00, the cumulative reporting number of the front-end error data of the P0 type accident before the current time point is 2 times which is less than the preset cumulative number of 3 times, but the time difference between the current occurrence time point 15:05:00 of the front-end error data of the P0 type accident and the last reporting time 15:00:00 of the front-end error data of the P0 type accident is less than the preset collection and reporting cycle length of 10 minutes, the front-end error data of the P0 type accident generated at 15:05:00 will not be collected, the last reporting time of the P0 type accident will still be 15:00:00, and the cumulative reporting number of the P0 type accident will still be 2 times.
[0068] For a possible implementation, see Figure 3 The operation of step S202 may also be specifically:
[0069] S302: Determine whether to obtain and report the front-end error data of the target error type at the current time according to the current time, the last reporting time, the current cumulative number of reports, the preset cumulative number of reports, and the preset duration threshold.
[0070] Optionally, the preset duration threshold is a time length threshold set in advance by the user, and whether the target error type is frequent front-end error data is determined by whether there is front-end error data of the target error type generated within the time length threshold. If there is front-end error data of the target error type generated within the preset duration threshold, the front-end error data of the target error type is determined to be frequent front-end error data, and the front-end error data is no longer collected and reported after the preset duration threshold; if there is no front-end error data of the target error type generated within the preset duration threshold, the front-end error data of the target error type is determined to be sporadic front-end error data, and the front-end error data of the target error type is continued to be collected based on the preset collection frequency after the preset duration threshold. Among them, the preset duration threshold can be 0.5 hours, 1 hour, 2 hours, etc., and this application does not make specific limitations on this.
[0071] It is worth noting that the front-end error data of the target error type collected within the preset time threshold is not collected based on the preset collection cycle duration. Once the front-end error data of the target error type is generated within the preset time threshold, the front-end error data of the target error type is immediately obtained and reported to the server.
[0072] Optionally, based on the current occurrence time point of the front-end error data of the target error type, the last reporting time of the front-end error data of the target error type, the current cumulative number of reports of the target error type, a preset cumulative number of reports, and a preset duration threshold, determine whether to continue to obtain and report the front-end error data of the target error type at the current occurrence time point of the front-end error data of the target error type.
[0073] For a possible implementation, see Figure 4 The operation of step S302 may specifically be:
[0074] S401. If the current cumulative number of reports is greater than or equal to the preset cumulative number of reports, and the time difference between the current time and the last reporting time is greater than or equal to the preset duration threshold, and the front-end error data of the target error type is not obtained between the current time and the last reporting time, then determine to obtain and report the front-end error data of the target error type at the current time.
[0075] Optionally, when the cumulative number of reports of front-end error data of the target error type before the current time point is greater than or equal to the preset cumulative number, and the time difference between the current occurrence time node of the front-end error data of the target error type and the most recent reporting time of the front-end error data of the target error type is greater than or equal to a preset duration threshold, and when no front-end error data of the target error type is generated within a period of time between the current occurrence time node of the front-end error data of the target error type and the most recent reporting time of the front-end error data of the target error type, the front-end error data of the target error type continues to be collected according to the preset collection cycle duration corresponding to the target error type, that is, the front-end error data of the target error type can be collected at the current time point.
[0076] In an optional implementation manner, the operation of updating the current cumulative number of reports in step S401 may specifically be:
[0077] Update the current cumulative number of reports to the value corresponding to one report.
[0078] Optionally, when no front-end error data of the target error type is generated within a period of time between the current occurrence time node of the front-end error data of the target error type and the last reporting time of the front-end error data of the target error type, the cumulative reporting times of the front-end error data of the target error type are recounted.
[0079] For example, the preset target error type is a P0 type accident, the current cumulative number of reports of the front-end error data of the P0 type accident is 3 times, the preset cumulative number is 3 times, the preset time threshold is 1 hour, the most recent reporting time of the front-end error data of the P0 type accident before the current time point is 15:00:00, and the collection and reporting cycle corresponding to the P0 type accident is 10 minutes. If the current time node of the front-end error data of the P0 type accident is 16:10:00, the front-end error data of the P0 type accident is at the current time point If the previous cumulative number of reports is equal to 3 times, and the time difference of 70 minutes between the current occurrence time point 16:10:00 of the front-end error data of the P0 type accident and the last reporting time 15:00:00 of the front-end error data of the P0 type accident is greater than the preset time threshold of 60 minutes, then the front-end error data of the P0 type accident generated at 16:10:00 is collected and reported to the server, and the last reporting time of the P0 type accident is updated to 16:10:00, and the cumulative number of reports of the P0 type accident is updated to 1.
[0080] For a possible implementation, see Figure 4 The operation of step S302 may also be specifically:
[0081] S402. If the current cumulative number of reports is greater than or equal to the preset cumulative number of reports, and the time difference between the current time and the last reporting time is less than the preset duration threshold, and the front-end error data of the target error type is obtained between the current time and the last reporting time, then it is determined to obtain and report the front-end error data of the target error type at the current time.
[0082] Optionally, when the current cumulative reporting number of front-end error data of the target error type is greater than or equal to the preset cumulative number, and the time difference between the current occurrence time node of the front-end error data of the target error type and the last reporting time of the front-end error data of the target error type is less than a preset duration threshold, and front-end error data of the target error type is generated within a period of time between the current occurrence time point of the front-end error data of the target error type and the last reporting time of the front-end data of the target error type, then the front-end error data of the target error type at the current time point is obtained and reported to the server.
[0083] Exemplarily, the preset target error type is a P0 type accident, the current cumulative number of reports of the front-end error data of the P0 type accident is 3 times, the preset cumulative number is 3 times, the preset time threshold is 1 hour, the most recent reporting time of the front-end error data of the P0 type accident before the current time point is 15:00:00, and the collection and reporting cycle duration corresponding to the P0 type accident is 10 minutes. If the time node at which the front-end error data of the P0 type accident currently occurs is 15:35:00, the cumulative number of reports of the front-end error data of the P0 type accident before the current time point is equal to 3 times, If the time difference between the current occurrence time point 15:35:00 of the front-end error data of the P0 type accident and the last reporting time 15:00:00 of the front-end error data of the P0 type accident, which is 35 minutes, is less than the preset duration threshold of 60 minutes, then the front-end error data of the P0 type accident generated at 15:35:00 is collected and reported to the server, and the last reporting time of the P0 type accident is updated to 15:35:00, and the cumulative number of reports of the P0 type accident is updated to 4 times, and the front-end error data of the target error type will no longer be collected after the preset duration threshold.
[0084] For a possible implementation, see Figure 4 , after determining to obtain and report the front-end error data of the target error type at the current time, it also includes:
[0085] S403. If the current cumulative number of reports is greater than or equal to the preset cumulative number of reports, and the time difference between the current time and the last reporting time is less than the preset duration threshold, the front-end error data of the target error type is obtained between the current time and the last reporting time, and the time difference between the current time and the last reporting time is less than or equal to the preset cooling time, then it is determined not to obtain and report the front-end error data of the target error type within the preset cooling time after the current time.
[0086] Optionally, the preset cooling period is used to indicate a cooling cycle of the monitoring front-end error. The preset cooling period can be 12 hours, 24 hours, 48 hours, etc. This application takes the preset cooling period of 24 hours as an example, but it does not mean that the preset cooling period can only be set to 24 hours. This application does not limit this.
[0087] Optionally, when the current cumulative reporting number of front-end error data of the target error type is greater than or equal to the preset cumulative number, and the time difference between the current occurrence time point of the front-end error data of the target error type and the last reporting time of the front-end error data of the target error type is less than a preset duration threshold, and the front-end error data of the target error type is generated between the current occurrence time point of the front-end data of the target error type and the last reporting time of the target error type, and the time difference between the current occurrence time point of the front-end error data of the target error type and the last reporting time of the front-end error data of the target error type is within a preset cooling time limit, the front-end error data of the target error type will no longer be acquired.
[0088] For example, the preset target error type is a P0 type accident, the current cumulative number of reports of the front-end error data of the P0 type accident is 3 times, the preset cumulative number is 3 times, the preset time threshold is 1 hour, the preset cooling time is 24 hours, the most recent reporting time of the front-end error data of the P0 type accident before the current time point is 15:00:00, and the collection and reporting cycle corresponding to the P0 type accident is 10 minutes. If the current time node of the front-end error data of the P0 type accident is 15:35:00, the cumulative number of reports of the front-end error data of the P0 type accident before the current time point, etc. If the front-end error data of the P0 type accident is collected for 3 times and the time difference between the current occurrence time point 15:35:00 of the front-end error data of the P0 type accident and the last reporting time 15:00:00 of the front-end error data of the P0 type accident is 35 minutes, which is less than the preset time threshold of 60 minutes, and the current occurrence time point of the front-end error data of the P0 type accident and the last reporting time of the front-end error data of the target error type are both within the preset cooling-off time of 24 hours, then after the front-end error data of the P0 type accident generated at 15:35:00 is collected and reported to the server, the front-end error data of the P0 type accident will no longer be collected.
[0089] In an optional implementation, historical front-end error data is used regularly to train a preset front-end error prediction model, and the trained front-end error prediction model is used to predict the incidence of front-end error data of each error type in the future period. The basic incidence of front-end errors of each error type is determined by a large amount of front-end error data, and the corresponding impact parameters of each error type are determined according to the time point when a large amount of front-end error data occurs. The front-end error prediction model is constructed according to the basic incidence and impact parameters of the front-end error data of each error type.
[0090] The following describes the apparatus, device, and computer-readable storage medium used to execute the method for monitoring front-end errors provided in the present application. The specific implementation process and technical effects are described above and will not be repeated below.
[0091] Figure 5 is a schematic diagram of a device for monitoring front-end errors provided in an embodiment of the present application, see Figure 5 , the device comprises:
[0092] An acquisition module 501 is used to acquire the current time, the last reporting time corresponding to the target error type, and the current cumulative number of reports corresponding to the target error type;
[0093] The judgment module 502 is used to determine whether to obtain and report the front-end error data of the target error type at the current time according to the current time, the last reporting time and the current cumulative number of reports;
[0094] If so, the update reporting module 503 is used to obtain and report the front-end error data at the current time, update the last reporting time, and update the current cumulative number of reports.
[0095] In an optional implementation manner, the above-mentioned determination module 502 is specifically used for:
[0096] Determine whether to obtain and report the front-end error data of the target error type at the current time based on the current time, the last reporting time, the current cumulative number of reports, the preset collection and reporting cycle length, and the preset cumulative number of reports.
[0097] In an optional implementation manner, the above-mentioned determination module 502 may be specifically used for:
[0098] If the current cumulative number of reports is less than the preset cumulative number, and the time difference between the current time and the last reporting time is greater than or equal to the preset collection and reporting cycle length, it is determined to obtain and report the front-end error data of the target error type at the current time.
[0099] In an optional implementation manner, the above-mentioned determination module 502 is further specifically used for:
[0100] Determine whether to obtain and report the front-end error data of the target error type at the current time based on the current time, the last reporting time, the current cumulative number of reports, the preset cumulative number of reports, and the preset duration threshold.
[0101] In an optional implementation manner, the above-mentioned determination module 502 may also be specifically used for:
[0102] If the current cumulative number of reports is greater than or equal to the preset cumulative number of reports, and the time difference between the current time and the last reporting time is greater than or equal to the preset duration threshold, and the front-end error data of the target error type is not obtained between the current time and the last reporting time, then it is determined to obtain and report the front-end error data of the target error type at the current time, update the last reporting time, and update the current cumulative number of reports.
[0103] In an optional implementation manner, the update reporting module 503 is specifically used to:
[0104] Update the current cumulative number of reports to the value corresponding to one report.
[0105] In an optional implementation manner, the above-mentioned determination module 502 is further specifically used for:
[0106] If the current cumulative number of reports is greater than or equal to the preset cumulative number of times, and the time difference between the current time and the last reporting time is less than the preset duration threshold, and the front-end error data of the target error type is obtained between the current time and the last reporting time, then it is determined to obtain and report the front-end error data of the target error type at the current time, update the last reporting time, and update the current cumulative number of reports.
[0107] In an optional implementation manner, after determining to obtain and report the front-end error data of the target error type at the current time, the above-mentioned determination module 502 may also be specifically used to:
[0108] If the current cumulative number of reports is greater than or equal to the preset cumulative number of times, and the time difference between the current time and the last reporting time is less than the preset duration threshold, front-end error data of the target error type is obtained between the current time and the last reporting time, and the time difference between the current time and the last reporting time is less than or equal to the preset cooling time, then it is determined that the front-end error data of the target error type will not be obtained and reported within the preset cooling time after the current time.
[0109] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0110] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0111] Figure 6 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 6 The computer device includes: a memory 601 and a processor 602. The memory 601 stores a computer program that can be run on the processor 602. When the processor 602 executes the computer program, the steps in any of the above method embodiments are implemented.
[0112] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0113] Optionally, the present application also provides a program product, such as a computer-readable storage medium, including a program, which, when executed by a processor, is used to execute any of the above-mentioned method embodiments for monitoring front-end errors.
[0114] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0115] The units described as separate components may or may not be physically separated, and the components shown as units 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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0116] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or 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 units.
[0117] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
[0118] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0119] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for monitoring front-end errors, characterized in that: The method comprises: Obtain the current time, the last reporting time corresponding to the target error type, and the current cumulative number of reports corresponding to the target error type; Determine whether to obtain and report the front-end error data of the target error type at the current time according to the current time, the last reporting time, and the current cumulative number of reports; If so, the front-end error data is acquired and reported at the current time, the last reporting time is updated, and the current cumulative number of reports is updated.
2. The method for monitoring front-end errors according to claim 1, characterized in that: The determining whether to obtain and report the front-end error data of the target error type at the current time according to the current time, the last reporting time, and the current cumulative number of reports includes: Determine whether to acquire and report the front-end error data of the target error type at the current time according to the current time, the last reporting time, the current cumulative number of reports, the preset collection and reporting cycle duration, and the preset cumulative number of times.
3. The method for monitoring front-end errors according to claim 2, characterized in that: The determining whether to acquire and report the front-end error data of the target error type at the current time according to the current time, the last reporting time, the current cumulative number of reports, the preset acquisition and reporting cycle duration, and the preset cumulative number of times includes: If the current cumulative number of reports is less than the preset cumulative number, and the time difference between the current time and the last reporting time is greater than or equal to the preset collection and reporting cycle length, it is determined to obtain and report the front-end error data of the target error type at the current time.
4. The method for monitoring front-end errors according to claim 1, characterized in that: The determining whether to obtain and report the front-end error data of the target error type at the current time according to the current time, the last reporting time, and the current cumulative number of reports includes: Determine whether to obtain and report the front-end error data of the target error type at the current time according to the current time, the last reporting time, the current cumulative number of reports, the preset cumulative number of reports, and the preset duration threshold.
5. The method for monitoring front-end errors according to claim 4, characterized in that: The determining whether to obtain and report the front-end error data of the target error type at the current time according to the current time, the last reporting time, the current cumulative number of reports, the preset cumulative number of times, and the preset duration threshold includes: If the current cumulative number of reports is greater than or equal to the preset cumulative number of times, and the time difference between the current time and the last reporting time is greater than or equal to the preset duration threshold, and the front-end error data of the target error type is not obtained between the current time and the last reporting time, then it is determined to obtain and report the front-end error data of the target error type at the current time.
6. The method for monitoring front-end errors according to claim 5, characterized in that: The updating of the current cumulative number of reports includes: The current cumulative number of reports is updated to a value corresponding to one report.
7. The method for monitoring front-end errors according to claim 4, characterized in that: The determining whether to obtain and report the front-end error data of the target error type at the current time according to the current time, the last reporting time, the current cumulative number of reports, the preset cumulative number of times, and the preset duration threshold includes: If the current cumulative number of reports is greater than or equal to the preset cumulative number of times, and the time difference between the current time and the last reporting time is less than the preset duration threshold, and the front-end error data of the target error type is obtained between the current time and the last reporting time, then it is determined to obtain and report the front-end error data of the target error type at the current time.
8. The method for monitoring front-end errors according to claim 7, characterized in that: After determining to obtain and report the front-end error data of the target error type at the current time, the method further includes: If the current cumulative number of reports is greater than or equal to the preset cumulative number of times, and the time difference between the current time and the last reporting time is less than the preset duration threshold, front-end error data of the target error type is obtained between the current time and the last reporting time, and the time difference between the current time and the last reporting time is less than or equal to the preset cooling period, then it is determined that the front-end error data of the target error type will not be obtained and reported within the preset cooling period after the current time.
9. A device for monitoring front-end errors, characterized in that: The device comprises: An acquisition module, used to acquire the current time, the last reporting time corresponding to the target error type, and the current cumulative number of reports corresponding to the target error type; A judgment module, used to determine whether to obtain and report the front-end error data of the target error type at the current time according to the current time, the last reporting time and the current cumulative number of reports; If so, the update reporting module is used to obtain and report the front-end error data at the current time, update the last reporting time, and update the current cumulative number of reports.
10. A computer device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the steps of the method described in any one of claims 1 to 8 are implemented.