A data acquisition method and an electronic device

By automatically collecting and generating data acquisition methods in electronic devices, the problem of complex data acquisition and relying on personal computers in the prior art is solved, which reduces the difficulty of analyzing the performance problems of electronic devices and improves work efficiency.

CN118467310BActive Publication Date: 2025-06-17HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311693393.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-11
Publication Date
2025-06-17
Estimated Expiration
2043-12-11

AI Technical Summary

Technical Problem

In the prior art, when R&D personnel debug the performance problems of electronic equipment, the process of collecting data is complicated and needs to rely on personal computers for control, which is relatively limited, which makes it more difficult to analyze performance problems.

Method used

Provides a data acquisition method. When an electronic device responds to user interaction, it automatically collects process information and generates analysis files, including process information and detection information, for analysis by R&D personnel when an interaction abnormality is detected. This method does not require relying on other devices, and electronic devices can automatically collect and generate analysis files.

Benefits of technology

It reduces the difficulty of obtaining performance data of electronic devices, simplifies the process of analyzing performance problems of electronic devices, and improves the work efficiency of R&D personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118467310B_ABST
    Figure CN118467310B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a data acquisition method and an electronic device, which relate to the technical field of electronic devices and can be applied to electronic devices. The method includes: The electronic device collects process information of the electronic device in response to a user's interaction operation; wherein, the process information includes call stack information corresponding to the process of the electronic device in response to the interaction operation; when the electronic device finishes responding to the interaction operation, it obtains detection information for this process; when the detection information indicates that there is an interaction anomaly in this process, the electronic device generates an analysis file for this process, and the analysis file includes process information and detection information. This solution can reduce the difficulty of the electronic device in obtaining performance data, and thus reduce the difficulty of analyzing the performance problems of the electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the technical field of electronic devices, and in particular, to a data acquisition method and an electronic device. Background Art

[0002] When debugging performance problems of an electronic device, R & D personnel can collect some data of the electronic device to help locate the performance problems of the electronic device.

[0003] Under normal circumstances, R & D personnel collect data of the electronic device by connecting the electronic device to a personal computer (PC) device, and the PC device controls the start and end of internal data acquisition of the electronic device, with relatively large limitations. Therefore, it is difficult for R & D personnel to analyze the performance problems of the electronic device. Summary of the Invention

[0004] Embodiments of the present application provide a data acquisition method and an electronic device, which can reduce the difficulty of the electronic device in obtaining performance data, and further reduce the difficulty of analyzing the performance problems of the electronic device.

[0005] To achieve the above object, the embodiments of the present application adopt the following technical solutions:

[0006] In a first aspect, a data acquisition method is provided, which is applied to an electronic device. The method includes: the electronic device collects process information in response to a user's interaction operation, where the process information includes call stack information corresponding to the process of the electronic device in response to the interaction operation; when the electronic device completes the response to the interaction operation, it obtains detection information for the process; when the detection information indicates that there is an interaction anomaly in the process, the electronic device generates an analysis file for the process, and the analysis file includes the process information and the detection information.

[0007] By adopting the above technical solution, the electronic device can collect process information during the process of responding to the user's interaction operation, and when there is an interaction anomaly in the process, the electronic device can generate an analysis file by obtaining the above process information and the detection information corresponding to the process for R & D personnel to analyze the performance problems of the electronic device. The electronic device does not need to rely on other devices to obtain the analysis file, and the electronic device can automatically collect and generate the analysis file.

[0008] In a possible implementation manner of the first aspect, after the electronic device generates an analysis file for the process, the method further includes: the electronic device uploads the analysis file to a cloud server. Thus, after the electronic device uploads the analysis file to the cloud server, R & D personnel can remotely analyze the performance problems of the electronic device by obtaining the analysis file in the cloud server.

[0009] In a possible implementation of the first aspect, before the electronic device generates an analysis file for a process, the method further includes: the electronic device obtains an execution event corresponding to an interaction operation. Here, the execution event represents the interaction scenario information corresponding to the interaction operation.

[0010] In a possible implementation of the first aspect, the electronic device uploads the analysis file to the cloud server, including: the electronic device uploads the analysis file and the execution event to the cloud server together.

[0011] In a possible implementation of the first aspect, when the electronic device completes the response to the interaction operation, obtaining detection information for the process includes: when the electronic device completes the response to the user's interaction operation, obtaining the log information of the electronic device's response to the interaction operation. The electronic device obtains detection information for the process of the electronic device's response to the user's interaction operation based on the log information. Among them, the detection information here can be used to determine whether there is an interaction anomaly in the electronic device during this process. Here, the interaction anomaly can also be called a performance failure.

[0012] In a possible implementation of the first aspect, the electronic device responds to the user's interaction operation and collects process information of the electronic device's response to the interaction operation, including: the electronic device responds to the user's interaction operation and triggers the collection service to collect the process information of the electronic device's response to the interaction operation. The collection service is pre-configured in the electronic device and can respond to the user's collection requirements for the above process information in real time. Specifically, when the electronic device responds to the user's interaction operation, it generates a collection requirement for the above process information and sends it to the collection service. The collection service then responds to the collection requirement and collects the process information of the electronic device's response to the interaction operation.

[0013] In a possible implementation of the first aspect, the electronic device responds to the user's interaction operation and collects process information of the electronic device's response to the interaction operation, including: the electronic device triggers the recording of process information based on the user's interaction operation through the interaction scenario recognition service. The interaction scenario recognition service is pre-configured in the electronic device to identify the user's interaction operation, record the start and end times of the interaction operation through logs, and generate the interaction scenario information corresponding to the interaction operation.

