Fault diagnosis method, device and electronic equipment

By working together between electronic devices and servers, dynamically uploading the logs required for fault diagnosis, the problem of increased power consumption of electronic devices during fault diagnosis is solved, and efficient and accurate fault diagnosis is achieved.

CN119782024AInactive Publication Date: 2025-04-08GUANG DONG MING CHUANG SOFTWARE TECH CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411934300.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

During the fault diagnosis process of electronic devices, electronic devices need to upload a large number of logs, resulting in increased power consumption.

Method used

By working together between the electronic device and the server, the first fault category of the fault is determined and the corresponding first log is uploaded. If the server determines that the second log is missing, the electronic device uploads the missing second log again for troubleshooting of the server.

Benefits of technology

It reduces the power consumption caused by log upload during the fault diagnosis process of electronic devices, and improves the efficiency and accuracy of fault diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782024A_ABST
    Figure CN119782024A_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a fault diagnosis method, device and electronic device, in which the method can determine the first fault category of the fault in response to the occurrence of a fault in the electronic device, obtain the first log corresponding to the first fault category, and send the first log to the server; if it is determined that the second log required for fault diagnosis is missing, the electronic device will send the second log to the server for the server to perform fault diagnosis. Thus, when the electronic device determines that a fault has occurred, the first log corresponding to the first fault category can be uploaded first, and then, if the server determines that the second log is still missing, the electronic device can upload the missing second log to the server, so that when the electronic device initially uploads the log, it does not need to upload all the logs in the electronic device, but can dynamically supplement the missing logs according to the needs of the server, which is conducive to reducing the power consumption of the electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a fault diagnosis method, device and electronic equipment. Background Art

[0002] During the operation of an electronic device, if the electronic device fails, the cause of the failure can be analyzed based on the log in the electronic device. However, the related fault diagnosis process will cause high power consumption to the electronic device. Summary of the invention

[0003] In view of the above problems, the present application proposes a fault diagnosis method, device and electronic device to improve the above problems.

[0004] In a first aspect, the present application provides a fault diagnosis method, which is applied to an electronic device, and the method includes: in response to a fault occurring in the electronic device, determining a first fault category of the fault; obtaining a first log corresponding to the first fault category, and sending the first log to a server; if the server determines that a second log required for fault diagnosis is missing, sending the second log to the server for the server to perform fault diagnosis.

[0005] In a second aspect, the present application provides a fault diagnosis method, which is applied to a server, and the method includes: receiving a first log sent by an electronic device, the first log being sent when the electronic device detects a fault, wherein the first log corresponds to a first fault category of the fault, and the first fault category is determined by the electronic device; if it is determined that the second log required for fault diagnosis is missing, sending a log request to the electronic device; receiving the second log sent by the electronic device for use by the server to perform fault diagnosis.

[0006] In a third aspect, the present application provides a fault diagnosis device that runs on an electronic device, the device comprising: a fault response unit, for determining a first fault category of the fault in response to a fault of the electronic device; a log collection unit, for obtaining a first log corresponding to the first fault category and sending the first log to a server; a log sending unit, for sending the second log required for fault diagnosis to the server if the server determines that the second log required for fault diagnosis is missing, so that the server can perform fault diagnosis

[0007] In a fourth aspect, the present application provides a fault diagnosis device, which runs on a server, and the device includes: a log acquisition unit, which is used to receive a first log sent by an electronic device, and the first log is sent when the electronic device detects a fault, wherein the first log corresponds to a first fault category of the fault, and the first fault category is determined by the electronic device; a log request unit, which is used to send a log request to the electronic device if it is determined that a second log required for fault diagnosis is missing; a fault diagnosis unit, which is used to receive the second log sent by the electronic device for the server to perform fault diagnosis.

[0008] In a fifth aspect, the present application provides an electronic device comprising a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the above method.

[0009] In a sixth aspect, the present application provides a computer-readable storage medium, in which a program code is stored, wherein the above method is executed when the program code is started and executed by a controller.

[0010] In a seventh aspect, the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; the computer program product is used to implement the above method.

