Message processing method and related device
By triggering a crash exception when the AP detects ADSP communication timeout, the temporary cache information of ADSP is stored in the shared memory, which solves the problem that ADSP exceptions cannot be analyzed, and achieves effective positioning of ADSP exception issues and guarantees user experience.
Patent Information
- Application Number
- CN202310942746.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2043-07-28
AI Technical Summary
In electronic equipment, when an abnormality occurs in the digital signal processor (ADSP), developers cannot effectively locate and analyze the problem because the ADSP fails to store the information in the temporary cache into the shared memory, resulting in the inability to generate the necessary memory dump file. for analysis.
By triggering ADSP's crash exception when the AP detects that the communication with ADSP has timed out, the information in the temporary cache is stored in the AP's shared memory, and a ramdump of ADSP is generated, thereby allowing developers to locate and analyze abnormal problems.
It implements the collection and analysis of memory information in ADSP abnormal situations, ensuring the normal user experience in audio scenarios, and provides more detailed memory information to facilitate problem location and resolution.
Smart Images

Figure CN117714271B
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a message processing method and related devices. Background Art
[0002] In audio-related scenarios such as making calls, playing music, and recording voice, the AP in the electronic device can communicate with the audio digital signal processor (ADSP).
[0003] In one implementation, when an ADSP crashes, the AP can generate a ramdump of the ADSP. The developer can then use the ramdump to locate and analyze the abnormal problem that occurred on the ADSP.
[0004] However, in some scenarios, when an ADSP exception occurs, developers are unable to locate and analyze the exception problem that occurred in ADSP. Summary of the invention
[0005] The message processing method and related device provided by the embodiment of the present application can trigger a crash exception of the ADSP subsystem when the AP of the electronic device detects a communication timeout with the ADSP subsystem. In this way, the ADSP subsystem can store the information in the temporary cache to the shared memory of the AP, and the AP can generate a ramdump of the ADSP subsystem based on the information in the shared memory. The developer can then use the ramdump to locate and analyze the abnormal problems that occurred in the ADSP subsystem.
[0006] In a first aspect, the message processing method provided by the embodiment of the present application includes:
[0007] At the first moment, AP transmits the first message to ADSP, and the first message requires a reply from ADSP; at the second moment, AP receives a reply from ADSP, and the second moment is later than the first moment; at the third moment, AP transmits the second message to ADSP, and the second message requires a reply from ADSP, and the third moment is later than the second moment; at the fourth moment, AP does not receive a reply from ADSP, and AP transmits the third message to ADSP, and the third message is used to instruct ADSP to store the memory information of ADSP in the memory of AP, and the fourth moment is later than the third moment, and the time from the third moment to the fourth moment exceeds the preset time period; at the fifth moment, AP obtains the first log, and the first log includes the memory information of ADSP, and the fifth moment is later than the fourth moment. In this way, the ADSP subsystem can store the information in the temporary cache in the shared memory of AP, and AP can generate a ramdump of the ADSP subsystem based on the information in the shared memory.
[0008] In a possible implementation, after the AP transmits the third message to the ADSP, between the fourth moment and the fifth moment, the process further includes: the ADSP stores the memory information of the ADSP in the memory of the AP; the ADSP transmits the fourth message to the AP, and the fourth message is used to instruct the AP to obtain the first log based on the memory information of the ADSP. In this way, the ADSP stores the information in the temporary cache in the shared memory of the AP, and the AP can generate a log based on the information in the shared memory, thereby realizing the location analysis of the abnormal problem occurring in the ADSP.
[0009] In a possible implementation, the ADSP transmits the fourth message to the AP, including: the ADSP triggers an interrupt to the AP. In this way, the AP can collect the memory information of the ADSP according to the interrupt message, and then analyze and locate the abnormal problem occurred in the ADSP.
[0010] In a possible implementation, the third message includes: a SEND_SSR_COMMAND message, and after the AP transmits the third message to the ADSP, it also includes: restarting the ADSP. In this way, restarting the ADSP can restore the abnormality of the ADSP, so that the ADSP can operate normally, ensuring the normal experience of the user in the audio scenario.
[0011] In a possible implementation, the AP transmits the third message to the ADSP, including: when the AP determines that the electronic device is a user test version, the AP transmits the third message to the ADSP. In this way, when the electronic device is a user test version, the AP can collect the memory message of the ADSP, so as to better analyze and solve the abnormality of the ADSP subsystem.
[0012] In a possible implementation, when the AP determines that the electronic device is a user test version, the AP transmits a third message to the ADSP, including: when the AP determines that the electronic device is a user test version, and the AP determines that the thread running in the electronic device cannot match the preset field, the AP transmits the third message to the ADSP; the preset field is related to one or more of the following: thread name, reason for triggering the ADSP restart. In this way, if the electronic device does not match the keyword, it means that there is no need to trigger the panic of the entire machine, then the AP can transmit the third message to the ADSP, triggering the crash exception of the ADSP subsystem, and then generating a ramdump of the ADSP subsystem.
[0013] In a possible implementation, at the sixth moment, the AP transmits the fifth message to the ADSP, and the fifth message requires a reply from the ADSP; at the seventh moment, the AP does not receive a reply from the ADSP, and the AP transmits the third message to the ADSP, the seventh moment is later than the sixth moment, and the sixth moment to the seventh moment exceeds the preset time period; when the AP determines that the electronic device is a user test version, and the AP determines that the thread running in the electronic device can match the preset field, the AP obtains the second log, the content of the second log is more than the first log, and the second log includes the memory information of the ADSP. In this way, if the electronic device matches the keyword, it means that there is a need to trigger the panic of the whole machine, then the AP can print the full dump of the whole machine, so that the developer can obtain more memory information based on the full dump of the whole machine, which is more helpful for analyzing abnormal problems.
[0014] In a possible implementation, the second log includes a memory dump file fulldump of the electronic device. In this way, the developer can obtain more memory information based on the fulldump of the entire device, which is more helpful for analyzing abnormal problems.
[0015] In a possible implementation, the first log includes a memory dump file ramdump of the ADSP, and the format of the first log includes an ELF format. In this way, the developer can locate and analyze the abnormal problems that occur in the ADSP subsystem through the ramdump.
[0016] In a possible implementation, before the AP transmits the third message to the ADSP, it also includes: if the electronic device is connected to the Internet, the AP sends the reason for the ADSP restart to the cloud server; if the electronic device is not connected to the Internet, the AP saves the reason for triggering the ADSP restart locally in the electronic device, and after the electronic device is connected to the Internet, the AP sends the reason for the ADSP restart to the cloud server. In this way, by reporting the reason for triggering the ADSP SSR to the cloud server, developers can perform big data analysis and locate abnormal problems.
[0017] In a possible implementation, the hardware abstraction layer of the AP includes an audio module, the kernel layer of the AP includes an audio driver, and before the AP transmits the third message to the ADSP, it includes: the audio module determines that no reply from the ADSP is received within a preset time period; the audio module transmits a sixth message to the audio driver, the sixth message is used to instruct the audio driver to execute the process of restarting the ADSP; the audio driver determines that the electronic device is a user test version; the audio driver determines that the preset field is not matched; the audio driver sends the reason for the ADSP restart to the cloud server; the AP transmits the third message to the ADSP, including: the audio driver transmits the third message to the ADSP; the AP obtains the first log, including: the audio driver obtains the first log based on the memory information of the ADSP. In this way, when the audio module detects that the communication with the ADSP subsystem has timed out, the crash exception of the ADSP subsystem can be triggered, and then the audio driver can execute the relevant process of restarting the ADSP.
[0018] In a second aspect, an embodiment of the present application provides a message processing device, which may be an electronic device, or a chip or chip system in an electronic device. The device may include a processing unit. The processing unit is used to implement any method related to processing performed by the electronic device in the first aspect or any possible implementation of the first aspect. When the device is an electronic device, the processing unit may be a processor. The device may also include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit so that the electronic device implements the method described in the first aspect or any possible implementation of the first aspect. When the device is a chip or chip system in an electronic device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit so that the electronic device implements the method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit in the chip (for example, a register, a cache, etc.), or a storage unit in the electronic device located outside the chip (for example, a read-only memory, a random access memory, etc.).
[0019] Exemplarily, the processing unit is used to transmit a first message to the ADSP, to receive a reply from the ADSP, to transmit a second message to the ADSP, to transmit a third message to the ADSP, and specifically to obtain a first log.
[0020] In a possible implementation, the processing unit is used to store the memory information of the ADSP into the memory of the AP, and is also used to transmit the fourth message to the AP.
[0021] In a possible implementation, the processing unit is configured to trigger an interrupt to the AP.
[0022] In a possible implementation, the processing unit is used for ADSP restart.
[0023] In a possible implementation, the processing unit is configured to transmit a third message to the ADSP when determining that the electronic device is a user test version.
[0024] In a possible implementation, the processing unit is configured to transmit a third message to the ADSP when determining that the electronic device is a user test version and that a thread running in the electronic device cannot match a preset field.
[0025] In one possible implementation, the processing unit is used to transmit the fifth message to the ADSP, and is also used to transmit the third message to the ADSP. Specifically, it is also used to determine that the electronic device is a user test version, and when it is determined that the thread running in the electronic device can match the preset field, obtain the second log.
[0026] In a possible implementation, the second log includes a memory dump file fulldump of the electronic device.
[0027] In a possible implementation, the first log includes a memory dump file ramdump of the ADSP, and the format of the first log includes an ELF format.
[0028] In one possible implementation, the processing unit is used to send the reason for the ADSP restart to the cloud server, and is also used to save the reason for triggering the ADSP restart locally on the electronic device.
[0029] In one possible implementation, the processing unit is used to determine that no reply is received from the ADSP within a preset time period, to transmit a sixth message to the audio driver, to determine that the electronic device is a user test version, to determine that no preset field is matched, to send the reason for the ADSP restart to the cloud server, to transmit a third message to the ADSP, and specifically to obtain the first log.
[0030] In a third aspect, an embodiment of the present application provides a terminal device, including a processor and a memory, the memory being used to store code instructions, and the processor being used to run the code instructions to execute the method described in the first aspect or any possible implementation of the first aspect.
[0031] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instructions are stored. When the computer program or instructions are run on a computer, the computer executes the method described in the first aspect or any possible implementation of the first aspect.
[0032] In a fifth aspect, an embodiment of the present application provides a computer program product including a computer program. When the computer program runs on a computer, the computer executes the method described in the first aspect or any possible implementation manner of the first aspect.
[0033] In a sixth aspect, the present application provides a chip or a chip system, the chip or chip system comprising at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, and the at least one processor is used to run a computer program or instruction to execute the method described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, a pin or a circuit, etc.
[0034] In a possible implementation, the chip or chip system described above in the present application further includes at least one memory, in which instructions are stored. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).
[0035] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0037] Figure 2 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0038] Figure 3 An overall flow chart of a message processing method provided in an embodiment of the present application;
[0039] Figure 4 A timing diagram for generating a ramdump of an ADSP subsystem provided in an embodiment of the present application;
[0040] Figure 5 A timing diagram for generating a full dump of the entire machine provided in an embodiment of the present application;
[0041] Figure 6 A schematic diagram of a message processing method provided in an embodiment of the present application;
[0042] Figure 7 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0044] 1. Ramdump: It can be called a memory dump file. Ramdump refers to the electronic device dumping the system's memory information into a file when a system or subsystem crashes or other abnormalities occur. It is understandable that since ramdump can include thread stack information, log information, etc., developers can analyze system abnormalities based on the ramdump file.
[0045] 2. Terminology
[0046] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0047] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0048] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.
[0049] 3. Electronic equipment
[0050] The electronic device of the embodiment of the present application may also be a terminal device in any form. For example, the electronic device may include: a mobile phone, a tablet computer, a PDA, a laptop computer, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, an electronic device in a 5G network or a public land mobile communication network (public land mobile communication network) to be evolved in the future. Mobile network, PLMN) and the like, the embodiments of the present application are not limited to this.
[0051] As an example but not limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and fully or partially independent of smartphones, such as smart watches or smart glasses, as well as devices that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.
[0052] In addition, in the embodiments of the present application, the electronic device may also be an electronic device in an Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network that interconnects people and machines and things.
[0053] The electronic devices in the embodiments of the present application may also be referred to as: user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
[0054] In an embodiment of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system, or Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0055] For example, Figure 1 A schematic structural diagram of an electronic device is shown.
[0056] The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 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 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0057] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0058] 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 processor (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. Different processing units may be independent devices or integrated into one or more processors.
[0059] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0060] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0061] In some embodiments, the processor 110 may include one or more interfaces. The interface 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 SIM card interface, and / or a USB interface, etc.
[0062] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0063] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.
[0064] The electronic device can implement audio functions, such as audio playback or recording, through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0065] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The speaker 170A, also known as a "speaker", is used to convert audio electrical signals into sound signals. The electronic device may include 1 or N speakers 170A, where N is a positive integer greater than 1. The electronic device can listen to music, videos, or listen to hands-free calls through the speaker 170A. The receiver 170B, also known as a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device answers a call or voice message, the voice can be answered by placing the receiver 170B close to the human ear. The microphone 170C, also known as a "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.
[0066] Figure 2 It is a software structure block diagram of the AP of the electronic device of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, the hardware abstraction layer (hardware adaptation layer, HAL), and the kernel layer.
[0067] The application layer can include a series of application packages. Figure 2 As shown, the application package may include applications such as phone, music, video, calendar, camera, game, memo, etc. Applications may include system applications and third-party applications.
[0068] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0069] like Figure 2 As shown, the application framework layer may include a window manager, a resource manager, and a content provider, etc.
[0070] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, touch the screen, drag the screen, capture the screen, etc.
[0071] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0072] Content providers are used to implement data sharing between different applications, allowing one program to access data in another program while ensuring the security of the accessed data.
[0073] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0074] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0075] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection. For example, in the embodiment of the present application, the virtual machine can be used to perform functions such as instruction timeout detection, electronic device version detection, keyword matching, and collecting ADSP ramdump.
[0076] The system library can also be called the Native layer, which can include multiple functional modules, such as media libraries and function libraries.
[0077] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0078] The function library provides developers with API interfaces for multiple services, making it easy for developers to quickly integrate and implement various functions.
[0079] The hardware abstraction layer is an abstract structure between the kernel layer and the Android runtime. The hardware abstraction layer can be a package of the hardware driver, providing a unified interface for the upper-layer application to call. The hardware abstraction layer can include an audio module. The audio module can be used for instruction timeout detection and can also be used to trigger ADSP restart, etc.
[0080] The kernel layer is the layer between hardware and software. The kernel layer may include audio driver, display driver, camera driver, battery driver, Bluetooth driver, CPU driver, USB driver, etc. It is understood that the kernel layer of the AP can communicate with the ADSP.
[0081] It should be noted that the embodiments of the present application are only illustrated using the Android system as an example. In other operating systems (such as Windows system, IOS system, etc.), as long as the functions implemented by each functional module are similar to those in the embodiments of the present application, the solutions of the present application can also be implemented.
[0082] In audio-related scenarios such as making calls, playing music, and recording voice, the audio module in the AP of the electronic device can communicate with the ADSP, which can establish corresponding algorithm paths for each audio scenario to achieve related audio functions. Among them, the ADSP can also be called the ADSP subsystem.
[0083] In one implementation, the ADSP subsystem can save memory information in a temporary cache of the ADSP subsystem during operation, and the temporary cache can also be called an intermediate cache. When the ADSP subsystem crashes or other abnormalities occur, the ADSP subsystem can store the information in the temporary cache in the shared memory of the AP, and the AP can generate a ramdump of the ADSP subsystem based on the information in the shared memory. Furthermore, developers can obtain the memory information of the ADSP subsystem through the ramdump and locate and analyze abnormal problems that occur in the ADSP subsystem.
[0084] However, in some scenarios, when an exception occurs in the ADSP subsystem, the ADSP subsystem will not store the information in the temporary cache to the AP's shared memory because these exceptions are not enough to cause the ADSP subsystem to crash; or, when an exception occurs in the ADSP subsystem, the ADSP subsystem has been restarted before it has time to crash, and at this time, the ADSP subsystem has not stored the information in the temporary cache to the AP's shared memory. In this way, the AP cannot generate a ramdump of the ADSP subsystem based on the information in the shared memory, making it impossible for developers to determine the exceptions that occurred in the ADSP subsystem, and thus unable to locate and analyze the exceptions that occurred in the ADSP subsystem.
[0085] In view of this, the message processing method provided in the embodiment of the present application can trigger a crash exception of the ADSP subsystem when the AP of the electronic device detects a communication timeout with the ADSP subsystem. In this way, the ADSP subsystem can store the information in the temporary cache to the shared memory of the AP, and the AP can generate a ramdump of the ADSP subsystem based on the information in the shared memory. Then, the developer can locate and analyze the abnormal problem of the ADSP subsystem through the ramdump.
[0086] Figure 3 The overall flow chart of the message processing method of the embodiment of the present application is shown.
[0087] S301. The instruction sent to the ADSP subsystem times out.
[0088] When the audio module of the hardware abstraction layer on the AP side detects that the instruction sent to the ADSP subsystem has timed out, that is, when the audio module has not received a response from the ADSP subsystem for a long time, the audio module can send an instruction to trigger a restart of the ADSP subsystem (sub-system restart, ssr) to the audio driver of the kernel layer on the AP side.
[0089] Among them, the command timeout time can be pre-set by the audio module, and the time range of the command timeout can include 0.5s-2s. For example, the command timeout time can be set to 1 second. The embodiment of the present application does not limit the specific command timeout time.
[0090] In a possible implementation, the audio module may send the ADSP SSR instruction to the audio driver by writing a node. Exemplarily, the audio module may write the node of the ADSP SSR as 1, where 1 may indicate triggering the ADSP SSR. It is understandable that the instruction of the ADSP SSR may also be represented by other strings or other data types, which is not limited in the embodiments of the present application.
[0091] After the audio driver obtains the instruction to trigger the ADSP ssr, step S302 may be executed.
[0092] S302: Is it a user test version?
[0093] After the audio driver obtains the instruction to trigger the ADSP SSR, different processes can be executed on different versions of the electronic device. The versions of the electronic device can include the use version and the user test version. The use version can be understood as the version used by the user after the version is released, and the use version can also be called the commercial version. The user test version can be understood as the version used for testing before the version is released, and the user test version can also be called the beta user version.
[0094] In possible implementations, for the user version, in order to better protect user privacy information and improve user experience, the audio driver may not obtain the ramdump of the ADSP subsystem, but only trigger the ADSP subsystem restart. For the user test version, in order to better analyze and solve the exceptions that occur in the ADSP subsystem, the audio driver can obtain the ramdump of the ADSP subsystem and trigger the ADSP subsystem restart.
[0095] Among them, the audio driver can determine whether the current version is a user test version based on the version identifier of the electronic device. The data type of the version identifier can be an integer, a string, or the like. Exemplarily, the version identifier can be an integer, for example, 1 can represent the use version, and 2 can represent the user test version; or, 1 can represent the user test version, and 2 can represent the use version; or, the use version and the user test version can also take other values, which are not limited in the embodiments of the present application.
[0096] If the audio driver determines that the current version is the use version, the audio driver can restart the ADSP subsystem after obtaining the instruction to trigger the ADSP ssr. If the audio driver determines that the current version is the user test version, the audio driver can execute step S303 after obtaining the instruction to trigger the ADSP ssr.
[0097] S303: Whether the keyword is matched.
[0098] In some scenarios, the ramdump of the ADSP subsystem is not enough to analyze the abnormal problem. At this time, based on the needs of the chip platform or the needs of development positioning, the electronic device panic can be triggered by the audio driver. The electronic device panic can also be called the whole machine panic. Among them, panic can be understood as a system error in the electronic device, which may cause the program to crash or the operating system to stop responding.
[0099] It is understandable that triggering a panic of the entire machine may include saving the memory information of the entire machine, wherein the memory information of the entire machine may also be referred to as the fulldump of the entire machine. Compared with the ramdump of the ADSP subsystem, the fulldump of the entire machine contains more information, for example, the fulldump of the entire machine may include the memory information of the AP and the memory information of all subsystems. In this way, developers can obtain more memory information based on the fulldump of the entire machine, which is more helpful for analyzing abnormal problems.
[0100] In a possible implementation, the electronic device may pre-set some keywords to indicate the triggering of the whole machine panic based on the requirements of the chip platform or the requirements of the developer to locate the problem, etc. For example, the keyword may include the thread name, or the reason for triggering the ramdump of the ADSP subsystem, etc.
[0101] When the audio driver matches these keywords, it means that there is a need to trigger a panic of the entire machine, and step S307 can be executed; when the audio driver does not match these keywords, it means that there is no need to trigger a panic of the entire machine, and step S304 can be executed to trigger a crash exception of the ADSP subsystem.
[0102] S304, triggering a crash exception of the ADSP subsystem.
[0103] The audio driver triggering the crash exception of the ADSP subsystem can also be understood as the audio driver sending an ssr instruction to the ADSP subsystem, and the ssr instruction can be used to instruct the ADSP subsystem to crash, thereby triggering the crash exception of the ADSP subsystem. For example, the instruction for indicating that the ADSP subsystem crashes can be identified by the string "SEND_SSR_COMMAND", or by other strings or other data types, which is not limited in the embodiments of the present application.
[0104] When the ADSP subsystem obtains the ssr instruction, the ADSP subsystem can store the information in the temporary cache into the shared memory of the AP, and then the audio driver can generate a ramdump of the ADSP subsystem based on the information in the shared memory.
[0105] After triggering the crash exception of the ADSP subsystem, the audio driver may execute step S305.
[0106] S305. Collect the ramdump of the ADSP subsystem.
[0107] The audio driver may generate a ramdump of the ADSP subsystem based on the information in the shared memory, and save the ramdump of the ADSP subsystem as a file, such as a file in ELF format. The audio driver may also send a restart instruction to the ADSP subsystem to execute step S306.
[0108] S306. Restart the ADSP subsystem.
[0109] S307: Trigger the whole machine panic.
[0110] Triggering the whole machine panic can refer to the relevant description in step S303, which will not be repeated here. After the audio driver triggers the whole machine panic exception, step S308 can be executed to restart the whole machine.
[0111] S308. Restart the entire machine.
[0112] Specifically, Figure 4 Shows the timing diagram for generating an ADSP subsystem ramdump.
[0113] S401, the audio module opens a topology graph.
[0114] It is understandable that for different audio scenarios such as making calls, playing music, and recording voice, the ADSP subsystem can correspond to different audio algorithm modules. Among them, each audio algorithm module of the ADSP subsystem can have its own corresponding audio algorithm topology diagram, and the audio algorithm topology diagram can constitute the data link of the audio algorithm. The data link can have pre-set algorithm modules and algorithm parameters, etc. In other words, different audio scenarios can correspond to different algorithm modules and / or algorithm parameters.
[0115] For example, taking a call scenario as an example, the call scenario may have a corresponding call algorithm topology map, and the call algorithm topology map may constitute a data link of the call algorithm. When making a call, the audio module of the hardware abstraction layer may call the open graph interface and pass the identifier of the call scenario to the audio driver of the kernel layer. When the audio driver recognizes that the current scene is a call, it may use the data link of the call scenario in the ADSP subsystem.
[0116] S402: The audio driver sends an open graph command via the glink protocol.
[0117] After obtaining the information transmitted by the audio module, the audio driver can send open graph instructions to the ADSP subsystem through the glink protocol, and then the ADSP subsystem can start the data link of the relevant scene. Among them, the glink protocol can be understood as the communication protocol between the AP and the ADSP subsystem, and the glink protocol can also be called the inter-core communication protocol.
[0118] It is understandable that based on the needs of the audio module, the audio driver can also send other instructions to the ADSP subsystem through the glink protocol, such as instructions for writing data, instructions for closing the audio algorithm topology diagram, etc., which are not limited to the embodiments of the present application.
[0119] S403, ADSP subsystem abnormality occurs.
[0120] Under normal circumstances, taking the call scenario as an example, after the ADSP subsystem obtains the open graph instruction of the audio driver, the ADSP subsystem can build a data link for the call scenario. After the data link is built, the ADSP subsystem can report a response to the audio driver of the kernel layer and the audio module of the hardware abstraction layer. After the audio module obtains the response, it can continue to execute call-related processes and pass call-related data to the ADSP subsystem.
[0121] Alternatively, after obtaining other glink protocol instructions of the audio driver, the ADSP subsystem can also report a response to the audio driver and the audio module.
[0122] However, when an exception occurs in the ADSP subsystem, for example, a deadlock occurs in the ADSP subsystem but no crash occurs, or the ADSP subsystem runs out of memory when creating a thread, the ADSP subsystem cannot report a response to the audio driver of the kernel layer and the audio module of the hardware abstraction layer in time, causing the audio module to not receive a response for a long time, and problems occur in the corresponding audio service. In this case, the audio module can execute step S404.
[0123] S404: The audio module detects a timeout.
[0124] When the audio module detects that the instruction sent to the ADSP subsystem has timed out, the audio module may execute step S405. The specific instruction timeout time can refer to the above Figure 3 The relevant description in step S301 of the corresponding embodiment is not repeated here.
[0125] S405: The audio module triggers the ADSP subsystem to restart.
[0126] The process of the audio module triggering the ADSP subsystem restart can refer to the above Figure 3 The relevant description in step S301 of the corresponding embodiment is not repeated here.
[0127] S406: The audio driver determines that the current version is a user test version.
[0128] When the audio driver obtains the instruction of the audio module triggering the restart of the ADSP subsystem, the audio driver can determine that the current version is the user test version. The audio driver can refer to the above Figure 3 The relevant description in step S302 of the corresponding embodiment is not repeated here.
[0129] When the audio driver determines that the current version is a user test version, the audio driver may execute step S407.
[0130] S407: The audio driver detects whether the keyword is matched.
[0131] The audio driver can check whether the keyword matches the above Figure 3 The relevant description in step S303 of the corresponding embodiment is not repeated here.
[0132] When the audio driver fails to match the keyword, step S408 may be executed.
[0133] S408: The audio driver reports the reason for triggering ADSP SSR.
[0134] It is understandable that there are many reasons for triggering ADSP SSR, and different triggering reasons may have corresponding different reason identifiers. For example, for the scenario where the audio driver triggers ADSP SSR, the reason identifier may be identified by the string "[hardware.audio.service]restart adsp,thread name:writer", or by other strings or other data types, which are not limited in the embodiments of the present application.
[0135] If the electronic device is connected to the Internet, the audio driver can report the reason for triggering ADSP SSR to the cloud server; if the electronic device is not connected to the Internet, the audio driver can generate the reason for triggering ADSP SSR locally in the electronic device. When the electronic device is connected to the Internet, the audio driver can report the reason for triggering ADSP SSR to the cloud server. By reporting the reason for triggering ADSP SSR to the cloud server, developers can perform big data analysis and locate abnormal problems.
[0136] After the audio driver reports the reason for triggering the ADSP SSR, step S409 may be executed.
[0137] S409, the audio driver sends an ssr command to the ADSP subsystem to restart.
[0138] The audio driver can send ssr instructions to the ADSP subsystem through the glink protocol. For specific ADSP ssr instructions, refer to the above Figure 3 The relevant description in step S304 of the corresponding embodiment is not repeated here.
[0139] S410, ADSP subsystem crashes.
[0140] After the ADSP subsystem obtains the ssr command sent by the audio driver, the ADSP subsystem may trigger a crash of the ADSP subsystem. The ADSP subsystem crash may be understood as a crash exception of the ADSP subsystem. The ADSP subsystem may execute a related message processing mechanism, wherein the ADSP subsystem executing the message processing mechanism may include the ADSP subsystem executing step S411.
[0141] S411, ADSP subsystem synchronous memory.
[0142] The ADSP subsystem synchronizing the memory can be understood as the ADSP subsystem synchronizing the memory information in the temporary buffer to the shared memory of the AP. After the ADSP subsystem synchronizes the memory, step S412 can be executed.
[0143] S412, ADSP subsystem triggers interrupt.
[0144] The ADSP subsystem may report a message to the audio driver of the driver layer for indicating that the ADSP subsystem has crashed. This process may also be referred to as the ADSP subsystem triggering an interrupt to the AP side.
[0145] S413. The audio driver collects the ramdump of the ADSP subsystem.
[0146] After the audio driver obtains the interrupt, it can collect the ramdump of the ADSP subsystem based on the shared memory and generate relevant files for the developer to locate. In addition, the audio driver can also execute step S414 to restart the ADSP subsystem.
[0147] S414, ADSP subsystem restarts.
[0148] In a possible implementation, the audio driver may first power off the ADSP subsystem, then power on the ADSP subsystem again, and load the firmware of the ADSP subsystem, thereby restarting the ADSP subsystem. The embodiment of the present application does not limit the implementation method of restarting the ADSP subsystem.
[0149] It is understandable that the message processing method of the embodiment of the present application can be reflected through relevant logs. Exemplarily, when the AP triggers the restart of the ADSP subsystem, the corresponding log may include: restart ADSP. When the audio driver on the AP side triggers the ADSP subsystem to crash, since the audio driver will call the "SEND_SSR_COMMAND" instruction, the corresponding log may include: restart_reason = Trigger ADSP EXCEPTION. In addition, the audio driver can also generate a ramdump of the ADSP subsystem, for example, a corresponding ELF format file can be generated.
[0150] Since the reasons for triggering ADSP SSR are different, for some situations where it is difficult to analyze the reasons for triggering ADSP SSR, AP can generate a full dump of the entire machine based on the requirements of the chip platform or the developer's needs to locate the problem, which can facilitate further analysis and location of the reasons for triggering ADSP SSR.
[0151] Figure 5 The timing diagram for generating a fulldump of the entire machine is shown.
[0152] S501: The audio module opens a topology graph.
[0153] The process of opening the topology diagram of the audio module can refer to the above Figure 4 The relevant description in step S401 of the corresponding embodiment is not repeated here.
[0154] S502: The audio driver sends an open graph command via the glink protocol.
[0155] The process of the audio driver sending open graph commands through the glink protocol can be referred to above Figure 4 The relevant description in step S402 of the corresponding embodiment is not repeated here.
[0156] S503, ADSP subsystem abnormality occurs.
[0157] If the ADSP subsystem fails, refer to the above Figure 4 The relevant description of step S403 in the corresponding embodiment is not repeated here. When an abnormality occurs in the ADSP subsystem, so that the audio module cannot receive a response for a long time, the audio module may execute step S504.
[0158] S504: The audio module detects that the time has timed out.
[0159] When the audio module detects that the instruction sent to the ADSP subsystem has timed out, the audio module may execute step S505. The process of the audio module detecting the timeout may refer to the above Figure 3 The relevant description in step S301 of the corresponding embodiment is not repeated here.
[0160] S505: The audio module triggers the ADSP subsystem to restart.
[0161] The process of the audio module triggering the ADSP subsystem restart can refer to the above Figure 3 The relevant description in step S301 of the corresponding embodiment is not repeated here.
[0162] S506: The audio driver determines that the current version is a user test version.
[0163] The audio driver can be judged as the user test version by referring to the above Figure 3 The relevant description of step S302 of the corresponding embodiment is not repeated here. When the audio driver determines that the current version is a user test version, the audio driver may execute step S507.
[0164] S507: The audio driver detects whether the keyword is matched.
[0165] The audio driver can check whether the keyword matches the above Figure 3 The relevant description of step S303 of the corresponding embodiment is not repeated here. When the audio driver matches the keyword, step S508 may be executed.
[0166] S508: The audio driver triggers a fulldump of the entire machine.
[0167] The process of the audio driver triggering the fulldump of the entire machine can refer to the above Figure 3 The relevant description in step S303 of the corresponding embodiment is not repeated here.
[0168] The message processing method of the embodiment of the present application is described in detail below through specific embodiments. The following embodiments can be combined with each other or implemented independently, and the same or similar concepts or processes may not be repeated in some embodiments.
[0169] Figure 6 The message processing method of the embodiment of the present application is shown. The method includes:
[0170] S601, at the first moment, the AP transmits a first message to the ADSP, and the first message requires a reply from the ADSP.
[0171] In the embodiment of the present application, the first moment can be understood as the moment when the AP transmits the first message to the ADSP.
[0172] The first message can be understood as any message transmitted by the AP to the ADSP, wherein the first message requires a reply from the ADSP. The first message can include any message transmitted by the AP to the ADSP through the glink protocol. For example, the first message can include the above Figure 4 Corresponding to the open graph instruction in the embodiment, the embodiment of the present application does not limit the specific first message.
[0173] S602: At the second moment, the AP receives a response from the ADSP, and the second moment is later than the first moment.
[0174] In the embodiment of the present application, the second moment can be understood as the moment when the AP receives the ADSP reply.
[0175] S603, at the third moment, the AP transmits a second message to the ADSP, the second message requires a reply from the ADSP, and the third moment is later than the second moment.
[0176] In the embodiment of the present application, the third moment can be understood as the moment when the AP transmits the second message to the ADSP.
[0177] The second message can refer to the explanation of the first message in the above step S601, and will not be described in detail. The second message can be the same as or different from the first message, and the embodiment of the present application does not limit the specific second message.
[0178] S604, at the fourth moment, the AP does not receive a reply from the ADSP, and the AP transmits a third message to the ADSP, where the third message is used to instruct the ADSP to store the memory information of the ADSP in the memory of the AP. The fourth moment is later than the third moment, and the time from the third moment to the fourth moment exceeds the preset time period.
[0179] In the embodiment of the present application, the fourth moment can be understood as the moment starting from the third moment, the time interval exceeds the preset time period, and the AP does not receive a reply from the ADSP.
[0180] The third message can be understood as the above Figure 3 In the corresponding embodiment, the message or instruction that causes the ADSP subsystem to crash, for example, the third message may include the "SEND_SSR_COMMAND" instruction in step S304.
[0181] ADSP stores the memory information of ADSP into the memory of AP. Figure 4 The corresponding step S411 in the embodiment, in which the ADSP subsystem synchronizes the memory, will not be described in detail.
[0182] S605, at the fifth moment, the AP obtains the first log, which includes the memory information of the ADSP. The fifth moment is later than the fourth moment.
[0183] In the embodiment of the present application, the fifth moment can be understood as the moment when the AP obtains the first log.
[0184] The first log can be understood as the ramdump of the ADSP subsystem collected by the AP.
[0185] When the AP detects a communication timeout with the ADSP subsystem, the AP can trigger a crash exception of the ADSP subsystem. In this way, the ADSP subsystem can store the information in the temporary cache to the AP's shared memory, and the AP can generate a ramdump of the ADSP subsystem based on the information in the shared memory. Developers can then use the ramdump to locate and analyze the abnormal problems that occurred in the ADSP subsystem.
[0186] Optional, in Figure 6 On the basis of the corresponding embodiment, after the AP transmits the third message to the ADSP, between the fourth moment and the fifth moment, it can also include: the ADSP stores the memory information of the ADSP in the memory of the AP; the ADSP transmits the fourth message to the AP, and the fourth message is used to instruct the AP to obtain the first log based on the memory information of the ADSP.
[0187] In the embodiment of the present application, the ADSP storing the memory information of the ADSP into the memory of the AP can be understood as the above Figure 4 The corresponding step S411 in the embodiment, in which the ADSP subsystem synchronizes the memory, will not be described in detail.
[0188] ADSP transmits the fourth message to AP by referring to the above Figure 4 In the corresponding embodiment, step S412, the ADSP subsystem triggers an interrupt, which will not be described in detail.
[0189] ADSP stores the information in the temporary cache in the shared memory of the AP. The AP can then generate logs based on the information in the shared memory, thereby locating and analyzing abnormal problems that occur in the ADSP.
[0190] Optional, in Figure 6 On the basis of the corresponding embodiment, the ADSP transmitting the fourth message to the AP may include: the ADSP triggering an interrupt to the AP.
[0191] In the embodiment of the present application, the ADSP subsystem trigger interrupt can refer to the above Figure 4 The description of step S412 of the corresponding embodiment is not repeated here. The AP can collect the memory information of the ADSP according to the interrupt message, and then analyze and locate the abnormal problem occurred in the ADSP.
[0192] Optional, in Figure 6On the basis of the corresponding embodiment, the third message includes: SEND_SSR_COMMAND message. After the AP transmits the third message to the ADSP, it may also include: ADSP restart.
[0193] In the embodiment of the present application, restarting ADSP can restore the abnormality of ADSP, so that ADSP can operate normally and ensure the normal experience of users in the audio scenario.
[0194] Optional, in Figure 6 On the basis of the corresponding embodiment, the AP transmits the third message to the ADSP, which may include: when the AP determines that the electronic device is a user test version, the AP transmits the third message to the ADSP.
[0195] In the embodiment of the present application, the AP can refer to the above Figure 3 The relevant description of step S302 in the corresponding embodiment is not repeated here.
[0196] If the electronic device is a user test version, the AP can collect the memory information of the ADSP, which can better analyze and solve the anomalies that occur in the ADSP subsystem.
[0197] Optional, in Figure 6 On the basis of the corresponding embodiment, when the AP determines that the electronic device is a user test version, the AP transmits a third message to the ADSP, which may include: when the AP determines that the electronic device is a user test version, and the AP determines that the thread running in the electronic device cannot match the preset field, the AP transmits the third message to the ADSP; the preset field is related to one or more of the following: thread name, reason for triggering the ADSP restart.
[0198] In the embodiment of the present application, the AP determines that the thread running in the electronic device cannot match the preset field, and can refer to the above Figure 3 The relevant description of step S303 in the corresponding embodiment is not repeated here.
[0199] If the electronic device does not match the keyword, it means that there is no need to trigger the panic of the entire device. Then the AP can transmit a third message to the ADSP to trigger a crash exception of the ADSP subsystem, thereby generating a ramdump of the ADSP subsystem.
[0200] Optional, in Figure 6On the basis of the corresponding embodiments, the method may further include: at the sixth moment, the AP transmits the fifth message to the ADSP, and the fifth message requires a reply from the ADSP; at the seventh moment, the AP does not receive a reply from the ADSP, and the AP transmits the third message to the ADSP, the seventh moment is later than the sixth moment, and the time from the sixth moment to the seventh moment exceeds a preset time period; when the AP determines that the electronic device is a user test version, and the AP determines that the thread running in the electronic device can match the preset field, the AP obtains a second log, the content of the second log is more than the first log, and the second log includes the memory information of the ADSP.
[0201] In the embodiment of the present application, the sixth moment can be understood as the moment when the AP transmits the fifth message to the ADSP. The seventh moment can be understood as the moment when the AP transmits the third message to the ADSP.
[0202] The fifth message can refer to the explanation of the first message in step S601 above, and will not be repeated here. The fifth message can be the same as or different from the first message, and the embodiment of the present application does not limit the specific fifth message. The second log can include the memory information of the AP and the memory information of all subsystems, etc. For example, the second log can be understood as the above Figure 3 The entire machine is fully dumped in step S303 of the corresponding embodiment.
[0203] If the electronic device matches the keyword, it means there is a need to trigger a panic of the entire device. Then the AP can print the full dump of the entire device. In this way, the developer can obtain more memory information based on the full dump of the entire device, which is more helpful for analyzing the abnormal problem.
[0204] Optional, in Figure 6 Based on the corresponding embodiment, the second log includes a memory dump file fulldump of the electronic device.
[0205] In the embodiment of the present application, the second log can be understood as the above Figure 3 The entire machine is fully dumped in step S303 of the corresponding embodiment.
[0206] Compared with the ramdump of the ADSP subsystem, the fulldump of the whole machine contains more information. For example, the fulldump of the whole machine can include the memory information of the AP and the memory information of all subsystems, etc. In this way, developers can obtain more memory information based on the fulldump of the whole machine, which is more helpful for analyzing abnormal problems.
[0207] Optional, in Figure 6 Based on the corresponding embodiment, the first log includes a memory dump file ramdump of the ADSP, and the format of the first log includes an ELF format.
[0208] In the embodiment of the present application, the AP can generate a memory dump file ramdump of the ADSP subsystem, and then the developer can locate and analyze abnormal problems occurring in the ADSP subsystem through the ramdump.
[0209] Optional, in Figure 6 On the basis of the corresponding embodiment, before the AP transmits the third message to the ADSP, it may also include: if the electronic device is connected to the Internet, the AP sends the reason for the ADSP restart to the cloud server; if the electronic device is not connected to the Internet, the AP saves the reason for triggering the ADSP restart locally in the electronic device, and after the electronic device is connected to the Internet, the AP sends the reason for the ADSP restart to the cloud server.
[0210] In the embodiment of the present application, the reason why the audio driver sends the ADSP restart to the cloud server can refer to the above Figure 4 The relevant description of step S408 in the corresponding embodiment is not repeated here. By reporting the reason for triggering ADSP SSR to the cloud server, the developer can perform big data analysis and locate abnormal problems.
[0211] Optional, in Figure 6 On the basis of the corresponding embodiments, the hardware abstraction layer of the AP includes an audio module, and the kernel layer of the AP includes an audio driver. Before the AP transmits the third message to the ADSP, it may include: the audio module determines that no reply is received from the ADSP within a preset time period; the audio module transmits the sixth message to the audio driver, and the sixth message is used to instruct the audio driver to execute the process of restarting the ADSP; the audio driver determines that the electronic device is a user test version; the audio driver determines that the preset field is not matched; the audio driver sends the reason for the ADSP restart to the cloud server; the AP transmits the third message to the ADSP, which may include: the audio driver transmits the third message to the ADSP; the AP obtains the first log, which may include: the audio driver obtains the first log based on the memory information of the ADSP.
[0212] In the embodiment of the present application, the sixth message can be understood as the above Figure 3 The corresponding embodiment of the step S301 of the ssr instruction, for example, the sixth message may include an instruction to write the ADSP ssr node. The audio module transmits the sixth message to the audio driver, which can be understood as the above Figure 4 In step S405 of the corresponding embodiment, the audio module triggers the ADSP subsystem to restart.
[0213] The audio driver can refer to the above to determine whether the electronic device is a user test version. Figure 3 The relevant description of step S302 in the corresponding embodiment is not repeated here. Figure 3The relevant description of step S303 in the corresponding embodiment is not repeated here. The reason why the audio driver sends the ADSP restart message to the cloud server can be referred to above. Figure 4 The relevant description of step S408 in the corresponding embodiment is not repeated here.
[0214] When the audio module detects that the communication with the ADSP subsystem has timed out, it can trigger a crash exception of the ADSP subsystem, and then the audio driver can execute the relevant process of restarting the ADSP.
[0215] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0216] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily appreciate that, in combination with the method steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0217] The embodiment of the present application can divide the functional modules of the device implementing the method according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0218] like Figure 7 FIG. 7 is a schematic diagram of a chip structure provided by an embodiment of the present application. The chip 700 includes one or more (including two) processors 701 , a communication line 702 , a communication interface 703 and a memory 704 .
[0219] In some implementations, the memory 704 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
[0220] The method described in the above embodiment of the present application can be applied to the processor 701, or implemented by the processor 701. The processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware or software instructions in the processor 701. The above processor 701 can be a general-purpose processor (for example, a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 701 can implement or execute the methods, steps and logic block diagrams related to each processing disclosed in the embodiment of the present application.
[0221] The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a mature storage medium in the field such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read only memory (EEPROM). The storage medium is located in the memory 704, and the processor 701 reads the information in the memory 704 and completes the steps of the above method in combination with its hardware.
[0222] The processor 701 , the memory 704 , and the communication interface 703 may communicate with each other via the communication line 702 .
[0223] In the above embodiments, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory, or may be downloaded and installed in the memory in the form of software.
[0224] The present application embodiment also provides a computer program product including one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium may include a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0225] The present application also provides a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium that can be accessed by a computer.
[0226] As a possible design, the computer readable medium may include a compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; the computer readable medium may include a magnetic disk storage or other magnetic disk storage device. Moreover, any connection line may also be appropriately referred to as a computer readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while optical discs reproduce data optically using lasers.
[0227] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
Claims
1. A message processing method, characterized in that: The method is applied to an electronic device, the electronic device includes an application processor AP and an audio digital signal processor ADSP, and the method includes: At a first moment, the AP transmits a first message to the ADSP, and the first message requires a reply from the ADSP; At a second moment, the AP receives a reply from the ADSP, and the second moment is later than the first moment; At a third moment, the AP transmits a second message to the ADSP, the second message requires a reply from the ADSP, and the third moment is later than the second moment; At the fourth moment, the AP does not receive a reply from the ADSP, and the AP transmits a third message to the ADSP, wherein the third message is used to instruct the ADSP to store the memory information of the ADSP into the memory of the AP, the fourth moment is later than the third moment, and the time from the third moment to the fourth moment exceeds a preset time period; the third message is a message or instruction to cause the ADSP subsystem to crash; At a fifth moment, the AP obtains a first log, wherein the first log includes memory information of the ADSP, and the fifth moment is later than the fourth moment.
2. The method according to claim 1, characterized in that After the AP transmits the third message to the ADSP, between the fourth moment and the fifth moment, the method further includes: The ADSP stores the memory information of the ADSP in the memory of the AP; The ADSP transmits a fourth message to the AP, where the fourth message is used to instruct the AP to obtain the first log based on the memory information of the ADSP.
3. The method according to claim 2, characterized in that The ADSP transmits a fourth message to the AP, including: the ADSP triggers an interrupt to the AP.
4. The method according to any one of claims 1 to 3, characterized in that: The third message includes: a SEND_SSR_COMMAND message. After the AP transmits the third message to the ADSP, it also includes: the ADSP restarts.
5. The method according to any one of claims 1 to 4, characterized in that: The AP transmits a third message to the ADSP, including: When the AP determines that the electronic device is a user test version, the AP transmits the third message to the ADSP.
6. The method according to claim 5, characterized in that When the AP determines that the electronic device is a user test version, the AP transmits the third message to the ADSP, including: When the AP determines that the electronic device is the user test version, and the AP determines that the thread running in the electronic device cannot match the preset field, the AP transmits the third message to the ADSP; the preset field is related to one or more of the following: thread name, reason for triggering the restart of the ADSP.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: At a sixth moment, the AP transmits a fifth message to the ADSP, and the fifth message requires a reply from the ADSP; At the seventh moment, the AP does not receive a reply from the ADSP, and the AP transmits the third message to the ADSP. The seventh moment is later than the sixth moment, and the time from the sixth moment to the seventh moment exceeds the preset time period. When the AP determines that the electronic device is a user test version, and the AP determines that the thread running in the electronic device can match the preset field, the AP obtains a second log, the content of the second log is more than the first log, and the second log includes the memory information of the ADSP.
8. The method according to claim 7, characterized in that The second log includes a memory dump file fulldump of the electronic device.
9. The method according to any one of claims 1 to 8, characterized in that: The first log includes a memory dump file ramdump of the ADSP, and the format of the first log includes an ELF format.
10. The method according to any one of claims 1 to 9, characterized in that: Before the AP transmits the third message to the ADSP, the method further includes: If the electronic device is connected to the network, the AP sends the reason for the ADSP restart to the cloud server; If the electronic device is not connected to the Internet, the AP saves the reason for triggering the restart of the ADSP locally in the electronic device. After the electronic device is connected to the Internet, the AP sends the reason for the restart of the ADSP to the cloud server.
11. The method according to claim 1, characterized in that: The hardware abstraction layer of the AP includes an audio module, and the kernel layer of the AP includes an audio driver. Before the AP transmits the third message to the ADSP, the method includes: The audio module determines that no response from the ADSP is received within the preset time period; The audio module transmits a sixth message to the audio driver, where the sixth message is used to instruct the audio driver to execute a process of restarting the ADSP; The audio driver determines that the electronic device is a user test version; The audio driver determines that no preset field is matched; The audio driver sends the reason for the ADSP restart to the cloud server; The AP transmits the third message to the ADSP, including: the audio driver transmits the third message to the ADSP; The AP obtains the first log, including: the audio driver obtains the first log based on the memory information of the ADSP.
12. An electronic device, characterized in that: include: A memory and a processor, the memory being used to store a computer program, and the processor being used to execute the computer program to perform the method according to any one of claims 1 to 11.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the computer executes the method according to any one of claims 1 to 11.
14. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, enables an electronic device to execute the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Method and device for classifying crash logs
CN106708704A
Digital signal processor (DSP) detection method and mobile terminal
CN107360321A
Log information submission method, device and storage medium, ADSP and terminal
CN107545067A
Information processing method and device, mobile terminal, and computer-readable storage medium
CN108541050A
Log message processing method and device and electronic equipment
CN110515803A