[0014] In a possible implementation of the first aspect, the process information includes at least one of system trace information, system log information, and simple performance information.

[0015] In a possible implementation of the first aspect, the interaction anomaly includes at least one of the electronic device being unable to respond to user operations, the electronic device having a frame drop event, and the startup delay of the electronic device exceeding a preset delay threshold.

[0016] In a second aspect, the present application provides a data acquisition method applied to a cloud server. The method includes: the cloud server receives an analysis file uploaded by an electronic device to analyze the interaction anomaly of the electronic device. The analysis file includes process information and detection information, which are used to locate the position where the interaction anomaly of the electronic device occurs and also represent the performance problems of the electronic device; the process information includes the call stack information corresponding to the process in which the electronic device responds to the user's interaction operation; the detection information is for the process in which the electronic device responds to the interaction operation and is used to indicate that there is an interaction anomaly in the process. Among them, the cloud server itself can analyze the interaction anomaly of the electronic device, or alternatively, R & D personnel or staff can analyze the analysis file obtained through the cloud server to analyze the interaction anomaly of the electronic device.

[0017] By adopting the above technical solution, the cloud server can receive the analysis file uploaded by the electronic device for the process in which the electronic device responds to the interaction operation. Thus, R & D personnel can remotely analyze the performance problems of the electronic device through the analysis file in the cloud server.

[0018] In a third aspect, an electronic device is provided, including: a communication module, a memory, and one or more processors; the communication module, the memory, and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions. When the computer instructions are executed by the electronic device, the electronic device executes the above method.

[0019] In a fourth aspect, a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium. When it runs on a computer, the computer can execute the method according to any one of the first aspect or the second aspect above.

[0020] In a fifth aspect, a computer program product containing instructions is provided. When it runs on an electronic device, the electronic device can execute the method according to any one of the first aspect or the second aspect above.

[0021] In a sixth aspect, a device (for example, the device can be a chip system) is provided. The device includes a processor for supporting the electronic device to implement the functions involved in the first aspect or the second aspect above. In a possible design, the device further includes a memory for storing the necessary program instructions and data of the electronic device. When the device is a chip system, it can be composed of chips or include chips and other discrete devices.

[0022] Among them, for the technical effects brought by any one of the third aspect to the sixth aspect, reference can be made to the technical effects brought by different design manners in the first aspect or the second aspect, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A schematic diagram of a scenario for collecting logs provided by an embodiment of the present application;

[0024] Figure 2 A schematic diagram of the software structure of an electronic device provided by an embodiment of the present application;

[0025] Figure 3 A schematic diagram of an abnormal sliding page provided by an embodiment of the present application;

[0026] Figure 4 A schematic diagram of a scenario for data upload provided by an embodiment of the present application;

[0027] Figure 5 A schematic diagram of the overall process of a data acquisition method provided by an embodiment of the present application;

[0028] Figure 6 A timing diagram of the operation of a data acquisition method provided by an embodiment of the present application;

[0029] Figure 7 A schematic diagram of a scenario for a data acquisition method provided by an embodiment of the present application;

[0030] Figure 8 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application;

[0031] Figure 9 A schematic diagram of the structure of a chip system provided by an embodiment of the present application. Detailed implementation manners

[0032] Next, the technical solutions in the embodiments of the present application will be described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0033] The following terms "first", "second", etc. are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first", "second", etc. may explicitly or implicitly include one or more of such features. In the description of this embodiment, unless otherwise stated, the meaning of "a plurality" is two or more. In the present application, the character " / " generally represents an "or" relationship between the associated objects before and after. For example, A / B can be understood as A or B.

[0034] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not limited to the listed steps or modules, but optionally further includes other steps or modules not listed, or optionally further includes other steps or modules inherent to these processes, methods, products, or devices.

[0035] In addition, in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in this application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present concepts in a specific manner.

[0036] Currently, when debugging performance problems of an electronic device, R & D personnel can collect some data of the electronic device, etc., to help locate the performance problems of the electronic device.

[0037] In the embodiments of this application, some data of the electronic device can be taken as an example of the simple performance (simpleperf) information of the electronic device (also referred to as simpleperf log) for illustration. Among them, the simpleperf log has relatively complete call stack information of program operation. Among them, the call stack is a stack that stores messages about running subroutines, and can also be called a "stack". Almost all computer programs rely on the call stack. However, the call stack does not necessarily only store subroutine messages. The call stack is most often used to store the return addresses of subroutines. When calling any subroutine, the main program must temporarily store the address to which it should return after the subroutine finishes running. Thus, obtaining the simpleperf log, that is, obtaining the complete call stack information of program operation, is of great help to R & D personnel in locating the performance problems of the electronic device.

[0038] Usually, when R & D personnel collect the simpleperf log of an electronic device, they connect the electronic device to a personal computer (PC) device, and the PC device controls the start and end of simpleperf log collection, which has relatively large limitations. Please refer to Figure 1 , Figure 1 FIG. is a schematic diagram of a scenario for collecting logs provided by an embodiment of this application. As Figure 1As shown in the figure, taking the electronic device as the mobile phone 101 as an example, the R & D personnel need to connect the mobile phone 101 to the PC device 102, and manually start and stop the collection of simpleperf logs in the mobile phone 101 on the PC device 102. During the collection process, the R & D personnel need to manually simulate each interaction scenario to obtain the simpleperf logs for each interaction scenario.

[0039] Therefore, the above process requires the R & D personnel to spend a lot of time simulating interaction scenarios, making it difficult for the R & D personnel to analyze the performance problems of the electronic device. Here, the performance problems of the electronic device also indicate the interaction anomalies existing in the electronic device.