[0011] The present application provides a fault diagnosis method, device and electronic device, in which the first fault category of the fault can be determined in response to a fault in the electronic device; then the first log corresponding to the first fault category is obtained and the first log is sent to the server; if the server determines that the second log required for fault diagnosis is missing, the electronic device will send the second log to the server for the server to perform fault diagnosis. Thus, through the above method, when the electronic device determines that a fault has occurred, it only needs to upload the first log corresponding to the first fault category first, and then, when the server determines that the second log is still missing, the electronic device can upload the missing second log to the server, so that when the electronic device initially uploads the log, it does not need to upload all the logs in the electronic device, but can dynamically supplement the missing logs according to the needs of the server, which is conducive to reducing the power consumption of the electronic device due to log uploading during the fault diagnosis process. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions in the embodiments of 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 application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0013] Figure 1 A schematic diagram showing an operating environment of the fault diagnosis method proposed in an embodiment of the present application;

[0014] Figure 2 A flowchart of a fault diagnosis method proposed in an embodiment of the present application is shown;

[0015] Figure 3 A flowchart of a fault diagnosis method proposed in another embodiment of the present application is shown;

[0016] Figure 4 A flowchart of a fault diagnosis method proposed in another embodiment of the present application is shown;

[0017] Figure 5 A flowchart of a fault diagnosis method proposed in another embodiment of the present application is shown;

[0018] Figure 6 A structural block diagram of a fault diagnosis device proposed in an embodiment of the present application is shown;

[0019] Figure 7 A structural block diagram of a fault diagnosis device proposed in an embodiment of the present application is shown;

[0020] Figure 8 A structural block diagram of an electronic device for executing a fault diagnosis method according to an embodiment of the present application is shown;

[0021] Fig. 9 It is a storage unit of an embodiment of the present application for storing or carrying a program code for implementing a fault diagnosis method according to an embodiment of the present application. DETAILED DESCRIPTION

[0022] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0023] In the actual operation of electronic devices, once an electronic device fails, the cause of the failure can usually be analyzed and explored in depth based on the logs recorded in the electronic device. However, the inventors found in their research that in the relevant fault diagnosis process, a more prominent problem is that this process will cause higher power consumption for the electronic device.

[0024] Therefore, the inventor proposes a fault diagnosis method, device and electronic device in the present application that can improve the above-mentioned problems. In the method, in response to a fault in the electronic device, a first fault category of the fault can be determined; then a first log corresponding to the first fault category is obtained, and the first log is sent to a server; if the server determines that the second log required for fault diagnosis is missing, the electronic device will send the second log to the server for the server to perform fault diagnosis. Thus, through the above-mentioned method, when the electronic device determines that a fault has occurred, it only needs to upload the first log corresponding to the first fault category first, and then, when the server determines that the second log is still missing, the electronic device can upload the missing second log to the server, so that when the electronic device initially uploads the log, it does not need to upload all the logs in the electronic device, but can dynamically supplement the missing logs according to the needs of the server, which is conducive to reducing the power consumption of the electronic device due to log uploading during the fault diagnosis process.

[0025] The following first introduces the application scenarios involved in the embodiments of the present application.

[0026] The fault diagnosis method provided in the embodiment of the present application can be executed by the electronic device and the server in collaboration. In the process of being executed by the electronic device and the server in collaboration, some steps in the fault diagnosis method provided in the embodiment of the present application are executed by the electronic device, while other steps are executed by the server. For example, Figure 1 As shown, the electronic device 100 can perform the fault diagnosis method including: in response to a fault of the electronic device, determining the first fault category of the fault; obtaining a first log corresponding to the first fault category, and sending the first log to the server. Afterwards, the server 200 can determine whether the logs required for fault diagnosis have been met based on the first log uploaded by the electronic device 100. If it is determined that the second log required for fault diagnosis is missing, a log request can be sent to the electronic device 100. The electronic device 100 can then send the second log to the server 200 in response to the log request, so that the server 200 can perform fault diagnosis.

[0027] It should be noted that the electronic device 100 is Figure 1 and Figure 2In addition to the smartphone shown in , it can also be a tablet computer, a wearable device, an intelligent voice assistant and other devices. Server 200 can be understood as a cloud, wherein server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and a cloud server for basic cloud computing services such as an artificial intelligence platform. Among them, in the case where the fault diagnosis method provided in the embodiment of the present application is executed by a server cluster or a distributed system composed of multiple physical servers, different steps in the fault diagnosis method can be executed by different physical servers respectively, or can be executed in a distributed manner by a server built based on a distributed system.

[0028] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0029] See also Figure 2 , a fault diagnosis method provided by an embodiment of the present application is applied to an electronic device, and the method includes:

[0030] S110: In response to a failure of the electronic device, determining a first failure category of the failure.

[0031] In the embodiment of the present application, the electronic device can determine whether a fault occurs through various collected data, wherein the various collected data include one or more of the running data of the application program, the running data of the hardware device, and the data collected by the sensor.

