Abnormality processing method and device, electronic equipment and computer readable storage medium
By processing anomalian analysis data on the terminal to generate the characteristic code, and decide whether to upload logs based on the confirmation result of the server, the problem of large number of abnormal log data is solved, saving resources and avoiding the upload of repeated logs.
Patent Information
- Application Number
- CN202411381089.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-21
AI Technical Summary
When an abnormality occurs in an electronic device, the amount of abnormal log data uploaded is large, resulting in waste of transmission resources and computing resources.
Through the processing data on the terminal, extract and numerically process it to obtain the feature code, and upload the abnormal log when the server confirm the permission.
Reduced the number of abnormal logs uploading, saved transmission resources and computing resources, while avoiding the risk of uploading a lot of repetitive logs.
Smart Images

Figure CN119336534A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of exception handling technology, and specifically to an exception handling method, device, electronic device, and computer-readable storage medium. Background Art
[0002] When an electronic device has an abnormality, the electronic device needs to upload the abnormality log to the server so that the server can analyze the abnormality log to determine the cause of the abnormality. However, the abnormality log has a large amount of data, and the logs of the same abnormality are basically the same, which consumes a lot of transmission resources when uploading, and consumes a lot of computing resources when the server analyzes the abnormality log. Summary of the invention
[0003] The embodiments of the present application provide an exception handling method, device, electronic device, and computer-readable storage medium, which can reduce the number of uploaded exception logs, thereby saving transmission resources and computing resources.
[0004] In a first aspect, an embodiment of the present application provides an exception handling method, which is applied to a terminal, including:
[0005] In response to an abnormality occurring at the terminal, acquiring abnormality analysis data;
[0006] Processing the abnormal analysis data to obtain a characteristic code of the abnormality;
[0007] Uploading the feature code to a server;
[0008] A reporting result is received from the server, and according to the reporting result, it is determined whether to upload a log corresponding to the exception.
[0009] In one embodiment, the processing of the abnormal analysis data to obtain the abnormal feature code includes:
[0010] Extracting target data representing abnormal attributes from the abnormal analysis data;
[0011] The target data is numerically processed to obtain a characteristic code of the anomaly.
[0012] In one of the embodiments, the reporting result is determined by the server based on whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs.
[0013] In one embodiment, it also includes:
[0014] Get terminal abnormal data;
[0015] Uploading the terminal abnormal data to the server;
[0016] The reporting result is determined by the server according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs corresponding to the category of the terminal abnormal data.
[0017] In one embodiment, determining whether to upload the log corresponding to the exception according to the reporting result includes:
[0018] If the reporting result indicates that uploading logs is allowed, uploading the logs corresponding to the exception to the server;
[0019] If the reporting result indicates that uploading the log is not allowed, the log corresponding to the exception is discarded.
[0020] In a second aspect, an embodiment of the present application provides an exception handling method, which is applied to a server, including:
[0021] Receive the feature code uploaded by the terminal;
[0022] Determine the maximum number of logs allowed to be uploaded and the number of uploaded logs corresponding to the feature code;
[0023] Determine the reporting result according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs;
[0024] The reporting result is returned to the terminal; the reporting result is used to indicate whether the terminal uploads the log corresponding to the exception.
[0025] In one embodiment, it also includes:
[0026] Receiving terminal abnormality data uploaded by the terminal;
[0027] The step of determining the maximum number of logs allowed to be uploaded includes:
[0028] Determine the maximum number of logs allowed to be uploaded corresponding to the category of abnormal data of the terminal;
[0029] The determining of the reporting result according to whether the number of uploaded logs corresponding to the feature code reaches the maximum number of allowed uploaded logs includes:
[0030] The reporting result is determined according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs corresponding to the category of the terminal abnormal data.
[0031] In a third aspect, an embodiment of the present application further provides an exception handling device, which is applied to a terminal and includes:
[0032] An acquisition module, configured to acquire abnormality analysis data in response to an abnormality occurring in the terminal;
[0033] A processing module, used for processing the abnormal analysis data to obtain a characteristic code of the abnormality;
[0034] An uploading module, used for uploading the feature code to a server;
[0035] The determination module is used to receive the reporting result from the server and determine whether to upload the log corresponding to the exception according to the reporting result.
[0036] In one embodiment, the processing module includes:
[0037] An extraction unit, used to extract target data representing abnormal attributes from the abnormal analysis data;
[0038] The digitization unit is used to perform digitization processing on the target data to obtain the abnormal feature code.
[0039] In one of the embodiments, the reporting result is determined by the server based on whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs.
[0040] In one embodiment, it also includes:
[0041] A data acquisition module is used to obtain abnormal terminal data;
[0042] A data uploading module, used for uploading the abnormal data of the terminal to the server;
[0043] The reporting result is determined by the server according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs corresponding to the category of the terminal abnormal data.
[0044] In one embodiment, the determining module includes:
[0045] An uploading unit, configured to upload the log corresponding to the exception to the server if the reporting result indicates that uploading of the log is allowed;
[0046] The discarding unit is used to discard the log corresponding to the exception when the reporting result indicates that uploading the log is not allowed.
[0047] In a fourth aspect, an embodiment of the present application further provides an exception handling device, which is applied to a server and includes:
[0048] A receiving module, used for receiving a feature code uploaded by a terminal;
[0049] A quantity determination module, used to determine the maximum allowed number of uploaded logs and the number of uploaded logs corresponding to the feature code;
[0050] A result determination module, used to determine the reporting result according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs;
[0051] The return module is used to return the reporting result to the terminal; the reporting result is used to indicate whether the terminal uploads the log corresponding to the exception.
[0052] In one embodiment, it also includes:
[0053] A data receiving module, used for receiving terminal abnormality data uploaded by the terminal;
[0054] The quantity determination module comprises:
[0055] A quantity determination unit, used to determine the maximum allowed number of uploaded logs corresponding to the category of the terminal abnormal data;
[0056] The result determination module comprises:
[0057] The result determination unit is used to determine the reporting result according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs corresponding to the category of the terminal abnormal data.
[0058] In a fifth aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps in the above-mentioned exception handling method when executed by the processor.
[0059] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned exception handling method are implemented.
[0060] In a seventh aspect, the embodiments of the present application further provide a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various optional implementations described in the embodiments of the present application.
[0061] In summary, in the embodiment of the present application, the terminal processes the abnormal analysis data to obtain a feature code with a small amount of data, and uploading the feature code to the server can save transmission resources. The report result is received from the server, and the log corresponding to the abnormality is uploaded only when the report result indicates that the log can be uploaded, thereby avoiding uploading a large number of repeated abnormal logs and saving transmission resources. The server analyzes a controllable number of uploaded abnormal logs, saving computing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the 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 work.
[0063] Figure 1 It is a schematic diagram of the steps of an exception handling method provided in an embodiment of the present application;
[0064] Figure 2 It is a schematic diagram of the steps of an exception handling method provided in an embodiment of the present application;
[0065] Figure 3 It is a flowchart of an exception handling method provided in an embodiment of the present application;
[0066] Figure 4 is a schematic diagram of the structure of an exception handling device provided in an embodiment of the present application;
[0067] Figure 5 This is a schematic diagram of the structure of an exception handling device provided in an embodiment of the present application.
[0068] Figure 6 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0069] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0070] In one embodiment, Figure 1As shown, an exception handling method is provided. Although a logical order is shown in the step diagram, in some cases, the steps shown or described may be performed in an order different from that shown in the figure. Specifically, the exception handling method can be applied to a terminal, wherein the terminal may include but is not limited to one or more of a smart phone, a tablet computer, a portable computer, a desktop computer, and a vehicle-mounted computer.
[0071] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.
[0072] according to Figure 1 The exception handling method shown in the figure includes at least steps S110 to S140, which are described in detail as follows:
[0073] In step S110, in response to an abnormality occurring in the terminal, abnormality analysis data is acquired.
[0074] The exception that occurs in the terminal may be a crash exception, an application not responding exception (ANR) or other exceptions. In the case of an exception in the terminal, corresponding exception analysis data will be generated. Among them, the exception analysis data is data used to determine the cause and impact of the exception.
[0075] When a crash exception occurs in the terminal, the program stack saves the exception analysis data about the program running status, including the function call sequence, file name, line number and exception type, etc. These exception analysis data are helpful for debugging the application and determining the cause of the crash. Therefore, when a crash exception occurs in the terminal, the exception analysis data can be obtained from the stack.
[0076] When an ANR occurs on a terminal, the system will automatically generate a trace file, which contains exception analysis data. The exception analysis data in the trace file usually includes the main thread status, other thread status, device information, and ANR cause prompts. Based on the exception analysis data in the trace file, the problem can be quickly located. Therefore, when an ANR occurs on a terminal, the exception analysis data can be obtained from the trace file.
[0077] In step S120, the abnormal analysis data is processed to obtain a feature code of the abnormality.
[0078] The feature code of the exception is a numerical value with a very small amount of data obtained by numerically processing the exception analysis data. The exception analysis data corresponding to the same exception should be consistent, but due to different versions or other reasons, the exception analysis data corresponding to the same exception may also be different, for example, the line number, number, etc. in the exception analysis data may be different. Therefore, the exception analysis data can be preprocessed to make the preprocessed exception analysis data corresponding to the same exception consistent, and then the feature codes obtained by numerically processing the preprocessed exception analysis data are the same. The method of processing the exception analysis data will be described in detail later.
[0079] In step S130, the feature code is uploaded to a server.
[0080] In order to further reduce the amount of uploaded data, the same anomaly can be uploaded with a feature code only once within a short time interval, and the time interval can be set according to actual needs. In this way, transmission resources can be further saved.
[0081] In step S140, a reporting result is received from the server, and according to the reporting result, it is determined whether to upload a log corresponding to the exception.
[0082] After receiving the reported feature code, the server will determine whether to allow the log corresponding to the exception to be uploaded based on the feature code; or determine the number of logs corresponding to the exception that are allowed to be uploaded, and generate a reporting result. The server returns the reporting result to the terminal, and the terminal can determine whether to upload the log corresponding to the exception and the number of logs corresponding to the exception to be uploaded based on the reporting result.
[0083] In one embodiment, the reporting result is determined by the server according to whether the number of uploaded logs corresponding to the feature code reaches the maximum number of uploaded logs allowed. The maximum number of uploaded logs allowed is pre-configured, and the server can determine the number of uploaded logs corresponding to each exception.
[0084] If the number of uploaded logs corresponding to the feature code has reached the maximum number of logs allowed to be uploaded, the server will determine the report result as not allowing the logs corresponding to the feature code to be uploaded. If the number of uploaded logs corresponding to the feature code has not reached the maximum number of logs allowed to be uploaded, the server will determine the report result as allowing the logs corresponding to the feature code to be uploaded, or the server can also determine the number of logs corresponding to the feature code to be uploaded based on the difference between the maximum number of logs allowed to be uploaded and the number of logs corresponding to the feature code that have been uploaded.
[0085] In this way, the server can determine the reporting result based on the feature code only, without having to determine the reporting result based on the entire abnormal analysis data, which can reduce the amount of calculation.
[0086] In one embodiment, determining whether to upload the log corresponding to the exception based on the reporting result includes: uploading the log corresponding to the exception to the server if the reporting result indicates that uploading the log is allowed; and discarding the log corresponding to the exception if the reporting result indicates that uploading the log is not allowed.
[0087] If the reporting result indicates that the log can be uploaded, the terminal will upload the log corresponding to the exception to the server. If the reporting result indicates that a certain number of logs can be uploaded, the terminal will upload the number of logs corresponding to the exception to the server. If the reporting result indicates that the log can not be uploaded, the terminal can directly discard the log corresponding to the exception.
[0088] In this way, the number of uploaded logs can be controlled to avoid uploading a large number of logs to the server; logs that do not need to be uploaded can be directly discarded to save storage space.
[0089] Compared to uploading all the abnormal analysis data with only slight differences to the server, in the embodiment of the present application, the terminal only needs to upload the feature code with a small amount of data, which can reduce the amount of data transmitted and save transmission resources. The server determines the reporting result based on the feature code with a small amount of data, and the required computing resources are relatively small. The terminal determines whether to upload the log corresponding to the abnormality and the number of logs based on the reporting result, which can avoid the huge transmission pressure caused by uploading all logs to the server. The server analyzes the cause of the abnormality based on the log corresponding to the abnormality with a controllable number of uploaded numbers, which also reduces the amount of calculation and saves computing resources.
[0090] Based on the above technical solution, as an embodiment, step S120 at least includes: extracting target data representing abnormal attributes from the abnormal analysis data; and performing numerical processing on the target data to obtain a feature code of the abnormality.
[0091] Due to different versions or other reasons, there are different data in the exception analysis data corresponding to the same exception. In order to ensure that the feature codes corresponding to the same exception are the same, the change data corresponding to the exception in the exception analysis data is removed, and the target data representing the attributes of the exception in the exception analysis data is extracted. The target data corresponding to the same exception is the same. The target data representing the attributes of the exception includes, but is not limited to: the cause of the exception, the name of the exception component, the program name and / or class name of the program where the exception occurred.
[0092] In one example, when a terminal crashes, the data of the most recent number of lines in the stack is the abnormality analysis data that is strongly associated with the crash. Therefore, only the abnormality analysis data of the first fixed number of lines in the stack can be taken, wherein the number of lines can be set according to actual needs or experience. If the total number of lines of data in the stack does not exceed the fixed number of lines, the data of all lines in the stack are taken as the abnormality analysis data.
[0093] The exception analysis data corresponding to the same crash exception may have different line numbers in different stacks. These line numbers are variable data. Therefore, the target data in the exception analysis data can be directly extracted by removing the line numbers in the exception analysis data corresponding to the crash exception.
[0094] In another example, the numerical values of the subject of the trace file of the same ANR may be different in different situations. These numerical values are variable data. Therefore, the numerical values of the subject of the trace file are removed to extract the target data from the abnormal analysis data.
[0095] Numerical processing is to convert non-numeric data into a numerical format, and the data in the numerical format is small in size. The digitization processing of the target data can be hash processing, numerical mapping or embedded representation, etc. Among them, the hash function used in the hash processing can be MD5 (a hash function that converts an input of any length into an output of a fixed length), SHA-1 (Secure Hash Algorithm 1) or SHA-256 (Secure Hash Algorithm 256), etc.
[0096] By adopting the technical solution of the embodiment of the present application, the target data representing the abnormal attributes in the abnormal analysis data is extracted, which ensures that the feature codes corresponding to the same abnormality are the same, so that the server can determine the number of logs corresponding to the same abnormality when determining the reporting result according to the feature code. By numerical processing, the abnormal analysis data is converted into a feature code with a smaller data volume, which helps to reduce the amount of data transmitted and saves transmission resources.
[0097] Based on the above technical solution, as an embodiment, the exception handling method may further include: obtaining terminal exception data; and uploading the terminal exception data to the server.
[0098] The terminal abnormality data is the attribute information of the terminal and / or the attribute information of the terminal system, which may include the process name, process version and / or device information, etc. The terminal can directly obtain the terminal abnormality data. When uploading the feature code, the terminal can also upload the terminal abnormality data to the server.
[0099] The maximum number of logs allowed to be uploaded can be configured globally or differentiated based on the type of abnormal data on the terminal.
[0100] When the maximum allowed number of uploaded logs is configured differently according to the category of terminal abnormal data, the reporting result is determined by the server based on whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs corresponding to the category of terminal abnormal data.
[0101] For example, the maximum number of logs allowed to be uploaded corresponding to process version A can be 100, and the maximum number of logs allowed to be uploaded corresponding to process version B can be 50; when the server receives process version A and the corresponding feature code a, it can determine the reporting result corresponding to feature code a based on whether the number of uploaded logs corresponding to feature code a reaches 100; when the server receives process version B and the corresponding feature code b, it can determine the reporting result corresponding to feature code b based on whether the number of uploaded logs corresponding to feature code b reaches 50. Similarly, when the terminal abnormal data is the process name, the server can count the uploaded logs corresponding to each feature code in different processes; when the terminal abnormal data is device information, the server can count the uploaded logs corresponding to each feature code in different devices.
[0102] By adopting the technical solution of the embodiment of the present application, the maximum allowed number of uploaded logs is configured differently according to the category of terminal abnormal data, which can meet diverse needs and improve flexibility.
[0103] In one embodiment, Figure 2 As shown, an exception handling method is provided. Although a logical order is shown in the step diagram, in some cases, the steps shown or described may be performed in an order different from that shown in the figure. Specifically, the exception handling method can be applied to a server, wherein the server can be a physical server or a cloud server that provides various cloud services. It is worth noting that the present application does not limit the number of terminals or servers. According to the implementation needs, there can be any number of terminals or servers. For example, the server can be a single server or a server cluster composed of multiple servers, etc.
[0104] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.
[0105] according to Figure 2 The exception handling method shown in the figure includes at least steps S210 to S240, which are described in detail as follows:
[0106] In step S210, a feature code uploaded by a terminal is received.
[0107] When an abnormality occurs, the terminal can obtain abnormal analysis data, and the terminal can obtain the abnormal feature code by processing the abnormal analysis data. The server can receive the feature code uploaded by the terminal. The specific method for the terminal to obtain the feature code can be referred to the previous text, which will not be repeated here.
[0108] In step S220, the maximum number of allowed uploaded logs and the number of uploaded logs corresponding to the feature code are determined.
[0109] The maximum number of logs allowed to be uploaded is pre-configured and supports global configuration and differentiated configuration.
[0110] The server may record the feature code corresponding to each log uploaded by the terminal. Therefore, after receiving the feature code uploaded by the terminal, the server may determine the number of uploaded logs corresponding to the feature code.
[0111] In step S230, the reporting result is determined according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs.
[0112] If the number of uploaded logs corresponding to the feature code has reached the maximum number of logs allowed to be uploaded, the server will determine the report result as not allowing the logs corresponding to the feature code to be uploaded. If the number of uploaded logs corresponding to the feature code has not reached the maximum number of logs allowed to be uploaded, the server will determine the report result as allowing the logs corresponding to the feature code to be uploaded, or the server can also determine the number of logs corresponding to the feature code to be uploaded based on the difference between the maximum number of logs allowed to be uploaded and the number of logs corresponding to the feature code that have been uploaded.
[0113] In step S240, the reporting result is returned to the terminal; the reporting result is used to indicate whether the terminal uploads the log corresponding to the exception.
[0114] The server returns the report result to the client. If the report result instructs the terminal to upload the log corresponding to the exception, the terminal will upload the log corresponding to the exception to the server according to the instruction of the report result, and the server can analyze the exception occurred in the terminal according to the log corresponding to the exception.
[0115] By adopting the technical solution of the embodiment of the present application, the server does not need to directly receive all the logs corresponding to the exceptions, but only needs to determine whether to receive the logs corresponding to the exceptions based on the relationship between the feature code with a smaller amount of data and the maximum number of logs allowed to be uploaded, thereby achieving control of the number of logs, and then when performing exception analysis based on the logs, the required amount of calculation is less, saving computing resources. In addition, although the number of logs to be processed is reduced, because the exceptions corresponding to the reduced logs are the same as the exceptions corresponding to the uploaded logs, it will not cause errors in the exception analysis results, so that efficient and accurate exception analysis can be guaranteed.
[0116] On the basis of the above technical solution, as an embodiment, the exception handling method also includes: receiving terminal exception data uploaded by the terminal; the determining the maximum allowed number of uploaded logs includes: determining the maximum allowed number of uploaded logs corresponding to the category of the terminal exception data; the determining the reporting result according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs, includes: determining the reporting result according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs corresponding to the category of the terminal exception data.
[0117] The terminal abnormal data is the attribute information of the terminal and / or the attribute information of the terminal system, which may include the process name, process version and / or device information, etc. The terminal can directly obtain the terminal abnormal data. The server can also receive the abnormal data uploaded by the terminal while receiving the feature code uploaded by the terminal.
[0118] In the case of a differentiated configuration of the maximum number of uploaded logs allowed, the maximum number of uploaded logs allowed determined by the server may be the maximum number of uploaded logs allowed corresponding to the category of abnormal data of the terminal. Further, the reporting result may be determined based on whether the number of uploaded logs corresponding to the feature code reaches the maximum number of uploaded logs allowed corresponding to the category of abnormal data of the terminal.
[0119] By adopting the technical solution of the embodiment of the present application, the maximum allowed number of uploaded logs can be differentially configured according to the category of terminal abnormal data, and then the reporting result can be determined according to the differentiated configured maximum allowed number of uploaded logs, which can meet diverse needs and improve flexibility.
[0120] Figure 3 Schematic diagram of the process of the exception handling method provided in the embodiment of the present application. Figure 3 As shown, when an abnormality occurs in the terminal, the terminal can determine the feature code based on the abnormality analysis data, and the terminal uploads the feature code and the terminal abnormality data to the server. The server is configured with the maximum number of logs allowed to be uploaded. The server receives the feature code and terminal abnormality data uploaded by the terminal, and determines the reporting result based on whether the number of uploaded logs corresponding to the feature code reaches the maximum number of logs allowed to be uploaded. The server returns the reporting result to the terminal, and the terminal determines whether to upload the log based on the reporting result. If log uploading is allowed, the terminal uploads the log to the server, and if log uploading is not allowed, the terminal discards the log.
[0121] By adopting the technical solution of the embodiment of the present application, the terminal processes the abnormal analysis data to obtain a feature code with a small amount of data, and uploading the feature code to the server can save transmission resources. The reporting result is received from the server, and the log corresponding to the abnormality is uploaded only when the reporting result indicates that the log can be uploaded, thereby avoiding uploading a large number of repeated abnormal logs and saving transmission resources. The server analyzes a controllable number of uploaded abnormal logs, saving computing resources.
[0122] In order to better implement the exception handling method of the present application, the present application also provides an exception handling device based on the above exception handling method. The meanings of the terms are the same as those in the above exception handling method, and the specific implementation details can refer to the description in the method embodiment.
[0123] See also Figure 4 , Figure 4 : is a schematic diagram of the structure of an exception handling device provided in an embodiment of the present application, wherein the exception handling device is applied to a terminal, and the exception handling device includes:
[0124] The acquisition module 401 is used to acquire abnormality analysis data in response to an abnormality occurring in the terminal;
[0125] A processing module 402 is used to process the abnormal analysis data to obtain a characteristic code of the abnormality;
[0126] The upload module 403 is used to upload the feature code to the server;
[0127] The determination module 404 is used to receive the reporting result from the server and determine whether to upload the log corresponding to the exception according to the reporting result.
[0128] In one embodiment, the processing module 402 includes:
[0129] An extraction unit, used to extract target data representing abnormal attributes from the abnormal analysis data;
[0130] The digitization unit is used to perform digitization processing on the target data to obtain the abnormal feature code.
[0131] In one of the embodiments, the reporting result is determined by the server based on whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs.
[0132] In one embodiment, it also includes:
[0133] A data acquisition module is used to obtain abnormal terminal data;
[0134] A data uploading module, used for uploading the abnormal data of the terminal to the server;
[0135] The reporting result is determined by the server according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs corresponding to the category of the terminal abnormal data.
[0136] In one embodiment, the determining module 404 includes:
[0137] An uploading unit, configured to upload the log corresponding to the exception to the server if the reporting result indicates that uploading of the log is allowed;
[0138] The discarding unit is used to discard the log corresponding to the exception when the reporting result indicates that uploading the log is not allowed.
[0139] By adopting the technical solution of the embodiment of the present application, the abnormal analysis data is processed to obtain a feature code with a small amount of data, and uploading the feature code to the server can save transmission resources. The report result is received from the server, and the log corresponding to the abnormality is uploaded only when the report result indicates that the log can be uploaded, thereby avoiding uploading a large number of repeated abnormal logs and saving transmission resources. The server analyzes a controllable number of uploaded abnormal logs, saving computing resources.
[0140] See also Figure 5 , Figure 5 : is a schematic diagram of the structure of an exception handling device provided in an embodiment of the present application, wherein the exception handling device is applied to a server, and the exception handling device includes:
[0141] Receiving module 501, used for receiving a feature code uploaded by a terminal;
[0142] The quantity determination module 502 is used to determine the maximum allowed number of uploaded logs and the number of uploaded logs corresponding to the feature code;
[0143] A result determination module 503 is used to determine a reporting result according to whether the number of uploaded logs corresponding to the feature code reaches the maximum number of allowed uploaded logs;
[0144] The return module 504 is used to return the reporting result to the terminal; the reporting result is used to indicate whether the terminal uploads the log corresponding to the exception.
[0145] In one embodiment, it also includes:
[0146] A data receiving module, used for receiving terminal abnormality data uploaded by the terminal;
[0147] The quantity determination module 502 includes:
[0148] A quantity determination unit, used to determine the maximum allowed number of uploaded logs corresponding to the category of the terminal abnormal data;
[0149] The result determination module 503 includes:
[0150] The result determination unit is used to determine the reporting result according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs corresponding to the category of the terminal abnormal data.
[0151] By adopting the technical solution of the embodiment of the present application, the abnormal analysis data is processed to obtain a feature code with a small amount of data, and uploading the feature code to the server can save transmission resources. The report result is received from the server, and the log corresponding to the abnormality is uploaded only when the report result indicates that the log can be uploaded, thereby avoiding uploading a large number of repeated abnormal logs and saving transmission resources. The server analyzes a controllable number of uploaded abnormal logs, saving computing resources.
[0152] For the specific definition of the exception handling device, please refer to the definition of the exception handling method above, which will not be repeated here. Each module in the above exception handling device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0153] In addition, the present application also provides an electronic device, such as Figure 6 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:
[0154] The electronic device may include one or more processors 601 of processing cores and one or more computer-readable storage media memories 602 and other components. Those skilled in the art will appreciate that Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0155] The processor 601 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 602, and calling data stored in the memory 602, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.
[0156] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0157] In one embodiment, the electronic device further includes a power supply 603 for supplying power to various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 603 can also include any components such as one or more DC or AC power supplies, recharging systems, power supply device debugging circuits, power converters or inverters, and power status indicators.
[0158] In one embodiment, the electronic device may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0159] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 601 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 will run the application programs stored in the memory 602, thereby implementing the steps in any one of the exception handling methods provided in the embodiments of the present application.
[0160] Those skilled in the art will understand that Figure 6 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0161] In one embodiment, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in any embodiment of the present application is implemented.
[0162] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in any embodiment of the present application is implemented.
[0163] In some embodiments, a computer program product is also proposed, including a computer program or instructions, which implement the method described in any embodiment of the present application when executed by a processor.
[0164] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0165] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0166] To this end, the present application provides a computer-readable storage medium, on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any one of the exception handling methods provided in the present application.
[0167] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0168] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0169] Since the instructions stored in the computer-readable storage medium can execute the steps in any one of the exception handling methods provided in the present application, the beneficial effects that can be achieved by any one of the exception handling methods provided in the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0170] The above is a detailed introduction to an exception handling method, device, electronic device and computer-readable storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. An exception handling method, characterized in that: Applied to terminals, including: In response to an abnormality occurring at the terminal, acquiring abnormality analysis data; Processing the abnormal analysis data to obtain a characteristic code of the abnormality; Uploading the feature code to a server; A reporting result is received from the server, and according to the reporting result, it is determined whether to upload a log corresponding to the exception.
2. The method according to claim 1, characterized in that The processing of the abnormal analysis data to obtain the abnormal feature code includes: Extracting target data representing abnormal attributes from the abnormal analysis data; The target data is numerically processed to obtain a characteristic code of the anomaly.
3. The method according to claim 1, characterized in that The reporting result is determined by the server based on whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs.
4. The method according to claim 1, characterized in that: Also includes: Get terminal abnormal data; Uploading the terminal abnormal data to the server; The reporting result is determined by the server according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs corresponding to the category of the terminal abnormal data.
5. The method according to any one of claims 1 to 4, characterized in that: The determining, according to the reporting result, whether to upload the log corresponding to the exception includes: If the reporting result indicates that uploading logs is allowed, uploading the logs corresponding to the exception to the server; If the reporting result indicates that uploading the log is not allowed, the log corresponding to the exception is discarded.
6. An exception handling method, characterized in that: Applicable to servers, including: Receive the feature code uploaded by the terminal; Determine the maximum number of logs allowed to be uploaded and the number of uploaded logs corresponding to the feature code; Determine the reporting result according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs; The reporting result is returned to the terminal; the reporting result is used to indicate whether the terminal uploads the log corresponding to the exception.
7. The method according to claim 6, characterized in that Also includes: Receiving terminal abnormality data uploaded by the terminal; The step of determining the maximum number of logs allowed to be uploaded includes: Determine the maximum number of logs allowed to be uploaded corresponding to the category of abnormal data of the terminal; The determining of the reporting result according to whether the number of uploaded logs corresponding to the feature code reaches the maximum number of allowed uploaded logs includes: The reporting result is determined according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs corresponding to the category of the terminal abnormal data.
8. An exception handling device, characterized in that: Applied to terminals, including: An acquisition module, configured to acquire abnormality analysis data in response to an abnormality occurring in the terminal; A processing module, used for processing the abnormal analysis data to obtain a characteristic code of the abnormality; An uploading module, used for uploading the feature code to a server; The determination module is used to receive the reporting result from the server and determine whether to upload the log corresponding to the exception according to the reporting result.
9. An exception handling device, characterized in that: Applicable to servers, including: A receiving module, used for receiving a feature code uploaded by a terminal; A quantity determination module, used to determine the maximum allowed number of uploaded logs and the number of uploaded logs corresponding to the feature code; A result determination module, used to determine the reporting result according to whether the number of uploaded logs corresponding to the feature code reaches the maximum allowed number of uploaded logs; The return module is used to return the reporting result to the terminal; the reporting result is used to indicate whether the terminal uploads the log corresponding to the exception.
10. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the exception handling method according to any one of claims 1 to 7 when executing the computer program.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the exception handling method according to any one of claims 1 to 7 are implemented.