[0040] To solve the above problems, a data acquisition method provided by an embodiment of the present application can collect process information through an electronic device during the process of responding to a user's interaction operation, and obtain detection information for the process when the electronic device completes responding to the interaction operation. Finally, when the detection information indicates that there is an interaction anomaly in the process, the electronic device generates an analysis file for the process based on the detection information and the process information, and the analysis file can be used to analyze the performance problems of the electronic device. Therefore, by adopting the above method, the electronic device can collect process information during the process of responding to a user's interaction operation, and when there is an interaction anomaly in the process, the electronic device can generate an analysis file by obtaining the above process information and the detection information corresponding to the process for the R & D personnel to analyze the performance problems of the electronic device. The electronic device does not need to rely on other devices to obtain the analysis file, and the electronic device can automatically collect and generate the analysis file.

[0041] The implementation manners of the embodiments of the present application will be described in detail below with reference to the accompanying drawings. A data acquisition method provided by an embodiment of the present application can be applied to an electronic device. In the embodiments of the present application, taking the above electronic device as an Android device and the collected function data as simpleperf logs as an example, the software architecture of the electronic device is introduced.

[0042] As Figure 2 shown, it is a schematic diagram of the software structure inside the electronic device. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the internal architecture of the electronic device can be, from top to bottom, the application layer, the application framework layer, the system library, and the kernel layer.

[0043] The application layer can include a series of application packages.

[0044] As Figure 2 shown, the application packages can include applications such as the desktop, the camera, and third-party applications.

[0045] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework layer includes some predefined functions.

[0046] As Figure 2 shown, the application framework layer may include a window manager, an activity manager, a view manager, etc.

[0047] The window manager provides a window manager service (WMS), and the WMS can be used for window management, window animation management, surface management, and as a transfer station for the input system.

[0048] The view manager includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures.

[0049] The activity manager can provide an activity manager service (AMS), and the AMS can be used for the startup, switching, scheduling of system components (such as activities, services, content providers, broadcast receivers), and the management and scheduling of application processes.

[0050] As Figure 2 shown, the system library may include a graphics library, a log library, and a network library.

[0051] In the embodiments of the present application, the system library further includes a log packaging and uploading service, a performance fault detection service, a simpleperf collection service, and an interaction scenario recognition service.

[0052] Among them, the log packaging service is used to package and record the process information of the electronic device in response to the user's interaction operation together with the detection information for this process, and upload it to the cloud server. Or, the log packaging service is used to package and record the process information of the electronic device in response to the user's interaction operation, the detection information for this process, and the execution events corresponding to the user's interaction operation together, and upload it to the cloud server.

[0053] The performance fault detection service is used to determine whether there is an interaction anomaly in the process of the electronic device in response to the user's interaction operation.

[0054] The simpleperf collection service is used to collect the process information of the electronic device in response to the user's interaction operation in response to the user's interaction operation.

[0055] The interaction scenario recognition service is used to recognize the user's interaction operation and trigger the simpleperf collection service to collect the process information of the electronic device in response to the interaction operation.

[0056] The kernel layer is the layer between hardware and software. The kernel layer at least includes device drivers, file systems, Binder drivers, etc.

[0057] The methods of the following embodiments can all be implemented in an electronic device with the above software structure.

[0058] Next, a data acquisition method provided by an embodiment of the present application, which is applied to an electronic device, will be introduced in detail, including steps S301 - S303, as follows:

[0059] Step S301: The electronic device responds to the user's interaction operation and collects the process information of the electronic device in response to the interaction operation.

[0060] In the embodiments of the present application, the user's interaction operation includes the touch operation of the user on the electronic device, and this touch operation can further trigger the electronic device to perform corresponding processing. The user's interaction operation can include, for example, the start operation of a certain application on the electronic device by the user, the sliding operation of the electronic device page by the user, or the switching operation of the electronic device page by the user, etc.

[0061] Among them, the electronic device can respond to the start operation of a certain application in the electronic device by the user and start the application. There will be a set start animation effect during the process of the electronic device starting the application. Or, the electronic device can respond to the sliding operation of the page by the user and slide the page. The electronic device can slide the page up and down or left and right. The above process of starting the application or sliding the page is the process of the electronic device in response to the user's interaction operation.

[0062] In some examples, the above process of the electronic device in response to the user's interaction operation can be regarded as the user interaction scenario.

[0063] The interaction scenario recognition service and the collection service are pre - configured in the electronic device. The interaction scenario recognition service is used to recognize the user's interaction operation and trigger the collection service to collect the process information of the electronic device in response to the interaction operation. The collection service is used to collect the process information of the electronic device in response to the user's interaction operation in response to the user's interaction operation.

[0064] Thus, after receiving a user's interaction operation, the electronic device triggers the recording of process information for the electronic device's response to the interaction operation through the interaction scenario recognition service based on the interaction operation. Among them, the above "triggering the recording of process information for the electronic device's response to the interaction operation" specifically means: the electronic device triggers the collection service to collect the process information of the electronic device's response to the interaction operation. If the process information is simpleperf log, then the collection service here can be the simpleperf collection service.

[0065] Among them, the process information can also include system trace (systrace) information and system log information. System log information can also be called android-log information.