[0032] The running data of the application may include data such as memory occupancy, CPU usage, response time, whether it crashes, etc. The running data of the hardware device may involve the working status information of the core hardware components of the electronic device, such as the processor, memory, storage device, battery, display, camera, etc. The data collected by the sensor may include the running data of sensors such as accelerometer, gyroscope, magnetometer, ambient light sensor, temperature sensor, humidity sensor, camera and microphone.

[0033] When the collected data is detected to be abnormal, the electronic device can determine that a fault has occurred, and then obtain the category of the fault to obtain a first fault category. As a method, the electronic device can use a pre-set algorithm or machine learning model to analyze the collected abnormal data to identify and determine the first fault category to which the fault belongs. Optionally, the first fault category can be a hardware failure (for example, a damaged display screen, an aging battery, a short circuit of the motherboard, etc.), a software failure (such as an operating system crash, an application conflict), or a hardware-software interaction failure (for example, abnormal communication between the sensor and the processor, incompatibility between the touch screen and the driver, etc.). In other words, in one way, the first fault category can be understood as the fault category preliminarily determined when the electronic device detects a fault.

[0034] S120: Obtain a first log corresponding to the first fault category, and send the first log to a server.

[0035] After the first fault category is determined, a first log may be obtained according to the first fault category.

[0036] It should be noted that in the present application, different categories (or different fields) will be divided for faults, and different categories (or different fields) will be divided for logs. Among them, the way of classifying faults can be the same as the way of classifying logs. For example, the categories obtained by classification can include performance categories, stability categories, network categories, and desktop categories. In this case, the faults can include performance category faults, stability category faults, network category faults, desktop category faults, etc. Correspondingly, the logs in the electronic device can also include performance category logs, stability category logs, network category logs, and desktop category logs.

[0037] When an electronic device fails, sending more categories of logs to the server will be more conducive to the server analyzing the cause of the failure. However, the more log categories sent to the server, the higher the power consumption required for the electronic device to upload the logs, and the server side will need to store more logs. Therefore, in order to balance the power consumption of the electronic device and the need to analyze the cause of the failure, as a way, the first log determined includes logs of the first log category and logs of the second log category. In the electronic device, the logs of the first log category and the logs of the second log category are part of all the logs included in the electronic device. Among them, the first log category is the same as the first fault category, and the second log category is associated with the first fault category. In other words, the logs of the first log category are logs that are directly the same as the fault category generated, and the logs in the second log category can be understood as being different from the first fault category, but having a certain correlation.

[0038] For example, if the determined first fault category is a performance fault, then the determined first log category is also a performance fault. If the determined first fault category is a stability fault, then the determined first log category is a stability log.

[0039] As a method, log association information may be stored in the electronic device, where the log association information is used to characterize the log category associated with each fault category. In this case, the second log category associated with the first fault category may be determined through the log association information.

[0040] Optionally, in the storage system of the electronic device, a data structure of log association information can be pre-configured, and the data structure is used to record and characterize the association relationship between each fault category and a specific log category in detail. As a way, the log association information can be a mapping table or database record, in which each entry contains a unique identifier of the fault category and a list of log categories associated with it. These log categories may include but are not limited to system logs, application logs, hardware diagnostic logs, security event logs, etc., and are intended to comprehensively cover all types of log information that may be generated during the operation of the electronic device. When the electronic device detects a fault and determines the first fault category of the fault, the electronic device can quickly locate and determine the second log category associated with the first fault category based on the mapping relationship in the log association information. Among them, this process usually involves querying the log association information data structure to retrieve entries that match the first fault category identifier and extract its corresponding log category list.

[0041] Optionally, the log association information may be pre-generated by the server and sent to the electronic device, and the electronic device stores it locally.

[0042] Optionally, the log association information can be pre-generated by a centralized server and sent to the electronic device via wired or wireless communication. As a way, the server can continuously optimize and adjust the accuracy and coverage of the log association information based on the historical fault analysis process, fault history experience, and the latest technology trends, and can send the updated log association information to the electronic device. When the electronic device receives the updated log association information, it can store it in the local storage system for quick access and use when needed.

[0043] In addition, to ensure the integrity and consistency of data, electronic devices can implement a series of data verification and validation measures when storing log-related information, such as using hash algorithms to verify the integrity of data, or using timestamps to ensure the timeliness of information. At the same time, electronic devices may also have a mechanism to regularly synchronize the latest log-related information from the server to cope with changing fault types and log requirements.

[0044] Exemplarily, the information content of the log association information may be shown in the following table:

