Page exception data processing method and device, equipment and storage medium
By retrieving and storing historical error data from the front-end page when no errors are reported, the problem of historical errors on the front-end page being unreproducible is solved, improving the efficiency of page exception data processing and the completeness of error information.
Patent Information
- Application Number
- CN202210876958.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-25
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2042-07-25
AI Technical Summary
Historical errors on the front-end page cannot be reproduced, resulting in error information not being collected and reported, and low efficiency in processing abnormal page data.
By responding to exception monitoring commands, if the target page does not report an error, the system queries its historical database to obtain the error data and stores it in the target database, ensuring the integrity of the error data.
It improves the efficiency of handling abnormal page data, avoids the loss and irreproducibility of erroneous data, and ensures complete feedback of error information.
Smart Images

Figure CN115270035B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, specifically to a method, apparatus, device, and storage medium for processing page error data. Background Technology
[0002] With the development of the internet, users are accustomed to obtaining information through the internet, and this information is presented to users through front-end systems such as web pages and app interfaces. Currently, most errors in front-end systems are only discovered by users after deployment, who then provide feedback to the front-end developers, allowing the developers to fix these errors.
[0003] However, in the actual operation environment of the Internet, the front-end page only monitors error data within the current lifecycle. When the front-end page encounters an error and is refreshed or re-entered, the error that occurred in the past cannot be reproduced again. This results in the error information not being collected and fed back, leading to low efficiency in handling abnormal page data. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for processing page error data. It provides a historical database corresponding to the target page, and searches the historical database to find historical error data of the target page when the error data cannot be detected or reproduced. This determines the target error data to be reproduced, stores it, and provides feedback, thereby improving the efficiency of page error data processing.
[0005] Firstly, this application provides a method for handling abnormal page data, including:
[0006] In response to an exception monitoring command, monitor the target page associated with the exception monitoring command;
[0007] If the target page does not report any errors within the preset period, then query the historical database corresponding to the target page to obtain the target error data in the historical database;
[0008] The target error data is stored in the target database corresponding to the target page and then output.
[0009] In one possible implementation of this application, the step of responding to an exception monitoring instruction and monitoring the target page associated with the exception monitoring instruction includes:
[0010] If the target page reports an error within a preset period, then obtain the error data and error type of the reported error;
[0011] If the error data conforms to the standard data structure corresponding to the error type, then the error data and the error type are stored in the target database corresponding to the target page and output.
[0012] If the error data does not conform to the standard data structure corresponding to the error type, then the step of querying the historical database corresponding to the target page and obtaining the target error data in the historical database is executed.
[0013] In one possible implementation of this application, the step of querying the historical database corresponding to the target page and obtaining the target error data from the historical database if the error data does not conform to the standard data structure corresponding to the error type includes:
[0014] If the error data does not conform to the standard data structure corresponding to the error type, then query the historical database corresponding to the target page and compare the historical error data in the historical database with the standard data structure corresponding to the error type;
[0015] Extract target error data that conforms to the standard data structure from the historical error data.
[0016] In one possible implementation of this application, the step of obtaining the error data and error type of the reported error if the target page reports an error within a preset period includes:
[0017] If the target page reports an error within a preset period, then obtain the error data of the reported error.
[0018] The error type is determined based on the error capture function corresponding to the error data.
[0019] In one possible implementation of this application, storing the target error data in the target database corresponding to the target page and then outputting it includes:
[0020] Based on the page identifier information of the target page, an index corresponding to the target page is established;
[0021] Obtain the error type corresponding to the target error data, query the preset mapping table, and obtain the preset naming rule corresponding to the error type;
[0022] Key characters are extracted from the erroneous data according to the preset naming rules and set as index constraints for the index;
[0023] The target error data, the index, and the index constraints are associated and stored in the target database corresponding to the target page and then output.
[0024] In one possible implementation of this application, before querying the historical database corresponding to the target page and obtaining the target error data from the historical database if no error data is detected within a preset period of the target page, the method further includes:
[0025] In response to the database cleanup command of the target page, query the associated databases corresponding to the target page, and obtain the storage time and space usage of each associated database;
[0026] Delete the associated databases whose storage time exceeds the preset storage time, and / or the associated databases with empty space usage, to obtain the historical database corresponding to the target page.
[0027] In one possible implementation of this application, the step of responding to an exception monitoring instruction and monitoring the target page associated with the exception monitoring instruction includes:
[0028] In response to an anomaly monitoring command, determine the target database corresponding to the lifecycle of the target page, and obtain the target error data in the target database;
[0029] If no target error data is obtained from the target database, it is determined that the listener did not report an error.
[0030] If the target database contains erroneous data, then an error is detected during monitoring.
[0031] Secondly, this application provides a page error data processing device, the page error data processing device comprising:
[0032] Listening module: Used to respond to exception listening commands and listen to the target page associated with the exception listening command;
[0033] Data processing module: If the target page does not report an error within a preset period, it queries the historical database corresponding to the target page and obtains the target error data in the historical database;
[0034] Storage output module: used to store the target error data into the target database corresponding to the target page and output it.
[0035] Thirdly, this application also provides a device for processing page error data, the device comprising:
[0036] One or more processors;
[0037] Memory; and
[0038] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement any of the page exception data handling methods described above.
[0039] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the steps in any of the page exception data processing methods described above.
[0040] This application provides a method, apparatus, device, and storage medium for processing page error data. By responding to an error monitoring command, the method monitors the target page associated with the command. If the target page does not report an error within a preset period, it queries the historical database corresponding to the target page to obtain the target error data. The target error data is then stored in the target database corresponding to the target page and output. By querying the historical database corresponding to the target page when the target page does not report an error (i.e., when the error data cannot be reproduced), it is understood that by providing the historical database corresponding to the target page—that is, storing error data for each lifecycle of the target page—the integrity of the error data is ensured, preventing data loss and unreproducibility. Furthermore, when error data cannot be monitored (i.e., when the target page does not report an error), the historical database is searched to find historical error data for the target page, thereby determining the target error data to be reproduced, storing it, and providing feedback, thus improving the efficiency of page error data processing. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a schematic diagram of a scenario for the page abnormal data processing method provided in an embodiment of this application;
[0043] Figure 2 This is a schematic flowchart of an embodiment of the page abnormal data processing method provided in this application.
[0044] Figure 3 This is a schematic flowchart of another embodiment of the page abnormal data processing method provided in this application;
[0045] Figure 4This is a schematic flowchart of an embodiment of the page error data processing method provided in this application, which stores and outputs target error data.
[0046] Figure 5 This is a flowchart illustrating another embodiment of the page exception data processing method provided in this application.
[0047] Figure 6 This is a schematic diagram of an embodiment of the page exception data processing device provided in this application.
[0048] Figure 7 This is a schematic diagram of an embodiment of the page error data processing device provided in this application. Detailed Implementation
[0049] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0050] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0051] In this application, the term "exemplary" is used to mean "serving as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0052] This application provides a method, apparatus, device, and computer-readable storage medium for processing page error data, which will be described in detail below.
[0053] The page error data processing method in this embodiment of the invention is applied to a page error data processing device, which is set in a page error data processing equipment. The page error data processing equipment includes one or more processors, a memory, and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the page error data processing method. The page error data processing equipment can be a terminal, such as a mobile phone or a tablet computer, or it can be a server or a service cluster composed of multiple servers.
[0054] like Figure 1 As shown, Figure 1 This is a schematic diagram of a scenario for a page error data processing method according to an embodiment of this application. The page error data processing scenario in this embodiment includes a page error data processing device 100 (the page error data processing device 100 integrates a page error data processing apparatus). The page error data processing device 100 runs a computer-readable storage medium corresponding to page error data processing to execute the steps of page error data processing.
[0055] Understandable, Figure 1 The page error data processing device in the scenario of the page error data processing method shown, or the device included in the page error data processing device, does not constitute a limitation on the embodiments of the present invention. That is, the number or type of device included in the scenario of the page error data processing method, or the number or type of device included in each device, does not affect the overall implementation of the technical solution in the embodiments of the present invention, and can all be considered as equivalent substitutions or derivatives of the technical solutions claimed in the embodiments of the present invention.
[0056] In this embodiment of the invention, the page error data processing device 100 is mainly used for: responding to an error monitoring command and monitoring the target page associated with the error monitoring command; if the target page does not report an error within a preset period, querying the historical database corresponding to the target page, obtaining the target error data in the historical database; storing the target error data in the target database corresponding to the target page and outputting it.
[0057] In this embodiment of the invention, the page anomaly data processing device 100 can be an independent page anomaly data processing device, or a network or cluster of page anomaly data processing devices. For example, the page anomaly data processing device 100 described in this embodiment includes, but is not limited to, computers, network hosts, single network page anomaly data processing devices, sets of multiple network page anomaly data processing devices, or cloud page anomaly data processing devices composed of multiple page anomaly data processing devices. The cloud page anomaly data processing device consists of a large number of computers or network page anomaly data processing devices based on cloud computing.
[0058] Those skilled in the art will understand that Figure 1 The application environment shown is merely one application scenario of the solution in this application and does not constitute a limitation on the application scenario of the solution in this application. Other application environments may include those that are more specific to this application. Figure 1 The number of more or fewer page error data processing devices shown, or the network connectivity of page error data processing devices, for example... Figure 1 Only one page error data processing device is shown in the diagram. It is understood that the scenario of this page error data processing method may also include one or more other page error data processing devices, which are not limited here. The page error data processing device 100 may also include a memory for storing data, such as storing a historical database or a pre-set mapping relationship.
[0059] Furthermore, in the scenario of the page error data processing method of this application, the page error data processing device 100 can be equipped with a display device, or the page error data processing device 100 can be connected to an external display device 200 without a display device. The display device 200 is used to output the results of the page error data processing method executed in the page error data processing device. The page error data processing device 100 can access the background database 300 (the background database can be in the local storage of the page error data processing device, or it can be located in the cloud). The background database 300 stores information related to page error data processing, such as historical databases or pre-set mapping relationships.
[0060] It should be noted that, Figure 1 The schematic diagram of the page abnormal data processing method shown is merely an example. The scenarios of the page abnormal data processing method described in the embodiments of the present invention are for the purpose of more clearly illustrating the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention.
[0061] Based on the scenarios described above for handling abnormal page data, an embodiment of the method for handling abnormal page data is proposed.
[0062] like Figure 2 The diagram shown is a flowchart of an embodiment of the page abnormal data processing method in this application. The page abnormal data processing method includes steps S201-S203:
[0063] S201. Respond to the exception monitoring command and monitor the target page associated with the exception monitoring command.
[0064] The target page, i.e., the webpage or APP interface that needs to be monitored for error data anomalies, can be determined based on the anomaly monitoring instruction. For example, it can be determined based on the target page identification information carried by the anomaly monitoring instruction. Specifically, the target page identification information can be the page route of the target page, page tags used to identify the target page, etc.
[0065] It is understood that the exception monitoring command can be triggered based on user actions. For example, if the user clicks the exception monitoring command trigger button on the target page, an exception monitoring command carrying the identification information of the target page is generated. It is also understood that the exception monitoring command can be automatically generated when the target page is detected. For example, when the target page is refreshed or re-entered, the exception monitoring command is automatically generated.
[0066] In the embodiments of this application, the page error data processing method is applied to the page error data processing device. When the page error data processing device detects a target page, when the page error data processing device receives an error monitoring instruction, it responds to the error monitoring instruction, determines the target page corresponding to the error monitoring instruction, and monitors and obtains the error information of the target page within its current lifecycle.
[0067] S202. If the target page does not report any errors within the preset period, query the historical database corresponding to the target page to obtain the target error data in the historical database.
[0068] The preset period for the target page can be the entire lifecycle of the target page, that is, the time period from when the target page is opened to when it is closed. It is understood that the preset period for the target page can also be a preset period within the lifecycle of the target page, such as the time period from when the target page is opened to when the exception monitoring instruction is responded to. The specific design can be coordinated with the generation scheme of the exception monitoring instruction; however, this application does not impose specific limitations. It is understood that if the target page does not report an error within the preset period, it means that no target error data corresponding to the target page was detected within the preset period.
[0069] The historical database is a database generated within the historical lifecycle of the target page, excluding the current lifecycle (i.e., a time period from when the target page is refreshed or entered in the past to when the target page is closed in the past). It includes error data or reproduced error data that were monitored within the corresponding historical lifecycle.
[0070] The target error data includes error data obtained from a preset error monitoring function corresponding to the target page. It can be understood that the historical database includes historical error data, which is error data monitored within the historical lifecycle corresponding to the historical database.
[0071] In the implementation scheme of this application, when the page error data processing device receives an error monitoring instruction, it responds to the error monitoring instruction, determines the target page corresponding to the error monitoring instruction, and monitors the error information of the target page. If the page error data processing device does not detect error data within the life cycle of the target page, it queries the historical database corresponding to the target page according to the page identification information of the target page and obtains the target error data from the historical database.
[0072] S203. Store the target error data in the target database corresponding to the target page and output it.
[0073] The target database corresponding to the target page, that is, the database corresponding to the current lifecycle of the target page, can be understood as follows: each lifecycle corresponds to one database, and one database stores the target error data within one lifecycle. Specifically, the target database corresponding to the target page is used to store the target error data within the current lifecycle of the target page. When the target page is detected (e.g., refreshed or opened), the target database corresponding to the target page is created. When the target page is closed, that is, the lifecycle ends, and the target database is set as a history database.
[0074] In this embodiment, when the page error data processing device obtains the target error data from the historical database, it stores the target error data in the target database corresponding to the target page, and outputs the target database to the page for display or to the front-end developers. In this embodiment, the target database is essentially a table, which includes the target error data and the indexes and index constraints associated with the target error data.
[0075] It is understandable that if the target page does not report any errors within the preset period, and the target page is queried in the historical database, no target error data is obtained from the historical database, it means that the target page has no historical errors, and the corresponding exception monitoring instruction will provide feedback with no error information.
[0076] Furthermore, based on the above implementation plan, see [link to relevant documentation]. Figure 3 This application also provides an implementation scheme for a page abnormal data processing method, including steps S301-S304:
[0077] S301. Respond to the exception monitoring command and monitor the target page associated with the exception monitoring command;
[0078] S302. If the target page reports an error within a preset period, then obtain the error data and error type of the reported error.
[0079] The error type refers to the error type of the error data, such as javaScriptError (JS syntax error), Unhandledrejection (Promise error not handled), static resource loading error, console.error (custom exception error), etc.
[0080] The standard data structure refers to the error data composition corresponding to the error type. For example, the standard data structure for JS syntax errors includes: the file name of the error, line number, column number, error message, error stack, and error type; the standard data structure for unhandled Promise errors includes: error message, error reason, and error type; the standard data structure for static resource loading errors includes: resource request address, node type, and error type; and the standard data structure for custom exception errors includes: error stack, error message, error content, and error title.
[0081] The error data refers to the error data monitored within a preset period of the target page. In the basic implementation scheme, the error data monitored during the period from the detection of the target page to the response to the abnormal monitoring instruction is described. Different error types correspond to different error data. For example, error data corresponding to JS syntax errors (error types) includes: file name, line number, column number, error message, error stack, error type, etc. It can be understood that the error data can be monitored and obtained through a preset error monitoring function.
[0082] In the embodiments of this application, the error data is monitored and captured according to the error capture function. It is understood that in some other embodiments of this application, the error data is monitored according to the error monitoring function and the error data is captured according to the error capture function. This application does not make specific limitations.
[0083] In the embodiments of this application, the error capture functions include: a global JavaScript syntax error capture handling function (used to capture error data corresponding to syntax errors), a global Promise exception capture handling function (used to capture error data of unhandled errors), and a global static resource loading error capture handling function (used to capture error data corresponding to static resource loading errors). In some embodiments of this application, errors handled internally by trycatch are generally not captured. It can be agreed that the developer outputs errors through console.error and then delegates the console.error method to capture this type of error (used to capture error data corresponding to custom exception errors). It is understood that the target error data error type can be determined according to different error capture functions.
[0084] Specifically, determining the standard data structure corresponding to the erroneous data based on its error type includes:
[0085] (1) If the target page reports an error within a preset period, the error data of the reported error is obtained;
[0086] (2) Determine the error type based on the error capture function corresponding to the error data.
[0087] That is, if error data is detected on the target page within a preset period, the error data corresponding to the target page is captured based on a preset error capture function; when the error data of the target page is captured, the error type corresponding to the error data is determined according to the function type of the preset error capture function that captures the error data, and the standard data structure corresponding to the error data is determined according to the error type of the error data.
[0088] S303. If the error data conforms to the standard data structure corresponding to the error type, then the error data and the error type are stored in the target database corresponding to the target page and output.
[0089] It is understandable that error data captured by error capture functions is generally output based on a standard data structure. A small amount of data may be useless or incomplete. After obtaining error data based on error capture functions, the page exception data processing device removes useless data from the error data according to the standard data structure. The resulting error data includes various sub-data corresponding to the standard data structure. For example, if the standard data structure is the standard data structure for JS syntax errors, then the error data (error data corresponding to JS syntax errors) includes: the file name, line number, column number, error message, error stack, and error type of the error. That is, the file name, line number, column number, error message, error stack, and error type of the error are the sub-data included in the error data. In other words, it is understandable that the error data includes multiple sub-data for different error types.
[0090] It is understood that the error type can be determined based on the data type of the error data or the data monitoring source of the error data.
[0091] Specifically, if all sub-data corresponding to the standard data structure are extracted from the error data, then the error data conforms to the standard data structure corresponding to the error type; if not all sub-data corresponding to the standard data structure are extracted from the error data, then the error data does not conform to the standard data structure corresponding to the error type.
[0092] S304. If the error data does not conform to the standard data structure corresponding to the error type, then the step of querying the historical database corresponding to the target page and obtaining the target error data in the historical database is executed.
[0093] Specifically, if the error data does not conform to the standard data structure corresponding to the error type, that is, if the page error data processing device does not extract all the sub-data corresponding to the standard data structure from the error data, the captured error data is incomplete. In this case, the historical database corresponding to the target page can be queried to obtain the target error data in the historical database.
[0094] Specifically, if the error data does not conform to the standard data structure corresponding to the error type, the step of querying the historical database corresponding to the target page and obtaining the target error data in the historical database includes:
[0095] (1) If the error data does not conform to the standard data structure corresponding to the error type, then query the historical database corresponding to the target page and compare the historical error data in the historical database with the standard data structure corresponding to the error type;
[0096] (2) Extract target error data that conforms to the standard data structure from the historical error data.
[0097] (3) Store the target error data in the target database corresponding to the target page and output it.
[0098] Specifically, if the error data does not conform to the standard data structure corresponding to the error type, the historical database corresponding to the target page is queried according to the error type; if the historical database corresponding to the target page contains historical error data corresponding to the error type, the historical error data is compared with the error data; the historical error data including the error data is extracted as the target error data. It can be understood that incomplete parts of the error data can also be extracted from the historical database and concatenated with the incomplete error data to obtain complete target error data. The target error data is stored in the target database corresponding to the target page and output.
[0099] Specifically, if the page error data processing device extracts the target error sub-data corresponding to the standard data structure, it indicates that the current page error has been successfully reproduced, and there is no need to obtain historical error data from the historical database.
[0100] Furthermore, based on any of the above implementation schemes, see [link to relevant documentation]. Figure 4 This application provides an implementation scheme for storing and outputting target error data, including steps S401-S404:
[0101] S401. Based on the page identifier information of the target page, establish an index corresponding to the target page;
[0102] S402. Obtain the error type corresponding to the target error data, query the preset mapping table, and obtain the preset naming rule corresponding to the error type;
[0103] S403. Extract key characters from the error data according to the preset naming rules and set them as index constraints for the index;
[0104] S404. The target error data, the index, and the index constraints are associated and stored in the target database corresponding to the target page and then output.
[0105] In this implementation scheme, the page identification information of the target page is the page route of the target page, and a unique index is created based on the page route. It is understood that the unique index is a unique index of the page route. Then, a preset mapping table is queried based on the error type of the error data. The preset mapping table is a preset mapping table of error types and naming rules. It is understood that the preset mapping table can be preset according to specific page usage scenarios and possible error types. The preset naming rules corresponding to the error types are determined, and key characters are extracted from the error data according to the preset naming rules. That is, key sub-data is extracted from the error data according to the preset naming rules for naming, and a unique constraint corresponding to the unique index is created.
[0106] Specifically, the preset naming rules are used to create unique constraints corresponding to the unique index, such as: (1) for javaScriptError (JS syntax error), the rule is: filename_line number_column number.
[0107] (2) Unhandled rejection uses the default naming convention: error message;
[0108] (3) consoleError(console.error) uses the default naming convention: error message_stack.
[0109] (4) Fallback default naming rules: Current timestamp: new Date().getTime().
[0110] It is understood that in the implementation scheme of this application, when there is no corresponding preset naming rule for the error type, a fallback preset naming rule is used. For example, when the error type is not a JS syntax error, an unhandled Promise error, or a custom exception error, a fallback preset naming rule is used.
[0111] Furthermore, based on any of the above implementation schemes, see [link to relevant documentation]. Figure 5 This application also provides an implementation scheme for a page abnormal data processing method, including steps S501-S505:
[0112] S501. In response to the database cleanup command of the target page, query the associated databases corresponding to the target page, and obtain the storage time and space usage of each associated database.
[0113] S502. Delete the associated databases whose storage time exceeds the preset storage time, and / or the associated databases whose space occupancy is empty, to obtain the historical database corresponding to the target page;
[0114] S503. Respond to the exception monitoring command and monitor the target page associated with the exception monitoring command;
[0115] S504. If the target page does not report an error within the preset period, query the historical database corresponding to the target page to obtain the target error data in the historical database.
[0116] S505. Store the target error data in the target database corresponding to the target page and output it.
[0117] Specifically, in response to the database cleanup command of the target page, the associated databases corresponding to the target page are searched; if the associated databases include at least one, the associated databases that do not contain historical error information are deleted, and the associated databases that contain historical error information and whose storage time exceeds a preset storage time are further deleted; if at least one associated database is still included after the deletion, the historical database corresponding to the target page is determined based on the associated databases.
[0118] Specifically, determining the historical database corresponding to the target page based on the associated database includes:
[0119] (1) If one associated database remains after deletion, set the associated database as the historical database corresponding to the target page;
[0120] (2) If two or more related databases remain after deletion, the related database with the shortest retention time shall be set as the historical database corresponding to the target page, and the related databases other than the historical database shall be deleted.
[0121] It can be understood that, in the implementation scheme of this application, a corresponding target database is created for each life cycle of the target page, and an associated database is obtained when a life cycle of the target page ends. That is, the target page may correspond to multiple associated databases. Therefore, in order to avoid the data volume being too large, causing waste of storage resources and an increase in the amount of query data for target error data, it is necessary to clean up the associated databases.
[0122] Specifically, in one embodiment of this application, determining the associated database includes:
[0123] (1) When a target page is detected, a target database corresponding to the target page is created, and a usage identifier for the target database is generated;
[0124] (2) When the target page is detected to be closed, the usage identifier of the target data is removed and the target database is set as an associated database.
[0125] Specifically, when searching the IndexedDB database containing all erroneous data under the target page, databases currently in use cannot be deleted. This is to prevent a target database in use from being mistakenly identified as a related database. For example, if page A is opened, a database for saving page A will be created. If page B is then opened, page B will also execute the cache clearing logic (i.e., responding to the database cleanup command of the target page), which may mistakenly delete the database of page A. It is understood that the page routes of page A and page B may be the same. Therefore, a flag needs to be set at the beginning of page A: localstorage.setItem(name,true), and at the end (when closing or refreshing the page): localstorage.removeItem(name). Then, when deleting from page B, it is checked whether localstorage.getItem(name) exists. If it exists, it means that the page is still open and cannot be deleted; if it does not exist, it means that the page has been closed, the target database created for page A is set as a related database, and the related database is cleaned up and deleted in the next cleanup cycle of the target page.
[0126] It is understood that when no error information appears within a lifecycle of the target page, the associated database will not store historical error information, which refers to the target error data within the historical lifecycle.
[0127] Specifically, after receiving the database cleanup instruction from the target page, the page abnormal data processing device responds to the database cleanup instruction. It is understood that the database cleanup instruction can be automatically triggered and generated after the target page is detected (the target page is entered or updated), that is, it is understood that the database cleanup instruction can be generated simultaneously with the abnormal monitoring instruction; on the other hand, the database cleanup instruction can also be collected by the database cleanup instruction collection module corresponding to the target page. This application does not make specific limitations on the specifics.
[0128] Specifically, in this embodiment, when a target page is detected, the page anomaly data processing device generates a database cleanup instruction for the target page, determines the associated database corresponding to the target page based on the page route of the target page corresponding to the database cleanup instruction, and searches the associated database corresponding to the target page. If the target page has no associated database, it means that no error information has occurred in the history of the target page. If the target page includes an associated database, the associated database is the historical database corresponding to the target page. When receiving an anomaly monitoring instruction for the target page, the device responds to the anomaly monitoring instruction and monitors the target page corresponding to the anomaly monitoring instruction. If no error data is detected on the target page within a preset period, the device queries the historical database corresponding to the target page to obtain the target error data in the historical database.
[0129] It is understandable that the associated database with the shortest storage time, that is, the associated database whose generation time is closest to the current time, is used for reproduction, that is, to restore the previous erroneous data that is closest to the current time. By setting the associated database with the shortest storage time as the historical database corresponding to the target page, the accuracy of the results of subsequent reproduction searches of the historical database is guaranteed.
[0130] This application provides a method for handling page error data. By responding to an error monitoring command, the method monitors the target page associated with the command. If the target page does not report an error within a preset period, the method queries the historical database corresponding to the target page to obtain the target error data. The target error data is then stored in the target database corresponding to the target page and output. By querying the historical database corresponding to the target page when the target page does not report an error (i.e., when the error data cannot be reproduced), it can be understood that by providing the historical database corresponding to the target page—that is, storing error data for each lifecycle of the target page—the integrity of the error data is ensured, preventing data loss and unreproducibility. Furthermore, when error data cannot be monitored (i.e., when the target page does not report an error), the method searches the historical database to find historical error data for the target page, thereby determining the target error data to be reproduced, storing it, and providing feedback, thus improving the efficiency of page error data handling.
[0131] To better implement the page error data processing method in the embodiments of this application, based on the page error data processing method, the embodiments of this application also provide a page error data processing device, such as... Figure 6 As shown, the page error data processing device includes modules 601-603:
[0132] Listening module 601: Used to respond to an exception listening command and listen to the target page associated with the exception listening command;
[0133] Data processing module 602: If the target page does not report an error within a preset period, it queries the historical database corresponding to the target page and obtains the target error data in the historical database;
[0134] Storage output module 603: Used to store the target error data into the target database corresponding to the target page and output it.
[0135] In some embodiments of this application, after the monitoring module 601 monitors the target page associated with the abnormal monitoring instruction, the data processing module 602 further includes:
[0136] If the target page reports an error within a preset period, then obtain the error data and error type of the reported error;
[0137] If the error data conforms to the standard data structure corresponding to the error type, then the error data and the error type are stored in the target database corresponding to the target page and output.
[0138] If the error data does not conform to the standard data structure corresponding to the error type, then the step of querying the historical database corresponding to the target page and obtaining the target error data in the historical database is executed.
[0139] In some embodiments of this application, the data processing module 602 is configured to: if the error data does not conform to the standard data structure corresponding to the error type, execute the step of querying the historical database corresponding to the target page and obtaining the target error data in the historical database, specifically including:
[0140] If the error data does not conform to the standard data structure corresponding to the error type, then query the historical database corresponding to the target page and compare the historical error data in the historical database with the standard data structure corresponding to the error type;
[0141] Extract target error data that conforms to the standard data structure from the historical error data.
[0142] In some embodiments of this application, the data processing module 602 is used to: if the target page reports an error within a preset period, obtain the error data and error type of the reported error, specifically including:
[0143] If the target page reports an error within a preset period, then obtain the error data of the reported error.
[0144] The error type is determined based on the error capture function corresponding to the error data.
[0145] In some embodiments of this application, the storage output module 603 is used to store the target error data into the target database corresponding to the target page and output it, specifically including:
[0146] Based on the page identifier information of the target page, an index corresponding to the target page is established;
[0147] Obtain the error type corresponding to the target error data, query the preset mapping table, and obtain the preset naming rule corresponding to the error type;
[0148] Key characters are extracted from the erroneous data according to the preset naming rules and set as index constraints for the index;
[0149] The target error data, the index, and the index constraints are associated and stored in the target database corresponding to the target page and then output.
[0150] In some embodiments of this application, the page error data processing apparatus further includes a database processing module 604: used for:
[0151] In response to the database cleanup command of the target page, query the associated databases corresponding to the target page, and obtain the storage time and space usage of each associated database;
[0152] Delete the associated databases whose storage time exceeds the preset storage time, and / or the associated databases with empty space usage, to obtain the historical database corresponding to the target page.
[0153] In some embodiments of this application, before the database processing module 604 responds to a database cleanup command from a target page, queries the associated databases corresponding to the target page, and obtains the storage time and space usage of each associated database, it further includes functions for:
[0154] When a target page is detected, a target database corresponding to the target page is created, and a usage identifier for the target database is generated;
[0155] When the target page is detected to be closed, the usage identifier of the target data is removed, and the target database is set as a history database.
[0156] In some embodiments of this application, the listening module 601 is configured to respond to an abnormal listening instruction and listen to the target page associated with the abnormal listening instruction, specifically including:
[0157] In response to an anomaly monitoring command, determine the target database corresponding to the lifecycle of the target page, and obtain the target error data in the target database;
[0158] If no target error data is obtained from the target database, it is determined that the listener did not report an error.
[0159] If the target database contains erroneous data, then an error is detected during monitoring.
[0160] This application provides a page anomaly data processing device that, in response to an anomaly monitoring command, monitors the target page associated with the command. If the target page does not report an error within a preset period, it queries the historical database corresponding to the target page to obtain the target error data. The device then stores the target error data in the target database corresponding to the target page and outputs it. By querying the historical database corresponding to the target page when the target page does not report an error (i.e., when the error data cannot be reproduced), it is understood that by providing the historical database corresponding to the target page—that is, storing error data for each lifecycle of the target page—the integrity of the error data is ensured, preventing data loss and unreproducibility. Furthermore, when error data cannot be monitored (i.e., when the target page does not report an error), the historical database is searched to find historical error data for the target page, thereby determining the target error data to be reproduced, storing it, and providing feedback, thus improving the efficiency of page anomaly data processing.
[0161] This invention also provides a page error data processing device, such as... Figure 7 As shown, Figure 7 This is a schematic diagram of an embodiment of the page error data processing device provided in this application.
[0162] The page error data processing device integrates any of the page error data processing apparatuses provided in the embodiments of the present invention, and the page error data processing device includes:
[0163] One or more processors;
[0164] Memory; and
[0165] One or more applications, wherein the one or more applications are stored in the memory and configured by the processor to perform the steps of the page exception data processing method described in any of the embodiments of the above-described page exception data processing method.
[0166] Specifically, the page error data processing device may include components such as a processor 701 with one or more processing cores, a memory 702 with one or more computer-readable storage media, a power supply 703, and an input unit 704. Those skilled in the art will understand that... Figure 7 The page error data processing device structure shown does not constitute a limitation on the page error data processing device. It may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0167] The processor 701 is the control center of the page error data processing device. It connects to various parts of the device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 702, and by calling data stored in the memory 702, it performs various functions and processes data, thereby providing overall monitoring of the page error data processing device. Optionally, the processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 701.
[0168] The memory 702 can be used to store software programs and modules. The processor 701 executes various functional applications and data processing by running the software programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the page fault data processing device, etc. In addition, the memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.
[0169] The page error data processing device also includes a power supply 703 that supplies power to the various components. Preferably, the power supply 703 can be logically connected to the processor 701 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 703 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0170] The page error data processing device may also include an input unit 704, which can be used to receive input numeric or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0171] Although not shown, the page error data processing device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 701 in the page error data processing device loads the executable files corresponding to the processes of one or more applications into the memory 702 according to the following instructions, and the processor 701 runs the applications stored in the memory 702 to realize various functions, as follows:
[0172] In response to an exception monitoring command, monitor the target page associated with the exception monitoring command;
[0173] If the target page does not report any errors within the preset period, then query the historical database corresponding to the target page to obtain the target error data in the historical database;
[0174] The target error data is stored in the target database corresponding to the target page and then output.
[0175] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0176] Therefore, embodiments of the present invention provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a disk, or an optical disk, etc. A computer program is stored thereon, which is loaded by a processor to execute the steps in any of the page exception data processing methods provided in the embodiments of the present invention. For example, the computer program loaded by the processor can execute the following steps:
[0177] In response to an exception monitoring command, monitor the target page associated with the exception monitoring command;
[0178] If the target page does not report any errors within the preset period, then query the historical database corresponding to the target page to obtain the target error data in the historical database;
[0179] The target error data is stored in the target database corresponding to the target page and then output.
[0180] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.
[0181] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.
[0182] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0183] The foregoing has provided a detailed description of a page anomaly data processing method, apparatus, device, and storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method of processing page exception data, characterized by, The method comprises the following steps: in response to an abnormal monitoring instruction, monitoring a target page associated with the abnormal monitoring instruction; if the target page does not report an error within a preset period, querying a historical database corresponding to the target page to obtain target error data in the historical database; storing the target error data into a target database corresponding to the target page and outputting, comprising: establishing an index corresponding to the target page according to page identification information of the target page; obtaining an error type corresponding to the target error data, querying a preset mapping table to obtain a preset naming rule corresponding to the error type; extracting key characters from the target error data according to the preset naming rule and setting the key characters as index constraints of the index; storing and outputting the target error data, the index and the index constraints into the target database corresponding to the target page.
2. The page exception data processing method of claim 1, wherein, After the step of monitoring the target page associated with the abnormal monitoring instruction in response to the abnormal monitoring instruction, the method further comprises the following steps: if the target page reports an error within a preset period, obtaining error data and an error type of the error; if the error data conforms to a standard data structure corresponding to the error type, storing and outputting the error data and the error type into a target database corresponding to the target page; if the error data does not conform to the standard data structure corresponding to the error type, performing the step of querying the historical database corresponding to the target page to obtain target error data in the historical database.
3. The page exception data processing method of claim 2, wherein, The step of querying the historical database corresponding to the target page to obtain target error data in the historical database if the error data does not conform to the standard data structure corresponding to the error type comprises the following steps: if the error data does not conform to the standard data structure corresponding to the error type, querying the historical database corresponding to the target page and comparing historical error data in the historical database with the standard data structure corresponding to the error type; extracting target error data conforming to the standard data structure from the historical error data.
4. The page exception data processing method of claim 2, wherein, The step of obtaining error data and an error type of the error if the target page reports an error within a preset period comprises the following steps: if the target page reports an error within a preset period, obtaining error data of the error; determining the error type according to an error capture function corresponding to the error data.
5. The method of claim 1, wherein, Before the step of querying the historical database corresponding to the target page to obtain target error data in the historical database if the target page does not monitor error data within a preset period, the method further comprises the following steps: in response to a database cleaning instruction of a target page, querying associated databases corresponding to the target page to obtain storage time and space occupation of each associated database; deleting an associated database with storage time exceeding a preset storage time and / or an associated database with empty space occupation to obtain a historical database corresponding to the target page.
6. The method of claim 1, wherein, The step of monitoring a target page associated with the abnormal monitoring instruction in response to the abnormal monitoring instruction comprises the following steps: In response to the abnormal monitoring instruction, a target database corresponding to the target page in a life cycle of the target page is determined, and target error data in the target database is acquired; If no target error data is acquired in the target database, it is determined that no error is monitored; If target error data is acquired in the target database, it is determined that an error is monitored.
7. A page exception data processing apparatus characterized by comprising: The page abnormal data processing apparatus comprises: a monitoring module configured to monitor a target page associated with the abnormal monitoring instruction in response to the abnormal monitoring instruction; a data processing module configured to, if no error is reported in the target page in a preset period, query a historical database corresponding to the target page, and acquire target error data in the historical database; a storage and output module configured to store and output the target error data to a target database corresponding to the target page, comprising: establishing an index corresponding to the target page according to page identification information of the target page; acquiring an error type corresponding to the target error data, querying a preset mapping table, and acquiring a preset naming rule corresponding to the error type; extracting a key character from the target error data according to the preset naming rule, and setting the key character as an index constraint of the index; storing and outputting the target error data, the index, and the index constraint to the target database corresponding to the target page in association.
8. A page exception data processing apparatus characterized by comprising: The page abnormal data processing apparatus comprises: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the page abnormal data processing method of any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the page abnormal data processing method of any one of claims 1 to 6.
Citation Information
Patent Citations
Method, device and system for investigating front-end page problem
CN108334429A
Exception handling method and device, computer device and storage medium
CN109325865A