[0066] When the electronic device recognizes a user's interaction operation on the electronic device, it can record the start and end points of the interaction operation in real time through logging. When the electronic device responds to the start of the interaction operation, it triggers the simpleperf collection service to collect the simpleperf log; when the electronic device responds to the end of the interaction operation, the simpleperf collection service stops collecting the simpleperf log. Thus, the electronic device can obtain the simpleperf log corresponding to the entire process of the interaction operation. For example, when the mobile phone receives a user's sliding operation on a certain page, it triggers the simpleperf collection service to collect the simpleperf log until the page stops sliding, then the simpleperf collection service stops collecting the simpleperf log.

[0067] Among them, when the electronic device responds to the start of the interaction operation, it triggers the simpleperf collection service to collect the simpleperf log, specifically: when the electronic device responds to the start of the interaction operation, it sends a collection request to the simpleperf collection service, and then the simpleperf collection service can respond to the collection request in real time and collect the simpleperf log during the interaction operation process.

[0068] Step S302, when the electronic device finishes responding to the interaction operation, obtain the detection information for the process of the electronic device's response to the interaction operation.

[0069] In the embodiments of the present application, if the interaction operation is to start an application, then the end of the interaction operation is the successful start of the application; if the interaction operation is to slide a page, then the end of the interaction operation is the page stops sliding; if the interaction operation is to switch pages, then the end of the interaction operation is the successful page switching, etc. After the interaction operation ends, the electronic device is in a situation where it has finished responding to the interaction operation.

[0070] When the electronic device completes the response to the interactive operation, the electronic device can determine whether there is an interactive anomaly in the process by obtaining log information corresponding to the process of the electronic device responding to the interactive operation. The log information here can be system log information.

[0071] Among them, the interaction anomaly includes at least one of the electronic device being unable to respond to user operations, the electronic device having a frame loss event, and the electronic device's startup delay exceeding a preset delay threshold. The above-mentioned electronic device being unable to respond to user operations may be, for example, a user clicking on an application, but the application is not successfully opened. The above-mentioned electronic device having a frame loss event may be, for example, a freeze when the user slides the page, or a freeze during the startup animation of an application after the user opens the application. The startup delay of the above-mentioned electronic device exceeding the preset delay threshold may be, for example, a user clicking on an application, but the application takes a long time to open, or a user clicking on a control, but the control responds slowly, or the electronic device turns on / off the screen for more than a preset time.

[0072] For example, see Figure 3 , Figure 3 A schematic diagram of a sliding page abnormality provided in an embodiment of the present application. Figure 3 As shown in a, the user slides the mobile page 301 to the left. Figure 3 The page 301 shown in a is a schematic diagram of a page corresponding to the start time of sliding the page. Figure 3 The page 305 shown in e is a schematic diagram of the page corresponding to the end time of the sliding page. Figure 3 Page 302 shown in b, Figure 3 The page shown in c is 303 and Figure 3 The page 304 shown in FIG. d is a schematic diagram of each page displayed during the sliding page process. Figure 3 It can be seen that Figure 3 The page shown in b is 302 with Figure 3 If the page 303 shown in c is the same as that in the mobile phone, it can be considered that a frame loss event occurred during the sliding process, resulting in Figure 3 The page shown in b is 302 with Figure 3 The page 303 shown in c is stuck, causing the page display to be the same.

[0073] The detection information acquired by the electronic device regarding the process of the electronic device responding to the interactive operation may be log information of the process, or may be information obtained after analyzing the log information.

[0074] In some examples, the electronic device can also obtain detection information for the process from the log information obtained for the process, and the electronic device can determine whether there is an interaction anomaly in the process based on the detection information. The detection information here can include various time information for the process in the log information. For example, in the process of the electronic device responding to the user's operation of swiping the page, the electronic device can know the time point of card lag during the page swiping process through the time information.

[0075] Step S303: When the detection information indicates that there is an interaction anomaly in the process of the electronic device responding to the interaction operation, the electronic device generates an analysis file for the process.

[0076] In the embodiments of the present application, the electronic device determines whether there is an interaction anomaly in the process of the electronic device responding to the interaction operation through the detection information. Among them, the detection information can be an indication result determined by the electronic device based on the log information of the process of the interaction operation whether there is an interaction anomaly. Or, the detection information can also include information corresponding to each event in the process of the interaction operation. If the detection information includes the time points corresponding to each event in the process of the interaction operation, it can be determined whether the event times out. If the electronic device determines that the event times out, the detection information indicates that there is an interaction anomaly in the process of the electronic device responding to the interaction operation. For example, the interaction operation is to open Application 1, and the detection information includes the duration of opening Application 1. If the duration exceeds the preset duration threshold, then through the detection information, it can be determined that the electronic device times out when opening Application 1, and there is an interaction anomaly in the process of the electronic device opening Application 1.

[0077] At this time, the electronic device can obtain the detection information and the process information of the electronic device responding to the interaction operation. Then, the electronic device can package and process the detection information and the process information together to generate an analysis file for the process. The analysis file can be used by R & D personnel to analyze performance problems.

[0078] In some examples, the electronic device can also obtain the execution event for the interaction operation and store it in the electronic device together with the analysis file, so that R & D personnel can analyze the performance problems of the electronic device for the analysis file and the execution event.

[0079] Among them, the execution event for the interaction operation can refer to, for example, the process from the start of swiping to the end of swiping of the page when the electronic device responds to the user's operation of swiping the page; or, the process from the start of opening to the completion of opening of an application when the electronic device responds to the user's operation of opening an application. Among them, if there is a startup animation effect set during the startup process of the application, it will also be recorded in the above execution event. Among them, the execution event here also represents the interaction scenario information corresponding to the interaction operation.