[0045] Fault category Related log categories Fault category G1 Log Category R1 Fault category G1 Log Category R2 Fault category G2 Log Category R2 Fault category G2 Log Category R3

[0046] As shown in the above table, the log categories associated with fault category G1 include log category R1 and log category R2. The log categories associated with fault category G2 include log category R2 and log category R3. Based on the situation shown in the above table, if the first fault category determined is fault category G1, then the first log obtained will include logs of log category R1 and logs of log category R2 in addition to logs of the first log category. If the first fault category determined is fault category G2, then the first log obtained will include logs of log category R2 and log category R3 in addition to logs of the first log category.

[0047] S130: If the server determines that the second log required for fault diagnosis is missing, the second log is sent to the server for the server to perform fault diagnosis.

[0048] After the electronic device sends the first log to the server, the server can first perform a preliminary analysis to determine whether the first log already includes all the logs required for fault cause analysis. If it is determined that the required second log is still missing, the server can obtain the second log. After obtaining the second log, the server can perform fault analysis (for example, root cause analysis) based on the first log and the second log to determine the cause of the fault.

[0049] The second log can be understood as a log that is still missing for analyzing the cause of the current failure of the electronic device. The second log can be determined by the server. In the embodiment of the present application, the server can determine whether the second log is missing in a variety of ways.

[0050] As a way, the server can directly determine the second log through the first fault category. As shown in the above content, when the electronic device collects the first log, it can determine the second log category associated with the first fault category according to the log association information. Among them, the log association information can be transmitted by the server to the electronic device and stored locally by the electronic device. Among them, the log association information in the server may be updated. When the electronic device has not received the latest log association information sent by the server, the log association information stored in the server will be inconsistent with the log association information stored in the electronic device. Therefore, after obtaining the first log and the first fault category uploaded by the electronic device, the server can obtain the association category corresponding to the first fault category in the latest log association information as a reference category. If it is detected that the second log category in the first log is the same as the reference category, it is determined that the second log is not missing. If it is detected that the second log category is less than the reference category, it is determined that the required log is missing. Among them, the second log can include logs of log categories with more reference categories than the second log category.

[0051] Exemplarily, in the log association information stored in the electronic device, the log categories associated with the first fault category G1 include log category R1. In this case, if the first fault category of the fault occurring in the electronic device is the first fault category G1, then in the uploaded first log, the second log category will only include log category R1. However, in the latest log association information in the server, the log categories associated with the first fault category G1 include log category R1 and log category R2. In this case, the server can determine the log of log category R2 as the second log.

[0052] As another way, the second log can be determined by the server through the second fault category, and the second fault category is determined by the server based on the first log. It should be noted that, as shown in the above content, the first fault category is the fault category preliminarily determined by the electronic device. After the server obtains the first log, it can re-analyze the fault category based on the first log, and the fault category obtained by the server based on the analysis of the first log may be different from the first fault category. For example, the first fault category may be a freeze category, and the second fault category may be a crash category. Therefore, in this way, the first fault category can be understood as a first-hand analysis fault category, and correspondingly, the first log can be understood as a log corresponding to the first-hand analysis. Correspondingly, the second fault category can be understood as a potential second-hand analysis fault category, and correspondingly, the second log can be understood as a log corresponding to the potential second-hand analysis.

[0053] As another way, the second log can be determined by the server through a second fault category, the second fault category is determined by the server based on the first log, and the second fault category belongs to a subdivision category of the first fault category. It should be noted that in order to improve the accuracy and processing efficiency of fault location, the server can further subdivide a more specific fault subcategory, i.e., a second fault category, according to the detailed information and context in the first log after receiving the first fault category and the first log sent by the electronic device. Among them, the second fault category will involve more subdivided fault classifications compared to the first fault category, and then more categories of logs can be involved in fault diagnosis and analysis. Optionally, this process can rely on a fault category system pre-set in the server, which covers a variety of possible fault types and their corresponding subdivision categories, so that the server can accurately classify the first log into the most appropriate fault subcategory. For example, the first fault category sent by the electronic device is a performance category fault, and the second fault category determined by the server can be a screen display jamming fault. For another example, the first fault category sent by the electronic device is a network category fault, and the second fault category determined by the server can be a network data transmission fault.

[0054] The process involved in this embodiment is further described below by using an example.