[0080] After the electronic device generates an analysis file, it can upload the analysis file to the cloud server so that R & D personnel can obtain the analysis file for the above interaction process through the cloud server and remotely analyze the performance problems of the electronic device in the background. As Figure 4 In the schematic diagram of data upload shown, the mobile phone 401 uploads the generated analysis file to the cloud server 402.

[0081] Among them, the electronic device can also obtain the execution event of the interaction operation. Then, the electronic device uploads the analysis file and the execution event to the cloud server together.

[0082] In some examples, after the electronic device generates an analysis file, it can be stored in a specific location in the electronic device. Subsequently, after the staff connects the PC device to the electronic device, the staff can obtain the analysis file stored in the electronic device through the PC device. However, it is not necessary for the staff to manually test, but the analysis file can be directly found.

[0083] Alternatively, after the electronic device stores the above analysis file, with the consent of the user of the device manufacturer's user improvement plan, the user of the electronic device transmits the analysis file and other files (such as the execution event for the interaction operation) to the cloud server together.

[0084] Alternatively, in the case of repair, the user of the electronic device actively sends the analysis file stored in the electronic device to the staff.

[0085] For the sake of easy understanding, in the following, an example is given where the electronic device uploads the analysis file to the cloud server, but it should not be regarded as a limitation to this solution.

[0086] In summary, the data acquisition method provided in the embodiment of the present application can collect process information by the electronic device during the process of the electronic device responding to the user's interaction operation, and in the case of interaction anomalies in this process, the electronic device can generate an analysis file by obtaining the above process information and the detection information corresponding to this process for R & D personnel to analyze the performance problems of the electronic device. Among them, the electronic device does not need to rely on other devices to obtain the analysis file, and the electronic device can automatically collect and generate the analysis file.

[0087] The embodiment of the present application also provides another data acquisition method, which is applied to an electronic device. Taking the electronic device as a mobile phone as an example, it can include step S401-step S404, specifically as follows:

[0088] Step S401, the mobile phone responds to the user's interaction operation and collects the simpleperf log of the mobile phone in response to the interaction operation.

[0089] Among them, please refer to the introduction of the user's interaction operation in the foregoing embodiment, and the embodiment of the present application will not elaborate here.

[0090] The mobile phone is configured with an interaction scenario recognition service and a simpleperf collection service. The interaction scenario recognition service is used to identify the user's interaction operation and trigger the simpleperf collection service to collect the simpleperf logs of the electronic device in response to the interaction operation. The simpleperf collection service is used to collect the simpleperf logs of the electronic device in response to the user's interaction operation in response to the user's interaction operation.

[0091] Among them, when the mobile phone responds to the start of the user's interaction operation, it triggers the simpleperf collection service to collect simpleperf logs; when the mobile phone responds to the end of the interaction operation, the simpleperf collection service stops collecting simpleperf logs. Thus, the mobile phone can obtain the simpleperf logs corresponding to the entire process of the interaction operation.

[0092] Step S402, when the mobile phone completes the response to the interaction operation, obtain the detection information for the process of the mobile phone's response to the interaction operation.

[0093] When the mobile phone receives the interaction operation, the interaction scenario recognition service in the mobile phone will receive the start signal for the interaction operation and generate the scenario start information for the scenario where the interaction operation is located.

[0094] The mobile phone is also configured with a performance fault detection service, and the interaction scenario recognition service will trigger the performance fault detection service to start working based on the scenario start information.

[0095] When the mobile phone completes the response to the interaction operation, then the interaction scenario recognition service in the mobile phone will receive the end signal for the interaction operation and generate the scenario end information for the scenario where the interaction operation is located. The interaction scenario recognition service will trigger the performance fault detection service to obtain the detection information corresponding to the process of the mobile phone's response to the interaction operation based on the scenario end information.

[0096] Among them, the interaction scenario recognition service can record the start and end times of the interaction operation through logs and generate the execution event corresponding to the interaction operation, also known as the interaction scenario information.

[0097] Step S403, when the detection information indicates that there is an interaction anomaly in the process of the mobile phone's response to the interaction operation, the mobile phone generates an analysis file for the process.

[0098] Among them, the analysis file includes the detection information and the simpleperf logs. Here, the detection information can also be called the performance fault information, and it can be known from the performance fault information what interaction anomalies occurred in the process of the mobile phone's response to the interaction operation.

[0099] Step S404: The mobile phone uploads the analyzed file to the cloud server.

[0100] After the mobile phone uploads the analysis file to the cloud server, R&D personnel can remotely obtain the analysis file through the cloud server and then analyze the performance issues of the mobile phone.

[0101] In some examples, the mobile phone can also obtain interaction scene information, and upload the interaction scene information together with the analysis file to the cloud server.

[0102] The data acquisition method provided in the embodiment of the present application can collect the simpleperf log corresponding to the process of the mobile phone responding to the user's interactive operation by the mobile phone, and when there is an abnormal interaction in the process, the mobile phone can generate an analysis file by obtaining the above process information and the detection information corresponding to the process, and upload the analysis file to the cloud server, so that the R&D personnel can obtain the analysis file through the cloud server to remotely analyze the performance problems of the mobile phone. Among them, the mobile phone does not need to rely on other devices to obtain the analysis file, and the mobile phone can automatically collect and generate the analysis file.

[0103] See also Figure 5 , Figure 5 The overall flow chart of a data acquisition method provided in an embodiment of the present application is as follows. Figure 5 As shown, after receiving an interactive operation from a user, the electronic device may generate a start signal for the interactive operation at the application layer or the application framework layer.

[0104] For example, for some system applications that come with electronic devices, since the startup animation of the system application is triggered by the application on the electronic device desktop, the frame loss event of the startup animation of such application can generate a start signal for the interactive operation at the application layer.