[0055] In one example, when an electronic device detects a fault, the first fault category determined may be a jamming category. In this case, logs of the jamming category and logs of log categories associated with the jamming category are obtained. For example, the log category associated with the jamming category may be a network category, then the first log obtained by the electronic device may include a jamming category log and a network category log. After uploading the first log to the server, the missing second log determined by the server may include a desktop category log. In this case, the electronic device will upload the desktop category log to the server, so that the server can analyze the cause of the jamming of the electronic device through the jamming category logs, network category logs, and desktop category logs.

[0056] A fault diagnosis method provided in this embodiment allows, through the above-mentioned method, when an electronic device determines that a fault occurs, it only needs to upload a first log corresponding to a first fault category first, and then, when the server determines that a second log is still missing, the electronic device can upload the missing second log to the server, so that when the electronic device initially uploads the log, it is not necessary to upload all the logs in the electronic device, but the missing logs can be dynamically supplemented according to the needs of the server, which is beneficial to reduce the power consumption of the electronic device due to log uploading during the fault diagnosis process.

[0057] See also Figure 3 , a fault diagnosis method provided by an embodiment of the present application is applied to an electronic device, and the method includes:

[0058] S210: In response to a fault occurring in the electronic device, determining a first fault category of the fault.

[0059] S220: Obtain a first log corresponding to the first fault category, and send the first log to a server.

[0060] S230: If a log request sent by the server is received, send the missing second log to the server, wherein the log request indicates that the server determines that the log required for fault diagnosis is missing, wherein the log request is sent when the server detects that a third log is not stored in the server, and the third log includes a log similar to the second log.

[0061] In an embodiment of the present application, multiple types of faults can be triggered in advance through multiple test devices, and then part or all of the logs in the test devices are collected when each type of fault occurs.

[0062] Among them, a fault log database can be constructed for the collected logs. In an embodiment of the present application, in order to build a comprehensive and accurate fault log database, a systematic method can be adopted, which involves multiple test devices, multiple categories of fault simulation and log collection process. Among them, multiple test devices can be prepared in advance, and the multiple test devices cover a wide range of hardware and software configurations to ensure that the collected log data is representative and universal.

[0063] Then, you can use professional fault simulation tools or scripts to trigger multiple categories of faults on the test device. These fault categories may include but are not limited to hardware failures (such as processor overheating, memory leaks, storage device damage, etc.), software failures (such as operating system crashes, application unresponsiveness, network connection interruptions, etc.) and system-level failures (such as power management anomalies, security vulnerability exploits, etc.). Through carefully designed fault simulation schemes, we can ensure that each fault category is fully covered. While triggering the fault, you can use the log collection tool or the logging function built into the test device to obtain part or all of the logs of the test device in real time when the fault occurs. Among them, when obtaining logs, you can obtain them according to the aforementioned classification method of logs.

[0064] As one approach, the third log is a log of the same log category as that included in the second log and included in the logs of the test device when the fault of the first fault category occurs in the test device.

[0065] Optionally, the third log is obtained from the test device and stored in the server when a fault of the first fault category is triggered on the test device. When the fault of the first fault category is triggered on the test device, logs of all log categories in the test device can be uploaded to the server.

[0066] Exemplarily, if the determined first fault category is a lag category, and the determined second log includes a desktop category log, the server can first search whether the server has stored a desktop category log (third log) collected when the lag category fault is triggered in the test device. If stored, the stored desktop category log collected from the test device can be directly used to participate in the fault analysis without triggering the electronic device to upload the desktop category log.

[0067] The fault diagnosis method provided in this embodiment is conducive to reducing the power consumption of the electronic device caused by log uploading during the fault diagnosis process. In addition, in this embodiment, when the server determines that the second log required for fault analysis is missing, it can first detect whether a third log similar to the second log is stored in the server, so that if there is a third log, the server can perform fault analysis in combination with the third log without requiring the electronic device to upload the second log.

[0068] See also Figure 4 , a fault diagnosis method provided in an embodiment of the present application is applied to a server, and the method includes:

[0069] S310: Receive a first log sent by an electronic device, where the first log is sent when the electronic device detects a fault, wherein the first log corresponds to a first fault category of the fault, and the first fault category is determined by the electronic device.

[0070] S320: If it is determined that the second log required for fault diagnosis is missing, a log request is sent to the electronic device.

[0071] S330: Receive the second log sent by the electronic device for use by the server in fault diagnosis.

[0072] As a method, if it is determined that the second log required for fault diagnosis is missing, sending a log request to the electronic device includes: detecting whether the server stores a third log similar to the second log; if the third log is not stored, sending a log request to the electronic device. If the third log is stored, the server analyzes the cause of the fault of the first fault category of the electronic device based on the first log and the third log.