[0105] For another example, if it is a third-party application, since the electronic device does not have code permissions for the third-party application, a start signal for the interactive operation can be generated at the application framework layer for a sliding frame loss event of such third-party application.

[0106] In some examples, after receiving an interactive operation from a user, the application layer of the electronic device may transmit information regarding the interactive operation to the application framework layer, and the application framework layer may generate a start signal for the interactive operation.

[0107] Among them, the electronic device can cover the main user interaction operations by adding a small number of stakes in the application layer or application framework layer, and after receiving the user's interaction operation, it can send a start signal or an end signal for the interaction operation to the interaction scene collection service.

[0108] After receiving the start signal for an interaction operation, the interaction scenario recognition service of the electronic device samples the interaction scenario corresponding to the interaction operation based on the start signal, and triggers the simpleperf collection service to capture simpleperf logs.

[0109] Among them, the interaction scenario recognition service can sample the interaction scenario, which can reduce the frequency of the electronic device triggering the simpleperf collection service to capture simpleperf logs. Since the electronic device does not perform frequent collections, the power consumption of the electronic device can be reduced.

[0110] In some examples, the electronic device can also limit the number of collections. For example, the electronic device sets the maximum number of collections corresponding to one day to a preset number of times (for example, 8 times). By setting the value of the number of collections, the electronic device will not continuously capture simpleperf logs, thereby reducing the power consumption of the electronic device.

[0111] In addition, after receiving the start signal for an interaction operation, the interaction scenario recognition service triggers the performance fault detection service to work based on the start signal.

[0112] When the user's interaction operation ends, the application layer or the application framework layer of the electronic device can generate an end signal for the interaction operation.

[0113] In some examples, after the application layer of the electronic device responds to the end of the user's interaction operation, it can transmit the information about the interaction operation to the application framework layer, and the application framework layer generates an end signal for the interaction operation.

[0114] After receiving the end signal for an interaction operation, the interaction scenario recognition service triggers the simpleperf collection service to end capturing simpleperf logs based on the end signal. Thus, the electronic device can obtain the simpleperf logs corresponding to the process of the interaction operation.

[0115] In addition, after receiving the end signal for an interaction operation, the interaction scenario recognition service triggers the performance fault detection service to obtain the detection information for the process of the electronic device's response to the interaction operation based on the system's log information. When the detection information indicates that there is an interaction anomaly in the above process, the performance fault detection service sends the corresponding detection information to the log packaging and uploading service. At this time, the simpleperf collection service also sends the simpleperf logs to the log packaging and uploading service.

[0116] Then, the log packaging and uploading service packages the simpleperf logs and the detection information together and uploads them to the cloud server.

[0117] Among them, the interaction anomaly of the above-mentioned electronic device can also be referred to as the performance failure of the electronic device, and the detection information for the process of the interaction operation can include the performance failure information for the process of the interaction operation.

[0118] The electronic device can also obtain the execution event for the process of the interaction operation. The above-mentioned process for the interaction operation can also be referred to as an interaction scenario, and the above-mentioned execution event can then be referred to as interaction scenario information.

[0119] The electronic device generates interaction scenario information through the interaction scenario recognition service, uploads it to the performance failure detection service, and then uploads it to the log packaging and uploading service through the performance failure detection service. The log packaging and uploading service packages the interaction scenario information, performance failure information, and simpleperf logs together and uploads them to the cloud server.

[0120] In summary, for the data acquisition method provided in the embodiments of the present application, the electronic device can collect process information during the process of responding to the user's interaction operation, and in the case of an interaction anomaly in this process, the electronic device can generate an analysis file by obtaining the above process information and the detection information corresponding to this process, for R & D personnel to analyze the performance problems of the electronic device. The electronic device does not need to rely on other devices to obtain the analysis file, and the electronic device can automatically collect and generate the analysis file.

[0121] In some solutions, the user can use the android debug bridge (ADB) tool of the PC device to connect to the electronic device and control the start and end of the simpleperf log using a command-line program. The collection of simpleperf is provided in the form of a binary executable file. Before each start of the collection, it is necessary to load files, start processes, etc., and the response is slow. It is very likely to miss the fault occurrence site, resulting in the inability to analyze the captured simpleperf log. However, for the data acquisition method provided in the embodiments of the present application, a simpleperf collection service is provided by a service resident in the background, which can quickly and real-time respond to the collection requests of each module, making the time point of the collected log more accurate, and being able to accurately obtain the process information and detection information during the process of the electronic device responding to the user's interaction operation.

[0122] Please refer to Figure 6 , Figure 6 which is the running timing diagram of a data acquisition method provided in the embodiments of the present application. This data acquisition method can be applied to an electronic device. As Figure 6As shown, taking the electronic device as a mobile phone as an example, the application layer or application framework layer of the mobile phone receives the user's interaction operation on the mobile phone (refer to step 1). In response to the received user interaction operation on the mobile phone, the application layer or application framework layer generates a start signal for this interaction operation, also known as a scenario start signal. The application layer or application framework layer sends the scenario start signal to the interaction scenario recognition service of the electronic device (refer to step 2). In response to this scenario start signal, the interaction scenario recognition service triggers the simpleperf collection service to start collecting simpleperf logs (refer to step 3). During the interaction operation, the simpleperf collection service continuously collects simpleperf logs.