[0073] The fault diagnosis method provided in this embodiment is conducive to reducing the power consumption of the electronic device caused by log uploading during the fault diagnosis process. In addition, in this embodiment, when the server determines that the second log required for fault analysis is missing, it can first detect whether a third log similar to the second log is stored in the server, so that if there is a third log, the server can perform fault analysis in combination with the third log without requiring the electronic device to upload the second log.

[0074] Next, pass Figure 5 The process of a fault diagnosis method involved in an embodiment of the present application is described below.

[0075] exist Figure 5The domain shown in can be understood as a category. For example, a category of logs can be generated for domain process #A. A category of logs can be generated for domain process #B. In the electronic device (end side), the log collection agent module (i.e. Figure 5 The log collection agent in the system collects logs for each field (or each log category). When an electronic device fails, the log collection agent module can obtain a first log and report the obtained first log to a server (for example, a log analysis platform on the cloud side). Figure 5 The “capturing statically associated domain logs” can be understood as the aforementioned acquisition of logs of the second log category.

[0076] After obtaining the first log uploaded by the electronic device, the log analysis platform can first perform a fault delimitation analysis on the reported log. The fault delimitation analysis is used to determine whether the reported log meets the basic conditions required for analyzing the fault of the first fault category. If there is insufficient log and the second log is missing, first obtain a similar log from the cloud log storage (for example, if the production environment reports insufficient logs, obtain similar logs from the test environment to make up for it). If the corresponding log can be made up, then enter the log root cause analysis. Among them, the production environment can be understood as the scenario of actually applying the fault diagnosis method provided by the embodiment of the present application, and the initial environment can be understood as the scenario of log collection through the aforementioned test equipment. For example, when analyzing the jamming field log, if there is a missing desktop category log, you can first try to obtain a log similar to the desktop category log from the cloud log storage.

[0077] If the corresponding log cannot be supplemented, the corresponding missing field log is analyzed according to the fault demarcation, and the log acquisition request is dynamically issued again to capture the missing log, and then the corresponding missing field log is captured from the terminal side and uploaded to the cloud, and finally the root cause analysis of the defect is performed in the cloud.

[0078] That is to say, in the embodiment of the present application, when the electronic device uploads the first log, the log of the second log category in the first log is determined according to the log association information, so the process of obtaining the second log category can be understood as a static associated field (category) log acquisition process, and the subsequent second log is dynamically determined by the log analysis platform in the server, therefore, determining the second log and obtaining the second log can be understood as a process of obtaining a dynamic associated field (category) log. Thus, the electronic device and the server can realize the combination of static and dynamic, and improve the accuracy of field log collection.

[0079] See also Figure 6 , a fault diagnosis device 400 provided in an embodiment of the present application runs on an electronic device, and the device 400 includes:

[0080] The fault response unit 410 is configured to determine a first fault category of the fault in response to a fault occurring in the electronic device.

[0081] The log collection unit 420 is configured to obtain a first log corresponding to the first fault category and send the first log to a server. As a mode, the first log includes a log of a first log category and a log of a second log category, the first log category is the same as the first fault category, and the second log category is associated with the first fault category.

[0082] The log sending unit 430 is configured to send the second log required for fault diagnosis to the server if the server determines that the second log required for fault diagnosis is missing, so that the server can perform fault diagnosis.

[0083] As one embodiment, the first log includes a log of a first log category and a log of a second log category, the first log category is the same as the first fault category, and the second log category is associated with the first fault category.

[0084] Optionally, the log collection unit 420 is specifically used to determine the second log category through log association information, where the log association information is used to characterize the log category associated with each fault category, and the log association information is pre-sent by the server to the electronic device.

[0085] As one approach, the second log is determined by the server through a second fault category, the second fault category is determined by the server based on the first log, and the second fault category belongs to a subcategory of the first fault category; or, the second log is determined by the server through the first fault category.

[0086] As a method, the log sending unit 430 is specifically used to send the missing second log to the server if a log request sent by the server is received, wherein the log request represents that the server determines that the log required for fault diagnosis is missing; wherein the log request is sent when the server detects that the third log is not stored in the server, and the third log includes a log similar to the second log.

[0087] See also Figure 7 , a fault diagnosis device 500 provided in an embodiment of the present application runs on a server, and the device 500 includes:

[0088] The log acquisition unit 510 is used to receive a first log sent by an electronic device, where the first log is sent when the electronic device detects a fault, wherein the first log corresponds to a first fault category of the fault, and the first fault category is determined by the electronic device.