[0123] In response to the scenario start signal, the interaction scenario recognition service can record the moment when the interaction operation starts through logging and generate scenario start information. Based on this scenario start information, the interaction scenario recognition service triggers the performance fault detection service to start working (refer to step 4). The performance fault detection service can detect whether there is an interaction anomaly during the process when the electronic device completes the response to the interaction operation. Among them, steps 3 and 4 can be carried out simultaneously.

[0124] At this time, when the electronic device completes the response to the interaction operation, the application layer or application framework layer generates an end signal for this interaction operation, also known as a scenario end signal. The application layer or application framework layer sends the scenario end signal to the interaction scenario recognition service (refer to step 5). In response to this scenario end signal, the interaction scenario recognition service triggers the simpleperf collection service to end the collection of simpleperf logs (refer to step 6).

[0125] In response to the scenario end signal, the interaction scenario recognition service can record the moment when the interaction operation ends through logging and generate scenario end information. Based on this scenario end information, the interaction scenario recognition service triggers the performance fault detection service to judge whether there is an interaction anomaly during the process based on the obtained detection information (refer to step 7). In the case where the detection information indicates that there is an interaction anomaly during the process, the performance fault detection service uploads the detection information (also known as performance fault information) to the log packaging and uploading service of the electronic device (refer to step 8). Among them, steps 6 and 7 can be carried out simultaneously.

[0126] In addition, the simpleperf collection service also uploads the obtained simpleperf logs to the log packaging and uploading service (refer to step 9). Among them, steps 8 and 9 can be carried out simultaneously.

[0127] Then, the log packaging and uploading service packages the simpleperf logs together with the detection information (refer to Step 10) and uploads them to the cloud server (refer to Step 11). The packaging method here can be the packaging method in conventional technologies and will not be elaborated here.

[0128] Thus, the above data acquisition method can integrate functions such as interactive scenario recognition, performance fault detection, simpleperf log capture, log packaging and uploading, etc., and can accurately capture the simpleperf logs during the interactive anomalies of the electronic device and directly reach the hands of performance analysis R & D personnel.

[0129] In some solutions, the software development kit (SDK) of simpleperf provides a simpleperf collection interface that can be called by application programs. The system application program can call the start and end interfaces of simpleperf collection in the code by integrating the simpleperf SDK. Among them, the simpleperf SDK runs in the application space and can only trigger collection when a failure occurs inside the application, and it is difficult to perceive system problems, which has certain limitations. However, the data acquisition method provided by the embodiments of the present application can monitor various interactive scenarios and interactive anomalies occurring in each module at the system level and accurately collect the simpleperf logs during the occurrence of interactive anomalies. Moreover, the above simpleperf collection service can be provided by a service resident in the background, which can respond to the log collection requests of each module more quickly and in real time, making the time point of the collected logs more accurate.

[0130] In some examples, the embodiments of the present application also provide a data acquisition method applied to a cloud server. The data acquisition method includes the cloud server receiving an analysis file uploaded by an electronic device. The analysis file includes process information and detection information, which are used for R & D personnel to locate the performance problems of the electronic device. The above process information includes the call stack information corresponding to the process of the electronic device in response to the user's interactive operation. The detection information is for the process of the electronic device in response to the interactive operation and is used to indicate that there are interactive anomalies in the process.

[0131] As Figure 7 shown, the cloud server 701 can receive the analysis file uploaded by the mobile phone 702, and then R & D personnel can remotely analyze the performance problems of the mobile phone based on the analysis file in the cloud server.

[0132] In some examples, the electronic device can also obtain the execution event for the interactive operation, and then upload the analysis file and the execution event to the cloud server together. The cloud server receives the analysis file and the execution event uploaded by the electronic device, which are used for R & D personnel to locate the performance problems of the electronic device.

[0133] In summary, for the data acquisition method provided in the embodiments of the present application, the cloud server can receive the analysis file uploaded by the electronic device for the process of the electronic device in response to the interaction operation. Thus, the R & D personnel can remotely analyze the performance problems of the electronic device through the analysis file in the cloud server.

[0134] The execution subject of the data acquisition method provided in the embodiments of the present application can be a data acquisition device, and this execution device can be Figure 8 the electronic device shown as follows. At the same time, this execution device can also be the central processing unit (CPU) of the electronic device, or the control module for data acquisition in the electronic device. In the embodiments of the present application, taking the electronic device as the execution subject of the data acquisition method as an example, the data acquisition method provided in the embodiments of the present application is described.

[0135] The following will describe the implementation manners of the embodiments of the present application in detail with reference to the accompanying drawings. Figure 8 FIG. 100 schematically shows a structural diagram of an electronic device 100. The electronic device 100 can include at least one of devices such as a mobile phone, a foldable electronic device, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device, or a smart city device, etc. The embodiments of the present application do not impose special restrictions on the specific type of the electronic device 100.

[0136] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) connector 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker, a receiver, a microphone, a headphone interface, a sensor module 180, a button 190, a camera 191, a display screen 192, a motor, an indicator, and a subscriber identification module (SIM) card interface, etc. The sensor module 180 may include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0137] It can be understood that the structure illustrated in the embodiments of this application does not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0138] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0139] The processor may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.

[0140] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 may be a cache memory. This memory may store instructions or data that have been used by the processor 110 or are used frequently. If the processor 110 needs to use such instructions or data, it can directly call them from this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0141] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc. The processor 110 may be connected to modules such as a touch sensor, an audio module, a wireless communication module, a display, a camera, etc. through at least one of the above interfaces.

[0142] It can be understood that the interface connection relationships between the modules illustrated in the embodiments of the present application are only illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0143] The wireless communication function of the electronic device 100 may be implemented through antenna 1, antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.