[0089] The log request unit 520 is configured to send a log request to the electronic device if it is determined that the second log required for fault diagnosis is missing.

[0090] The fault diagnosis unit 530 is used to receive the second log sent by the electronic device for the server to perform fault diagnosis.

[0091] A fault diagnosis device provided in this embodiment allows, through the above device, when the electronic device determines that a fault occurs, it is only necessary to upload a first log corresponding to a first fault category first, and then, when the server determines that a second log is still missing, the electronic device can upload the missing second log to the server, so that when the electronic device initially uploads the log, it is not necessary to upload all the logs in the electronic device, but the missing logs can be dynamically supplemented according to the needs of the server, which is beneficial to reduce the power consumption of the electronic device due to log uploading during the fault diagnosis process.

[0092] It should be noted that the device embodiment in the present application corresponds to the aforementioned method embodiment. The specific principles in the device embodiment can be found in the contents of the aforementioned method embodiment and will not be repeated here.

[0093] The following will be combined Figure 8 An electronic device provided by the present application is described.

[0094] See also Figure 8 Based on the above fault diagnosis method and device, the embodiment of the present application also provides another electronic device 1000 that can execute the above fault diagnosis method. The electronic device 1000 includes one or more (only one is shown in the figure) processors 102, a memory 104, and a network module 106 that are coupled to each other. Among them, the memory 104 stores a program that can execute the content of the above embodiment, and the processor 102 can execute the program stored in the memory 104.

[0095] Among them, the processor 102 may include one or more processing cores. The processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 1000, and executes various functions and processes data of the electronic device 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 104, and calling data stored in the memory 104. Optionally, the processor 102 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA), or the processor 102 can be an application processor (Application Processor). The processor 102 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 102, but may be implemented separately through a communication chip.

[0096] The memory 104 may include a random access memory (RAM) or a read-only memory (ROM). The memory 104 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.

[0097] The network module 106 is used to implement information exchange between the electronic device 1000 and other devices, for example, to transmit device control instructions, operation request instructions, and status information acquisition instructions, etc. When the electronic device 1000 is specifically a different device, the corresponding network module 106 may be different.

[0098] In addition, in one case, the electronic device 1000 may also include a screen, a sensor module, and an audio acquisition device.

[0099] The screen can be used to display the screen. For example, when a game program is running, it can be used to display the game screen corresponding to the game program. In one embodiment, the electronic device 1000 can capture multiple frames of screens continuously displayed on the screen to obtain multiple frames of screens required for detecting whether the electronic device 100 is displaying the event animation.

[0100] The sensor module may include at least one sensor. Specifically, the sensor module may include but is not limited to: a light sensor, a motion sensor, a pressure sensor, an infrared heat sensor, a distance sensor, an acceleration sensor, and other sensors. Among them, the pressure sensor can be a sensor that detects the pressure generated by pressing on the electronic device 1000. That is, the pressure sensor detects the pressure generated by the contact or pressing between the user and the audio playback device, such as the pressure generated by the contact or pressing between the user's ear and the mobile terminal. Therefore, the pressure sensor can be used to determine whether contact or pressing occurs between the user and the electronic device 1000, and the magnitude of the pressure. Among them, the acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the application of the posture of the electronic device 1000 (such as horizontal and vertical screen conversion, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, knocking), etc. In addition, the electronic device 1000 can also be configured with other sensors such as gyroscopes, barometers, hygrometers, thermometers, etc., which will not be repeated here.

[0101] The audio acquisition device is used to acquire audio signals. Optionally, the audio acquisition device includes a plurality of audio acquisition devices. The audio acquisition device may be a microphone.

[0102] As a method, the network module of the electronic device 1000 is a radio frequency module, which is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The radio frequency module may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity modules (SIM) cards, memories, etc. For example, the radio frequency module can exchange information with an external device through the electromagnetic waves sent or received, and then receive audio signals sent by the external device.

[0103] Please refer to Fig. 9 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 1100 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0104] The computer readable storage medium 1100 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 1100 includes a non-transitory computer-readable storage medium. The computer readable storage medium 1100 has storage space for program code 1110 that executes any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 1110 can be compressed, for example, in an appropriate form.

[0105] An embodiment of the present application further provides a computer program product, which includes computer instructions stored in a computer-readable storage medium; the computer program product is used to implement the above-mentioned fault diagnosis method.