[0144] Antenna 1 and antenna 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: Antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0145] The mobile communication module 150 may provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 may receive electromagnetic waves through the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves through the antenna 1 and radiate it out. In some embodiments, at least some functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be disposed in the same device.

[0146] The wireless communication module 160 may provide solutions for wireless communications including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), Bluetooth low energy (BLE), ultra wide band (UWB), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc., applied to the electronic device 100. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves through the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive the signal to be transmitted from the processor 110, perform frequency modulation and amplification on it, and convert it into electromagnetic waves through the antenna 2 and radiate it out.

[0147] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other electronic devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).

[0148] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to implement the storage capacity expansion of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card, or files such as music and videos are transferred from the electronic device to the external memory card.

[0149] The internal memory 121 can be used to store computer-executable program codes, and the executable program codes include instructions. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.). In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional methods or data processing of the electronic device 100 by running the instructions stored in the internal memory 121 and / or the instructions stored in the memory provided in the processor.

[0150] The display screen 192 is used to display images, videos, etc. The display screen 192 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 can include one or more display screens 192.

[0151] In the embodiments of the present application, the display screen 192 of the electronic device 100 can display the icons of various applications, display the startup animation effects of the applications, etc., or the display screen 192 can display the process of page sliding, etc.

[0152] The data acquisition methods in the foregoing embodiments can all be implemented in the electronic device 100 having the above-mentioned hardware structure and software structure.

[0153] The embodiments of the present application further provide a chip system, such as Figure 9As shown, the chip system 1500 includes at least one processor 1501 and at least one interface circuit 1502. The processor 1501 and the interface circuit 1502 can be interconnected by lines. For example, the interface circuit 1502 can be used to receive signals from other devices (such as the memory of a computer). Also for example, the interface circuit 1502 can be used to send signals to other devices (such as the processor 1501). Exemplarily, the interface circuit 1502 can read the instructions stored in the memory and send the instructions to the processor 1501. When the instructions are executed by the processor 1501, the computer can execute each step in the above embodiments. Of course, the chip system can also include other discrete devices, and the embodiments of the present application do not make specific limitations thereto.

[0154] The embodiments of the present application also provide a computer-readable storage medium, which includes computer instructions. When the computer instructions run on the above-mentioned electronic device (such as a mobile phone), the electronic device is enabled to execute each function or step that the mobile phone executes in the above method embodiments.

[0155] The embodiments of the present application also provide a computer program product. When the computer program product runs on a computer, the computer is enabled to execute each function or step that the mobile phone executes in the above method embodiments. Among them, the computer can be an electronic device, such as a mobile phone.

[0156] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0157] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical functional division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.

[0158] The unit described as a separating component may or may not be physically separated. The component shown as a unit may be a single physical unit or multiple physical units, that is, it may be located in one place or distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0159] In addition, each functional unit in various embodiments of the present application may be integrated in a processing unit, may exist separately as individual physical units, or two or more units may be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0160] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods of the various embodiments of the present application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs and other various media that can store program codes.

[0161] The above content is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A data acquisition method, characterized in that, Applied to an electronic device, the electronic device is configured with an application layer, an application framework layer, and a system library. The system library is configured with a collection service, an interaction scenario recognition service, a performance fault detection service, and a log packaging and uploading service. The method includes: When the application layer or the application framework layer responds to a user's interaction operation, the application layer or the application framework layer sends a start signal of the interaction operation to the interaction scenario recognition service; After the interaction scenario recognition service receives the start signal, the collection service collects the process information of the application layer or the application framework layer in response to the interaction operation; wherein, the process information includes the call stack information corresponding to the application layer or the application framework layer during the process of responding to the interaction operation; When the application layer or the application framework layer finishes responding to the interaction operation, the application layer or the application framework layer sends an end signal of the interaction operation to the interaction scenario recognition service; After the interaction scenario recognition service receives the end signal, the performance fault detection service obtains the detection information for the process; wherein, the detection information is an indication result of whether there is an interaction anomaly in the process determined by the application layer or the application framework layer based on the process information, or the detection information includes the information corresponding to each event in the process; When the detection information indicates that there is an interaction anomaly in the process, the interaction scenario recognition service generates an execution event and sends the execution event to the performance fault detection service, and the execution event is interaction scenario information; The performance fault detection service sends the execution event to the log packaging and uploading service; The log packaging and uploading service uploads the analysis file and the execution event to the cloud server, and the analysis file includes the process information and the detection information.

2. The method according to claim 1, characterized in that, The step that after the interaction scenario recognition service receives the end signal, the performance fault detection service obtains the detection information for the process includes: After the interaction scenario recognition service receives the end signal, the performance fault detection service obtains the log information of the application layer or the application framework layer in response to the interaction operation; The performance fault detection service obtains the detection information for the process based on the log information.

3. The method according to claim 1, characterized in that, The process information includes at least one of system trace information, system log information, and simple performance information.

4. The method according to any one of claims 1-3, characterized in that, The interaction anomaly includes at least one of the electronic device being unable to respond to user operations, the electronic device having a frame drop event, and the startup delay of the electronic device exceeding a preset delay threshold.

5. An electronic device, characterized in that, The electronic device includes: a communication module, a memory, and one or more processors; the communication module, the memory, and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions. When the computer instructions are executed by the electronic device, the electronic device is caused to execute the method according to any one of claims 1-4.

6. A computer-readable storage medium, characterized in that, Instructions are stored in the computer-readable storage medium. When the instructions run on an electronic device, the electronic device is caused to execute the method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Log uploading method and device, electronic equipment and computer readable storage medium

    CN114077529A