[0106] In summary, the present application provides a fault diagnosis method, device and electronic device, in which the first fault category of the fault can be determined in response to a fault in the electronic device; then the first log corresponding to the first fault category is obtained and the first log is sent to the server; if the server determines that the second log required for fault diagnosis is missing, the electronic device will send the second log to the server for the server to perform fault diagnosis. Thus, through the above method, when the electronic device determines that a fault has occurred, it only needs to upload the first log corresponding to the first fault category first, and then, when the server determines that the second log is still missing, the electronic device can upload the missing second log to the server, so that when the electronic device initially uploads the log, it does not need to upload all the logs in the electronic device, but can dynamically supplement the missing logs according to the needs of the server, which is conducive to reducing the power consumption of the electronic device due to log uploading during the fault diagnosis process.

[0107] In addition, the embodiment of the present application obtains the logs required for fault analysis through the end-cloud integration method, and the electronic device (end side) and the server (cloud side) will have the following benefits:

[0108] Electronic equipment: Since only relevant logs of specific fields (first log category) and related fields (second log category) are reported, the reported log information will be reduced by at least 80%, and the corresponding power consumption will also be reduced. Server: Since relatively complete logs can be collected and unnecessary logs can be removed, the accuracy of defect diagnosis analysis can be improved by at least 60%, and the related storage and processing costs can be reduced by at least 80%.

[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical feature diagrams therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A fault diagnosis method, characterized in that: Applied to electronic equipment, the method comprises: In response to a fault occurring in the electronic device, determining a first fault category of the fault; Obtaining a first log corresponding to the first fault category, and sending the first log to a server; If the server determines that the second log required for fault diagnosis is missing, the second log is sent to the server for the server to perform fault diagnosis.

2. The method according to claim 1, characterized in that The first log includes a log of a first log category and a log of a second log category, the first log category is the same as the first fault category, and the second log category is associated with the first fault category.

3. The method according to claim 2, characterized in that The method further comprises: The second log category is determined by log association information, where the log association information is used to characterize the log category associated with each fault category, and the log association information is sent in advance by the server to the electronic device.

4. The method according to claim 1, characterized in that: The second log is determined by the server through a second fault category, the second fault category is determined by the server based on the first log, and the second fault category belongs to a sub-category of the first fault category; Alternatively, the second log is determined by the server according to the first fault category.

5. The method according to claim 1, characterized in that If the server determines that the second log required for fault diagnosis is missing, sending the second log to the server includes: If a log request sent by the server is received, sending the missing second log to the server, wherein the log request indicates that the server determines that the log required for fault diagnosis is missing; The log request is sent when the server detects that no third log is stored in the server, and the third log includes a log similar to the second log.

6. A fault diagnosis method, characterized in that: Applied to a server, the method comprises: Receiving a first log sent by an electronic device, wherein the first log is sent when the electronic device detects a fault, wherein the first log corresponds to a first fault category of the fault, and the first fault category is determined by the electronic device; If it is determined that the second log required for fault diagnosis is missing, sending a log request to the electronic device; The second log sent by the electronic device is received for use by the server in fault diagnosis.

7. The method according to claim 6, characterized in that If it is determined that the second log required for fault diagnosis is missing, sending a log request to the electronic device includes: Detecting whether the server stores a third log similar to the second log; If the third log is not stored, a log request is sent to the electronic device.

8. A fault diagnosis device, characterized in that: Running on an electronic device, the device comprises: a fault response unit, configured to determine a first fault category of the fault in response to a fault occurring in the electronic device; A log collection unit, configured to obtain a first log corresponding to the first fault category, and send the first log to a server; The log sending unit is used to send the second log required for fault diagnosis to the server if the server determines that the second log required for fault diagnosis is missing, so that the server can perform fault diagnosis.

9. A fault diagnosis device, characterized in that: Running on a server, the device comprises: A log acquisition unit, configured to receive a first log sent by an electronic device, wherein the first log is sent when the electronic device detects a fault, wherein the first log corresponds to a first fault category of the fault, and the first fault category is determined by the electronic device; a log request unit, configured to send a log request to the electronic device if it is determined that the second log required for fault diagnosis is missing; The fault diagnosis unit is used to receive the second log sent by the electronic device for use by the server in fault diagnosis.

10. An electronic device, characterized in that: including a processor and a memory; One or more programs are stored in the memory and configured to be executed by the processor to implement the method according to any one of claims 1 to 7.

11. A computer program product, characterized in that The computer program product comprises computer instructions, and the computer instructions are stored in a computer-readable storage medium; the computer program product is used to implement the method according to any one of claims 1 to 7.