CN117714271A - Message processing method and related device - Google Patents

Message processing method and related device Download PDF

Info

Publication number
CN117714271A
CN117714271A CN202310942746.3A CN202310942746A CN117714271A CN 117714271 A CN117714271 A CN 117714271A CN 202310942746 A CN202310942746 A CN 202310942746A CN 117714271 A CN117714271 A CN 117714271A
Authority
CN
China
Prior art keywords
adsp
message
moment
subsystem
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310942746.3A
Other languages
Chinese (zh)
Inventor
高张艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310942746.3A priority Critical patent/CN117714271A/en
Publication of CN117714271A publication Critical patent/CN117714271A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application provides a message processing method and a related device, and relates to the technical field of terminals. The method comprises the following steps: when the AP of the electronic device detects that communication time-out occurs with the ADSP subsystem, the AP can trigger the crash breakdown abnormality of the ADSP subsystem. Thus, the ADSP subsystem can store the information in the temporary cache into the shared memory of the AP, the AP can generate ramdump of the ADSP subsystem based on the information in the shared memory, and a developer can position and analyze the abnormal problem of the ADSP subsystem through the ramdump.

Description

Message processing method and related device
Technical Field
The present disclosure relates to the field of terminal technologies, and in particular, to a message processing method and a related device.
Background
In audio related scenarios such as talking, playing music, recording speech, etc., an AP in the electronic device may communicate with an audio digital signal processor (audio digital signal processor, ADSP).
In one implementation, the AP may generate ramdump for the ADSP when an exception such as a crash occurs to the ADSP. Furthermore, the developer can locate and analyze the abnormal problems generated by ADSP through the ramdump.
However, in some scenarios, when an ADSP is abnormal, a developer cannot locate and analyze the abnormal problem caused by the ADSP.
Disclosure of Invention
According to the message processing method and the related device, when the AP of the electronic equipment detects that communication time-out occurs between the AP and the ADSP subsystem, the AP can trigger the crash collapse abnormality of the ADSP subsystem. In this way, the ADSP subsystem may store the information in the temporary buffer into the shared memory of the AP, and the AP may generate ramdump of the ADSP subsystem based on the information in the shared memory. And a developer can conduct positioning analysis on abnormal problems generated by the ADSP subsystem through the ramdump.
In a first aspect, a message processing method provided in an embodiment of the present application includes:
at a first moment, the AP transmits a first message to the ADSP, and the first message needs an ADSP reply; the AP receives the reply of the ADSP at a second moment, and the second moment is later than the first moment; the AP transmits a second message to the ADSP at a third moment, the second message needs to be replied by the ADSP, and the third moment is later than the second moment; the AP does not receive the reply of the ADSP at the fourth moment, the AP transmits a third message to the ADSP, the third message is used for indicating 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 third moment to the fourth moment exceed a preset time period; at a fifth moment, the AP obtains a first log, wherein the first log comprises memory information of the ADSP, and the fifth moment is later than the fourth moment. In this way, the ADSP subsystem may store the information in the temporary buffer into the shared memory of the AP, and the AP may generate ramdump of the ADSP subsystem based on the information in the shared memory.
In a possible implementation, after the AP transmits the third message to the ADSP, between the fourth time and the fifth time, the method further includes: ADSP stores the memory information of ADSP into the memory of AP; the ADSP transmits a fourth message to the AP, wherein the fourth message is used for indicating the AP to obtain the first log based on the memory information of the ADSP. Therefore, the ADSP stores the information in the temporary cache into the shared memory of the AP, and the AP can generate a log based on the information in the shared memory, so that the positioning analysis of the abnormal problem of the ADSP is realized.
In one possible implementation, the ADSP delivers a fourth message to the AP, including: ADSP triggers an interrupt to AP. Therefore, the AP can collect the memory information of the ADSP according to the interrupt message, and further can analyze and locate the abnormal problems of the ADSP.
In one possible implementation, the third message includes: the send_ssr_command message, after the AP delivers the third message to the ADSP, further includes: ADSP restarts. Thus, the ADSP restarting can recover the abnormality of the ADSP, so that the ADSP can normally run, and the normal experience of a user in an audio scene is ensured.
In one possible implementation, the AP communicates a third message to the ADSP, including: when the AP determines that the electronic device is the user test version, the AP communicates a third message to the ADSP. Therefore, when the electronic equipment is a user test version, the AP can collect the memory information of the ADSP, so that the abnormality of the ADSP subsystem can be better analyzed and solved.
In one possible implementation, when the AP determines that the electronic device is a user test version, the AP communicates a third message to the ADSP, including: when the AP determines that the electronic equipment is a user test version and the AP determines that a thread running in the electronic equipment cannot be matched with a preset field, the AP transmits a third message to the ADSP; the preset fields are related to one or more of the following: thread name, reason for triggering ADSP restart. In this way, if the electronic device does not match the keyword, which indicates that the requirement of the complete machine panic is not triggered, the AP may transmit a third message to the ADSP, trigger a crash exception of the ADSP subsystem, and further generate a ramdump of the ADSP subsystem.
In one possible implementation, at a sixth time, the AP communicates a fifth message to the ADSP, the fifth message requiring an ADSP reply; the seventh moment, the AP does not receive the reply of the ADSP, the AP transmits a third message to the ADSP, the seventh moment is later than the sixth moment, and the sixth moment to the seventh moment exceed a preset time period; when the AP determines that the electronic equipment is a user test version and the AP determines that the threads running in the electronic equipment can be matched with the preset fields, the AP obtains a second log, the content of the second log is more than that of the first log, and the second log comprises memory information of ADSP. Therefore, if the electronic equipment is matched with the keyword, the requirement for triggering the complete machine panic is shown, the AP can print the complete machine fulldump, so that a developer can obtain more memory information according to the complete machine fulldump, and the analysis of abnormal problems is facilitated.
In one possible implementation, the second log includes a memory dump file fulldump of the electronic device. Therefore, a developer can obtain more memory information according to the complete machine fulldump, and the analysis of abnormal problems is facilitated.
In one 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. Thus, the developer can perform positioning analysis on the abnormal problems of the ADSP subsystem through the ramdump.
In a possible implementation, before the AP delivers the third message to the ADSP, the method further includes: if the electronic equipment is networked, the AP sends the reason of restarting the ADSP to the cloud server; if the electronic equipment is not networked, the AP stores the reason for triggering the ADSP restart in the local area of the electronic equipment, and after the electronic equipment is networked, the AP sends the reason for triggering the ADSP restart to the cloud server. In this way, by reporting the reason for triggering ADSP ssr to the cloud server, the developer can analyze big data and locate abnormal problems.
In one 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 passes the third message to the ADSP, the method includes: the audio module determines that no reply of the ADSP is received within a preset time period; the audio module transmits a sixth message to the audio driver, wherein the sixth message is used for indicating the audio driver to execute the process of restarting the ADSP; the audio driver determines the electronic equipment as a user test version; the audio driver determines that the preset field is not matched; the audio driver sends the reason for restarting ADSP to the cloud server; the AP delivering a third message to the ADSP comprising: the audio driver delivers a third message to the ADSP; the AP obtains a first log comprising: the audio driver obtains a first log based on the ADSP memory information. Thus, when the audio module detects the communication time-out with the ADSP subsystem, the crash abnormality of the ADSP subsystem can be triggered, and the audio driver can execute the related flow of the ADSP restart.
In a second aspect, an embodiment of the present application provides an apparatus for processing a message, where the apparatus may be an electronic device, or may be a chip or a chip system in the electronic device. The apparatus may include a processing unit. The processing unit is configured to implement any method related to processing performed by the electronic device in the first aspect or any of the possible implementations of the first aspect. When the apparatus is an electronic device, the processing unit may be a processor. The apparatus may further comprise a storage unit, which may be a memory. The storage unit is configured 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 one of the possible implementation manners of the first aspect. When the apparatus is a chip or a system of chips within an electronic device, the processing unit may be a processor. The processing unit executes instructions stored by the storage unit to cause the electronic device to implement the method described in the first aspect or any one of the possible implementations of the first aspect. The memory unit may be a memory unit (e.g., a register, a cache, etc.) within the chip, or a memory unit (e.g., a read-only memory, a random access memory, etc.) within the electronic device that is external to the chip.
The processing unit is for example configured to deliver a first message to the ADSP, to receive a reply from the ADSP, to deliver a second message to the ADSP, to deliver a third message to the ADSP, and in particular to obtain a first log.
In a possible implementation manner, the processing unit is configured to store the memory information of the ADSP in the memory of the AP, and is further configured to transmit a fourth message to the AP.
In a possible implementation, the processing unit is configured to trigger an interrupt to the AP.
In a possible implementation, the processing unit is configured to restart the ADSP.
In a possible implementation manner, the processing unit is configured to send a third message to the ADSP when determining that the electronic device is a user test version.
In a possible implementation manner, the processing unit is configured to determine that the electronic device is a user test version, and transmit a third message to the ADSP when it is determined that a thread running in the electronic device cannot match a preset field.
In a possible implementation manner, the processing unit is configured to transmit a fifth message to the ADSP, and further configured to transmit a third message to the ADSP, and specifically further configured to determine that the electronic device is a user test version, and obtain the second log when it is determined that a thread running in the electronic device can be matched to a preset field.
In one possible implementation, the second log includes a memory dump file fulldump of the electronic device.
In one 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 a possible implementation manner, the processing unit is configured to send a reason for the ADSP restart to the cloud server, and further is configured to store the reason for triggering the ADSP restart locally to the electronic device.
In a possible implementation manner, the processing unit is configured to determine that no reply of the ADSP is received within a preset period of time, and is further configured to transmit a sixth message to the audio driver, and is further configured to determine that the electronic device is a user test version, and is further configured to determine that the electronic device does not match the preset field, and is further configured to send a reason for restarting the ADSP to the cloud server, and is further configured to transmit a third message to the ADSP, and in particular, is further configured to obtain the first log.
In a third aspect, embodiments of the present application provide a terminal device comprising a processor and a memory, the memory being for storing code instructions, the processor being for executing the code instructions to perform the method described in the first aspect or any one of the possible implementations of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored therein a computer program or instructions which, when run on a computer, cause the computer to perform the method described in the first aspect or any one of the possible implementations of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when run on a computer, causes the computer to perform the method described in the first aspect or any one of the possible implementations of the first aspect.
In a sixth aspect, the present application provides a chip or chip system comprising at least one processor and a communication interface, the communication interface and the at least one processor being interconnected by wires, the at least one processor being adapted to execute a computer program or instructions to perform the method described in the first aspect or any one of the possible implementations of the first aspect. The communication interface in the chip can be an input/output interface, a pin, a circuit or the like.
In one possible implementation, the chip or chip system described above in the present application further includes at least one memory, where the at least one memory has instructions stored therein. The memory may be a memory unit within the chip, such as a register, a cache, etc., or may be a memory unit of the chip (e.g., a read-only memory, a random access memory, etc.).
It should be understood that, the second aspect to the sixth aspect of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects obtained by each aspect and the corresponding possible embodiments are similar, and are not repeated.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 2 is a schematic software structure of an electronic device according to an embodiment of the present application;
fig. 3 is an overall flowchart of a message processing method provided in an embodiment of the present application;
FIG. 4 is a timing diagram for generating an ramdump of an ADSP subsystem according to an embodiment of the present application;
fig. 5 is a timing chart for generating a complete dump according to an embodiment of the present application;
fig. 6 is a schematic diagram of a message processing method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a chip according to an embodiment of the present application.
Detailed Description
In order to facilitate the clear description of the technical solutions of the embodiments of the present application, the following simply describes some terms and techniques related to the embodiments of the present application:
1. ramdump: the ramdump file may refer to a file that an electronic device may dump the memory information of a system into when an abnormality such as a crash occurs in a system or subsystem. It will be appreciated that since thread stack information, log information, etc. may be included in ramdump, a developer may analyze system exception problems based on the ramdump file.
2. Terminology
In the embodiments of the present application, the words "first," "second," and the like are used to distinguish between identical or similar items that have substantially the same function and effect. For example, the first chip and the second chip are merely for distinguishing different chips, and the order of the different chips is not limited. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
It should be noted that, in the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
3. Electronic equipment
The electronic device in the embodiment of the present application may also be any form of terminal device, for example, the electronic device may include: a mobile phone, tablet, palm, notebook, mobile internet device (mobile internet device, MID), wearable device, virtual Reality (VR) device, augmented reality (augmented reality, AR) device, wireless terminal in industrial control (industrial control), wireless terminal in unmanned (self driving), wireless terminal in teleoperation (remote medical surgery), wireless terminal in smart grid (smart grid), wireless terminal in transportation security (transportation safety), wireless terminal in smart city (smart city), wireless terminal in smart home (smart home), cellular phone, cordless phone, session initiation protocol (session initiation protocol, SIP) phone, wireless local loop (wireless local loop, WLL) station, personal digital assistant (personal digital assistant, PDA), handheld device with wireless communication function, public computing device or other processing device connected to wireless modem, vehicle-mounted device, wearable device, electronic device in 5G network or evolving land mobile network (public land mobile network), and the like, without being limited to this embodiment.
By way of example, and not limitation, in embodiments of the present application, the electronic device may also be a wearable device. The wearable device can also be called as a wearable intelligent device, and is a generic name for intelligently designing daily wear by applying wearable technology and developing wearable devices, such as glasses, gloves, watches, clothes, shoes and the like. The wearable device is a portable device that is worn directly on the body or integrated into the clothing or accessories of the user. The wearable device is not only a hardware device, but also can realize a powerful function through software support, data interaction and cloud interaction. The generalized wearable intelligent device includes full functionality, large size, and may not rely on the smart phone to implement complete or partial functionality, such as: smart watches or smart glasses, etc., and focus on only certain types of application functions, and need to be used in combination with other devices, such as smart phones, for example, various smart bracelets, smart jewelry, etc. for physical sign monitoring.
In addition, in the embodiment of the application, the electronic device may also be an electronic device in an internet of things (internet of things, ioT) system, and the IoT is an important component of future information technology development, and the main technical characteristic of the IoT is that the article is connected with a network through a communication technology, so that man-machine interconnection and an intelligent network for internet of things are realized.
The electronic device in the embodiment of the application may also be referred to as: a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote terminal, a mobile device, a user terminal, a wireless communication device, a user agent, or a user equipment, etc.
In an embodiment of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running above the hardware layer, and an application layer running above the operating system layer. The hardware layer includes hardware such as a central processing unit (central processing unit, CPU), a memory management unit (memory management unit, MMU), and a memory (also referred to as a main memory). The operating system may be any one or more computer operating systems that implement business processes through processes (processes), such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a windows operating system. The application layer comprises applications such as a browser, an address book, word processing software, instant messaging software and the like.
By way of example, fig. 1 shows a schematic diagram of an electronic device.
The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge 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, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the structure illustrated in the embodiments 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 less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a SIM card interface, and/or a USB interface, among others.
It should be understood that the connection relationship between the modules illustrated in the embodiments of the present invention is only illustrative, and does not limit the structure of the electronic device. In other embodiments of the present application, the electronic device may also use different interfacing manners in the foregoing embodiments, or a combination of multiple interfacing manners.
The internal memory 121 may be used to store computer-executable program code that includes instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device (e.g., audio data, phonebook, etc.), and so forth. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the electronic device and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The electronic device may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as audio playback or recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The speaker 170A, also referred to as a "horn," is used to convert an audio electrical signal into a sound signal, and may include 1 or N speakers 170A, N being a positive integer greater than 1 in the electronic device. The electronic device may listen to music, video, or hands-free conversation, etc., through speaker 170A. A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When the electronic device picks up a phone call or voice message, the voice can be picked up by placing the receiver 170B close to the human ear. Microphone 170C, also known as a "microphone" or "microphone," is used to convert sound signals into electrical signals. The earphone interface 170D is used to connect a wired earphone.
Fig. 2 is a software architecture block diagram of an AP of an electronic device according to an embodiment of the present application. The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into five layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun rows (Android run) and libraries, a hardware abstraction layer (hardware adaptation layer, HAL), and a kernel layer, respectively.
The application layer may include a series of application packages. As shown in fig. 2, the application packages may include telephone, music, video, calendar, camera, game, memo, etc. applications. Applications may include system applications and three-way applications.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in fig. 2, the application framework layer may include a window manager, a resource manager, a content provider, and the like.
The window manager is used for managing window programs. The window manager may obtain the display screen size, determine if there is a status bar, lock screen, touch screen, drag screen, intercept screen, etc.
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The content provider is used for realizing the function of data sharing among different application programs, allowing one program to access the data in the other program, and simultaneously ensuring the safety of the accessed data.
Android runtimes include core libraries and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like. For example, in embodiments of the present application, a virtual machine may be used to perform functions such as instruction timeout detection, electronic device version detection, keyword matching, gathering ramdump of ADSP, and the like.
The system library may also be referred to as Native layer, which may include a plurality of functional modules. For example: media libraries), function libraries (function libraries), and the like.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio video encoding formats, such as: MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The function library provides multiple service API interfaces for the developer, and is convenient for the developer to integrate and realize various functions quickly.
The hardware abstraction layer is a layer of abstracted structure between the kernel layer and the Android run. The hardware abstraction layer may be a package for hardware drivers that provides a unified interface for the invocation of upper layer applications. The hardware abstraction layer may include an audio module. The audio module can be used for detecting the overtime of instructions and triggering ADSP restarting and the like.
The kernel layer is a layer between hardware and software. The kernel layer may include an audio driver, a display driver, a camera driver, a battery driver, a bluetooth driver, a central processor driver, a USB driver, etc. It is understood that the kernel layer of the AP may communicate with the ADSP.
It should be noted that, the embodiments of the present application are only illustrated by using an android system, and in other operating systems (such as Windows systems, IOS systems, etc.), the schemes of the present application can also be implemented as long as the functions implemented by the respective functional modules are similar to those of the embodiments of the present application.
In the audio related scenes such as talking, playing music, recording voice and the like, an audio module in an AP of the electronic equipment can be communicated with an ADSP, and the ADSP can establish a corresponding algorithm path for each audio scene, so that related audio functions are realized. Wherein ADSP may also be referred to as an ADSP subsystem.
In one implementation, the ADSP subsystem may store memory information in a temporary cache, which may also be referred to as an intermediate cache, of the ADSP subsystem during operation. When the ADSP subsystem generates an abnormality such as crash, the ADSP subsystem can store the information in the temporary cache into the shared memory of the AP, and the AP can generate ramdump of the ADSP subsystem based on the information in the shared memory. Furthermore, a developer can acquire the memory information of the ADSP subsystem through the ramdump, and can perform positioning analysis on the abnormal problems of the ADSP subsystem.
However, in some scenarios, when an ADSP subsystem is abnormal, the ADSP subsystem will not store the information in the temporary cache into the shared memory of the AP because the anomalies are insufficient to cause the ADSP subsystem to crash; or when the ADSP subsystem is abnormal, the ADSP subsystem is restarted because the ADSP subsystem is not yet started and the crash occurs, and the ADSP subsystem does not store the information in the temporary cache into the shared memory of the AP. Thus, the AP cannot generate ramdump of the ADSP subsystem based on the information in the shared memory, so that a developer cannot determine an abnormality occurring in the ADSP subsystem, and further cannot perform positioning analysis on an abnormality problem occurring in the ADSP subsystem.
In view of this, in the message processing method provided in the embodiment of the present application, when the AP of the electronic device detects that communication time-out occurs with the ADSP subsystem, the AP may trigger a crash exception of the ADSP subsystem. In this way, the ADSP subsystem may store the information in the temporary buffer into the shared memory of the AP, and the AP may generate ramdump of the ADSP subsystem based on the information in the shared memory. And a developer can conduct positioning analysis on abnormal problems generated by the ADSP subsystem through the ramdump.
Fig. 3 shows an overall flowchart of a message processing method according to an embodiment of the present application.
S301, an instruction sent to the ADSP subsystem is overtime.
When the audio module of the hardware abstraction layer at the AP side detects that the instruction sent to the ADSP subsystem is timed out, that is, the audio module does not acquire the response of the ADSP subsystem for a long time, the audio module may send an instruction for triggering the restart (ssr) of the ADSP subsystem to the audio driver of the kernel layer at the AP side.
The time of the instruction timeout may be preset by the audio module, and the time range of the instruction timeout may include 0.5s-2s, for example, the time of the instruction timeout may be set to 1 second, which is not limited in the embodiment of the present application.
In a possible implementation, the audio module may send an instruction of ADSP ssr to the audio driver by means of a write node. Illustratively, the audio module may write the node of ADSP ssr to 1, where 1 may represent triggering ADSP ssr. It will be appreciated that the instructions of ADSP ssr may also be represented by other strings or other data types, and embodiments of the present application are not limited.
After the audio driver acquires an instruction to trigger ADSP ssr, step S302 may be performed.
S302, whether the version is a user test version.
After the audio driver acquires the instruction for triggering the ADSP ssr, different processes can be executed on different versions of the electronic device. The version of the electronic device may include a use version and a user test version, where the use version may be understood as a version used by a user after the release of the version, the use version may be also referred to as a communication version, the user test version may be understood as a version used for testing before the release of the version, and the user test version may be also referred to as a beta user version.
In a possible implementation, for the usage version, in order to better protect the privacy information of the user and improve the user experience, the audio driver may not acquire the ramdump of the ADSP subsystem, and only trigger the ADSP subsystem to restart. For the user test version, in order to better analyze and solve the abnormality of the ADSP subsystem, the audio driver may acquire the ramdump of the ADSP subsystem and trigger the ADSP subsystem to restart.
The audio driver may determine whether the current version is a user test version according to the version identification of the electronic device. The data type of the version identifier may be integer, string, etc. Illustratively, the version identification may be integer, e.g., 1 may represent a usage version and 2 may represent a user test version; alternatively, 1 may represent a user test version and 2 may represent a use version; alternatively, the usage version and the user test version may take other values, which are not limited in the embodiments of the present application.
If the audio driver determines that the version is currently in use, the audio driver may restart the ADSP subsystem after acquiring an instruction to trigger ADSP ssr. If the audio driver determines that the current user test version is the user test version, the audio driver may execute step S303 after acquiring the instruction to trigger ADSP ssr.
S303, whether the keywords are matched.
In some scenarios, ramdump of the ADSP subsystem is insufficient to analyze anomaly problems, at which time, based on the requirements of the chip platform or the requirements of development localization, etc., the electronic device panic, which may also be referred to as the complete machine panic, may be triggered by audio driving. The panic may be understood as a system error occurring in the electronic device, and such a system error may cause problems such as program crash or an operating system stopping response.
It may be appreciated that triggering the complete machine panic may include storing memory information of the complete machine, where the memory information of the complete machine may also be referred to as a complete machine full dump. The overall unit fulldump contains more information than the ramdump of the ADSP subsystem, for example, the overall unit fulldump may include the memory information of the AP and the memory information of all the subsystems. Therefore, a developer can obtain more memory information according to the complete machine fulldump, and the analysis of abnormal problems is facilitated.
In a possible implementation, the electronic device may preset some keywords to indicate triggering of the complete machine panic based on the requirements of the chip platform or the requirements of the developer for positioning the problem, etc. For example, the key may include the thread name, or the reason for triggering the ADSP subsystem ramdump, etc.
When the audio driver matches the keywords, it indicates that there is a need to trigger the complete machine panic, then step S307 may be performed; when the audio driver does not match the keywords, which indicates that the requirement of the complete machine panic is not triggered, step S304 may be performed to trigger a crash exception of the ADSP subsystem.
S304, triggering a crash exception of the ADSP subsystem.
The audio driver triggering the crash exception of the ADSP subsystem may also be understood as the audio driver sending a ssr instruction to the ADSP subsystem, where the ssr instruction may be used to indicate that the ADSP subsystem is crash crashed, so that the crash exception of the ADSP subsystem may be triggered. For example, the instruction for indicating that the ADSP subsystem has a crash may be identified by a string "send_ssr_command" or may be identified by such other string or other data type, which embodiments of the present application are not limited.
When the ADSP subsystem acquires the ssr instruction, the ADSP subsystem may store the information in the temporary buffer into the shared memory of the AP, and further the audio driver may generate ramdump of the ADSP subsystem based on the information in the shared memory.
After triggering the crash exception of the ADSP subsystem, the audio driver may perform step S305.
S305, collecting ramdump of the ADSP subsystem.
The audio driver may generate the ramdump of the ADSP subsystem based on information in the shared memory and may dump the ramdump of the ADSP subsystem into a file, such as a file including an ELF format. The audio driver may also send a restart instruction to the ADSP subsystem, performing step S306.
S306, restarting the ADSP subsystem.
S307, triggering the whole machine panic.
The triggering complete machine panic can refer to the related description in step S303, and will not be described again. After the audio driver triggers the complete machine panic abnormality, step S308 may be executed to restart the complete machine.
S308, restarting the whole machine.
Specifically, FIG. 4 shows a timing diagram for generating the ADSP subsystem ramdump.
S401, an audio module opens a topological graph (open graph).
It will be appreciated that the ADSP subsystem may correspond to different audio algorithm modules for different audio scenarios such as talking, playing music, recording speech, etc. Wherein each audio algorithm module of the ADSP subsystem may have a respective corresponding audio algorithm topology, which may constitute a data link of the audio algorithm. The data link may have preset algorithm modules and algorithm parameters, etc. That is, different audio scenes may correspond to different algorithm modules and/or algorithm parameters.
Illustratively, taking a call scenario as an example, the call scenario may have a corresponding call algorithm topology graph, which may constitute a data link of the call algorithm. When a call is made, the audio module of the hardware abstraction layer can call the open graph interface and transmit the identification of the call scene to the audio driver of the kernel layer. The audio driver may use the data link of the talk scenario in the ADSP subsystem when it recognizes that it is currently the talk scenario.
S402, the audio driver sends an open graph instruction through a link protocol.
After the audio driver acquires the information transmitted by the audio module, the audio driver can send an open graph instruction to the ADSP subsystem through a link protocol, and the ADSP subsystem can start a data link of a related scene. The link protocol may be understood as a protocol for communication between the AP and the ADSP subsystem, and may also be referred to as an inter-core communication protocol.
It will be appreciated that, based on the requirements of the audio module, the audio driver may also send other instructions to the ADSP subsystem via the glove protocol, for example, including an instruction to write data, an instruction to close the audio algorithm topology, etc., which embodiments of the present application are not limited.
S403, an ADSP subsystem is abnormal.
Under normal conditions, taking a call scene as an example, after the ADSP subsystem acquires an open graph instruction of the audio driver, the ADSP subsystem can construct a data link of the call scene. After the data link is constructed, the ADSP subsystem may report a response to the audio driver of the kernel layer and the audio module of the hardware abstraction layer. After the audio module acquires the response, the process related to the call can be continuously executed, and call related data can be transferred to the ADSP subsystem.
Or, after acquiring the instruction of other glink protocols of the audio driver, the ADSP subsystem may also report a response to the audio driver and the audio module.
However, when the ADSP subsystem is abnormal, for example, the ADSP subsystem has a deadlock problem, but the crash has not yet occurred, or the memory space is insufficient when the ADSP subsystem creates a thread, etc., 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, so that the audio module cannot accept the response for a long time, and the corresponding audio service has a problem. In this case, the audio module may perform step S404.
S404, detecting time timeout by the audio module.
When the audio module detects that the instruction sent to the ADSP subsystem is timed out, the audio module may perform step S405. The time of the specific instruction timeout may refer to the description of step S301 in the embodiment corresponding to fig. 3, which is not repeated.
S405, the audio module triggers the ADSP subsystem to restart.
The process of triggering the restart of the ADSP subsystem by the audio module may refer to the related description in step S301 in the embodiment corresponding to fig. 3, which is not described herein.
S406, the audio driver judges that the current user test version is the current user test version.
After the audio driver acquires the instruction of triggering the ADSP subsystem to restart by the audio module, the audio driver can judge that the current test version is the user test version. The audio driver may refer to the description related to step S302 in the embodiment corresponding to fig. 3, which is not described herein.
When the audio driver determines that the user test version is currently present, the audio driver may perform step S407.
S407, the audio driver detects whether the keywords are matched.
The audio driver detecting whether the keywords match may refer to the related description in step S303 of the embodiment corresponding to fig. 3, which is not described herein.
When the audio driver does not match the keyword, step S408 may be performed.
S408, reporting the trigger ADSP ssr reason by the audio driver.
It will be appreciated that there are many reasons for triggering ADSP ssr, and different trigger reasons may have corresponding different reason identifiers. For example, for a scenario where the audio driver triggers ADSP ssr, the reason identifier may be identified by a string "[ hardware. Audio. Service ] restart ADSP, thread name: writer", or may be identified by another string or another data type, which is not limited in the embodiments of the present application.
If the electronic equipment is networked, the audio driver can report the reason for triggering ADSP ssr to the cloud server; if the electronic device is not networked, the audio driver may generate a reason for triggering ADSP ssr locally on the electronic device, and after the electronic device is networked, the audio driver may report the reason for triggering ADSP ssr to the cloud server. By reporting the reason for triggering ADSP ssr to the cloud server, a developer can analyze big data and locate abnormal problems.
After the audio driver reports the reason for triggering ADSP ssr, step S409 may be performed.
S409, the audio driver sends an ADSP subsystem restart ssr instruction.
The audio driver may send ssr instructions to the ADSP subsystem via the glink protocol. The specific adspr instruction may refer to the related description in step S304 in the embodiment corresponding to fig. 3, which is not described herein.
S410, ADSP subsystem crash.
The ADSP subsystem may trigger the ADSP subsystem crash after acquiring the ssr command sent by the audio driver. The ADSP subsystem crash may be understood as that the ADSP subsystem has a crash exception, and the ADSP subsystem may execute a related message processing mechanism, where the ADSP subsystem executing the message processing mechanism may include the ADSP subsystem executing step S411.
S411, synchronizing the memory of the ADSP subsystem.
The ADSP subsystem synchronizing memory may be understood as that the ADSP subsystem synchronizes the memory information in the temporary buffer to the shared memory of the AP. After the ADSP subsystem synchronizes the memory, step S412 may be performed.
S412, triggering an interrupt by the ADSP subsystem.
The ADSP subsystem may report a message for identifying that the ADSP subsystem has a crash to the audio driver of the driver layer, which may also be referred to as the ADSP subsystem triggering an interrupt to the AP side.
S413, the audio driver gathers ramdump of the ADSP subsystem.
After the audio driver acquires the interrupt, the ramdump of the ADSP subsystem can be collected based on the shared memory and related files can be generated for positioning by the developer. In addition, the audio driver may further perform step S414 to restart the ADSP subsystem.
S414, restarting the ADSP subsystem.
In a possible implementation, the audio driver may power down the ADSP subsystem first, then power up the ADSP subsystem again, and load firmware of the ADSP subsystem, so as to restart the ADSP subsystem. The implementation manner of the ADSP subsystem restart is not limited in the embodiment of the application.
It can be appreciated that the message processing method of the embodiments of the present application may be embodied by a related log. For example, when an AP triggers a restart of the ADSP subsystem, the corresponding log may include: restart ADSP. When the audio driver at the AP side triggers the ADSP subsystem to generate a crash, the audio driver may call the instruction of "send_ssr_command", so the corresponding log may include: restart_releas= Trigger ADSP EXCEPTION. In addition, the audio driver may also generate ramdump for the ADSP subsystem, e.g., may generate a file in the corresponding ELF format.
Because the reasons for triggering ADSP ssr are different, for some situations in which the reasons for triggering ADSP ssr are not easy to analyze, according to the requirements of a chip platform or the requirements of a developer for positioning problems, the AP can generate a complete machine fulldump, so that the reasons for triggering ADSP ssr can be conveniently further analyzed and positioned.
Fig. 5 shows a timing diagram for generating the complete dump.
S501, an audio module opens a topological graph (open graph).
The process of opening the topology map by the audio module may refer to the related description in step S401 in the embodiment corresponding to fig. 4, which is not repeated.
S502, the audio driver sends an open graph instruction through a link protocol.
The process of sending the open graph instruction by the audio driver through the link protocol may refer to the related description in step S402 of the corresponding embodiment of fig. 4, which is not described herein.
S503, an ADSP subsystem is abnormal.
The abnormal situation of the ADSP subsystem may refer to the related description in step S403 in the embodiment corresponding to fig. 4, which is not described herein. When an abnormality occurs in the ADSP subsystem such that the audio module does not receive the response for a long time, the audio module may perform step S504.
S504, the audio module detects time timeout.
When the audio module detects that the instruction sent to the ADSP subsystem is timed out, the audio module may perform step S505. The process of detecting the time timeout by the audio module may refer to the related description in step S301 in the embodiment corresponding to fig. 3, which is not described herein.
S505, the audio module triggers the ADSP subsystem to restart.
The process of triggering the restart of the ADSP subsystem by the audio module may refer to the related description in step S301 in the embodiment corresponding to fig. 3, which is not described herein.
S506, the audio driver judges that the current user test version is the current user test version.
The audio driver may refer to the related description in step S302 of the embodiment corresponding to fig. 3, which is not repeated. When the audio driver determines that the user test version is currently present, the audio driver may perform step S507.
S507, the audio driver detects whether the keywords are matched.
The audio driver detecting whether the keywords match may refer to the related description in step S303 of the embodiment corresponding to fig. 3, which is not described herein. When the audio driver matches the keyword, step S508 may be performed.
S508, the audio drive triggers the whole machine fulldump.
The process of triggering the complete machine fulldump by audio driving may refer to the related description in step S303 of the embodiment corresponding to fig. 3, which is not repeated.
The message processing method according to the embodiment of the present application is described in detail below by means of specific embodiments. The following embodiments may be combined with each other or implemented independently, and the same or similar concepts or processes may not be described in detail in some embodiments.
Fig. 6 shows a message processing method according to an embodiment of the present application. The method comprises the following steps:
s601, at a first moment, the AP transmits a first message to the ADSP, and the first message needs to be replied by the ADSP.
In this embodiment, the first time may be understood as a time when the AP transmits the first message to the ADSP.
The first message may be understood as any message that the AP delivers to the ADSP, wherein the first message requires a reply from the ADSP. The first message may include any message that the AP transmits to the ADSP through the link protocol, for example, the first message may include an open graph instruction in the embodiment corresponding to fig. 4, which is not limited in this embodiment.
S602, the AP receives the reply of the ADSP at a second moment, and the second moment is later than the first moment.
In this embodiment of the present application, the second time may be understood as a time when the AP receives the ADSP reply.
And S603, transmitting a second message to the ADSP by the AP at a third moment, wherein the second message needs to be replied by the ADSP, and the third moment is later than the second moment.
In this embodiment, the third time may be understood as a time when the AP transmits the second message to the ADSP.
The second message may refer to the explanation of the first message in step S601, which is not described herein. The second message may be the same as or different from the first message, and the embodiment of the present application does not limit the specific second message.
And S604, at a fourth moment, the AP does not receive the reply of the ADSP, the AP transmits a third message to the ADSP, the third message is used for indicating 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 third moment to the fourth moment exceed a preset time period.
In this embodiment of the present application, the fourth time may be understood as a time when the time interval exceeds the preset period from the third time, and the AP does not receive the ADSP reply.
The third message may be understood as a message or an instruction for letting the ADSP subsystem crash in the embodiment corresponding to fig. 3, for example, the third message may include the "send_ssr_command" instruction in step S304.
The step S411 in the embodiment corresponding to fig. 4 may be referred to by the ADSP to store the memory information of the ADSP in the memory of the AP, and the ADSP subsystem synchronizes the memory, which is not described herein.
And S605, at a fifth moment, the AP obtains a first log, wherein the first log comprises the memory information of the ADSP, and the fifth moment is later than the fourth moment.
In this embodiment of the present application, the fifth time may be understood as a time when the AP obtains the first log.
The first log may be understood as the ramdump of the ADSP subsystem collected by the AP.
When the AP detects a communication timeout with the ADSP subsystem, the AP can trigger a crash exception for the ADSP subsystem. Thus, the ADSP subsystem can store the information in the temporary cache into the shared memory of the AP, the AP can generate ramdump of the ADSP subsystem based on the information in the shared memory, and a developer can position and analyze the abnormal problem of the ADSP subsystem through the ramdump.
Optionally, after the AP transmits the third message to the ADSP on the basis of the embodiment corresponding to fig. 6, between the fourth time and the fifth time, the method may further include: ADSP stores the memory information of ADSP into the memory of AP; the ADSP transmits a fourth message to the AP, wherein the fourth message is used for indicating the AP to obtain the first log based on the memory information of the ADSP.
In this embodiment, the step S411 in the embodiment corresponding to fig. 4 described above may be understood that the ADSP stores the memory information of the ADSP in the memory of the AP, and the ADSP subsystem synchronizes the memory, which is not described again.
The ADSP transmitting the fourth message to the AP may refer to step S412 in the embodiment corresponding to fig. 4, and the ADSP subsystem triggers an interrupt, which is not described herein.
The ADSP stores the information in the temporary cache into the shared memory of the AP, and the AP can generate a log based on the information in the shared memory, so that the positioning analysis of the abnormal problem of the ADSP is realized.
Optionally, on the basis of the embodiment corresponding to fig. 6, the ADSP may transfer the fourth message to the AP, which may include: ADSP triggers an interrupt to AP.
In this embodiment of the present application, the ADSP subsystem triggering interrupt may refer to the description in step S412 in the embodiment corresponding to fig. 4, which is not described in detail. The AP can collect the memory information of the ADSP according to the interrupt message, and further can analyze and locate the abnormal problems of the ADSP.
Optionally, on the basis of the embodiment corresponding to fig. 6, the third message includes: the send_ssr_command message, after the AP delivers the third message to the ADSP, may further include: ADSP restarts.
In the embodiment of the application, the ADSP restarting can recover the abnormality of the ADSP, so that the ADSP can normally run, and the normal experience of a user in an audio scene is ensured.
Optionally, on the basis of the embodiment corresponding to fig. 6, the AP delivering the third message to the ADSP may include: when the AP determines that the electronic device is the user test version, the AP communicates a third message to the ADSP.
In this embodiment of the present application, the description of step S302 in the embodiment corresponding to fig. 3 may be referred to for determining that the electronic device is the user test version by the AP, which is not repeated.
If the electronic device is a user test version, the AP can collect the memory information of the ADSP, so that the abnormality of the ADSP subsystem can be better analyzed and solved.
Optionally, on the basis of the embodiment corresponding to fig. 6, when the AP determines that the electronic device is the user test version, the AP transmits a third message to the ADSP, and may include: when the AP determines that the electronic equipment is a user test version and the AP determines that a thread running in the electronic equipment cannot be matched with a preset field, the AP transmits a third message to the ADSP; the preset fields are related to one or more of the following: thread name, reason for triggering ADSP restart.
In this embodiment of the present application, the AP may refer to the description related to step S303 in the embodiment corresponding to fig. 3, and the description is not repeated herein, where the determining that the thread running in the electronic device cannot be matched to the preset field.
If the electronic device does not match the keyword, which indicates that the requirement of the whole machine panic is not triggered, the AP may transmit a third message to the ADSP, trigger a crash exception of the ADSP subsystem, and further generate a ramdump of the ADSP subsystem.
Optionally, on the basis of the embodiment corresponding to fig. 6, the method may further include: at a sixth moment, the AP transmits a fifth message to the ADSP, and the fifth message needs an ADSP reply; the seventh moment, the AP does not receive the reply of the ADSP, the AP transmits a third message to the ADSP, the seventh moment is later than the sixth moment, and the sixth moment to the seventh moment exceed a preset time period; when the AP determines that the electronic equipment is a user test version and the AP determines that the threads running in the electronic equipment can be matched with the preset fields, the AP obtains a second log, the content of the second log is more than that of the first log, and the second log comprises memory information of ADSP.
In this embodiment of the present application, the sixth time may be understood as a time when the AP transmits the fifth message to the ADSP. The seventh instant may be understood as the instant when the AP delivers the third message to the ADSP.
The fifth message may refer to the explanation of the first message in step S601, and will not be described again. The fifth message may be the same as or different from the first message, and the embodiment of the present application does not limit a specific fifth message. The second log may include the memory information of the AP and the memory information of all the subsystems, for example, the second log may be understood as the complete machine fulldump in step S303 of the embodiment corresponding to fig. 3.
If the electronic equipment is matched with the keyword, the requirement for triggering the complete machine panic is shown, the AP can print the complete machine fulldump, so that a developer can obtain more memory information according to the complete machine fulldump, and the analysis of abnormal problems is facilitated.
Optionally, based on the embodiment corresponding to fig. 6, the second log includes a memory dump file fulldump of the electronic device.
In this embodiment, the second log may be understood as the complete dump in step S303 in the embodiment corresponding to fig. 3.
The overall unit fulldump contains more information than the ramdump of the ADSP subsystem, for example, the overall unit fulldump may include the memory information of the AP and the memory information of all the subsystems. Therefore, a developer can obtain more memory information according to the complete machine fulldump, and the analysis of abnormal problems is facilitated.
Optionally, based on the embodiment corresponding to fig. 6, the first log includes a memory dump file ramdump of the ADSP, and the format of the first log includes an ELF format.
In the embodiment of the application, the AP may generate the ram dump file ramdump of the ADSP subsystem, so that a developer may perform positioning analysis on the abnormal problem occurring in the ADSP subsystem through the ramdump.
Optionally, before the AP transmits the third message to the ADSP, on the basis of the embodiment corresponding to fig. 6, the method may further include: if the electronic equipment is networked, the AP sends the reason of restarting the ADSP to the cloud server; if the electronic equipment is not networked, the AP stores the reason for triggering the ADSP restart in the local area of the electronic equipment, and after the electronic equipment is networked, the AP sends the reason for triggering the ADSP restart to the cloud server.
In this embodiment, the reason why the audio driver sends the ADSP restart to the cloud server may refer to the description related to step S408 in the embodiment corresponding to fig. 4, which is not described herein. By reporting the reason for triggering ADSP ssr to the cloud server, a developer can analyze big data and locate abnormal problems.
Optionally, on the basis of the embodiment corresponding to fig. 6, 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 transfers the third message to the ADSP, the method may include: the audio module determines that no reply of the ADSP is received within a preset time period; the audio module transmits a sixth message to the audio driver, wherein the sixth message is used for indicating the audio driver to execute the process of restarting the ADSP; the audio driver determines the electronic equipment as a user test version; the audio driver determines that the preset field is not matched; the audio driver sends the reason for restarting ADSP to the cloud server; the AP delivering the third message to the ADSP may include: the audio driver delivers a third message to the ADSP; the AP obtaining the first log may include: the audio driver obtains a first log based on the ADSP memory information.
In this embodiment, the sixth message may be understood as the instruction of ssr in step S301 in the embodiment corresponding to fig. 3, for example, the sixth message may include an instruction of writing to an ADSP ssr node. The audio module delivering the sixth message to the audio driver may be understood as step S405 in the embodiment corresponding to fig. 4, where the audio module triggers the ADSP subsystem to restart.
The audio driver may refer to the description related to step S302 in the embodiment corresponding to fig. 3, which is not repeated. The audio driver may refer to the description related to step S303 in the embodiment corresponding to fig. 3, which is not repeated. The reason why the audio driver sends the ADSP restart to the cloud server may refer to the description related to step S408 in the embodiment corresponding to fig. 4, which is not described in detail.
When the audio module detects the communication timeout with the ADSP subsystem, the crash exception of the ADSP subsystem can be triggered, and then the audio driver can execute the related flow of ADSP restarting.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region, and provide corresponding operation entries for the user to select authorization or rejection.
The foregoing description of the solution provided in the embodiments of the present application has been mainly presented in terms of a method. To achieve the above functions, it includes corresponding hardware structures and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the various illustrative method steps described in connection with the embodiments disclosed herein may be implemented as hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application may divide the functional modules of the apparatus implementing the method according to the above method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
Fig. 7 is a schematic structural diagram of a chip according to an embodiment of the present application. Chip 700 includes one or more (including two) processors 701, communication lines 702, communication interfaces 703, and memory 704.
In some implementations, the memory 704 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
The methods described in the embodiments of the present application may be applied to the processor 701 or implemented by the processor 701. The processor 701 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 701 or by instructions in the form of software. The processor 701 may be a general purpose processor (e.g., a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), an off-the-shelf programmable gate array (field-programmable gate array, FPGA) or other programmable logic device, discrete gates, transistor logic, or discrete hardware components, and the processor 701 may implement or perform the methods, steps, and logic diagrams associated with the processes disclosed in the embodiments of the present application.
The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a state-of-the-art storage medium such as random access memory, read-only memory, programmable read-only memory, or charged erasable programmable memory (electrically erasable programmable read only memory, EEPROM). The storage medium is located in the memory 704, and the processor 701 reads information in the memory 704, and in combination with its hardware, performs the steps of the above method.
The processor 701, the memory 704 and the communication interface 703 may communicate with each other via a communication line 702.
In the above embodiments, the instructions stored by the memory for execution by the processor may be implemented in the form of a computer program product. The computer program product may be written in the memory in advance, or may be downloaded in the form of software and installed in the memory.
Embodiments of the present application also provide a computer program product comprising one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions in accordance with embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. 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, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, fiber optic, digital subscriber line (digital subscriber line, DSL), or wireless (e.g., infrared, wireless, microwave, etc.), or semiconductor medium (e.g., solid state disk, SSD)) or the like.
Embodiments of the present application also provide a computer-readable storage medium. The methods described in the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer readable media can include computer storage media and communication media and can include any medium that can transfer a computer program from one place to another. The storage media may be any target media that is accessible by a computer.
As one possible design, the computer-readable medium may include compact disk read-only memory (CD-ROM), RAM, ROM, EEPROM, or other optical disk memory; the computer readable medium may include disk storage or other disk storage devices. Moreover, any connection is properly termed 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 technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, digital versatile disc (digital versatiledisc, DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

Claims (14)

1. A message processing method, characterized in that the method is applied to an electronic device comprising an application processor AP and an audio digital signal processor ADSP, the method comprising:
at a first moment, the AP transmits a first message to the ADSP, wherein the first message requires the ADSP to reply;
the AP receives the reply of the ADSP at a second moment, and the second moment is later than the first moment;
The AP transmits a second message to the ADSP, wherein the second message needs the ADSP to reply, and the third moment is later than the second moment;
the AP does not receive the reply of the ADSP at a fourth moment, and the AP transmits a third message to the ADSP, wherein the third message is used for indicating 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 third moment to the fourth moment exceed a preset time period;
and at a fifth moment, the AP obtains a first log, wherein the first log comprises the memory information of the ADSP, and the fifth moment is later than the fourth moment.
2. The method of claim 1, wherein after the AP delivers the third message to the ADSP, between the fourth time and the fifth time, further comprising:
the ADSP stores the memory information of the ADSP into the memory of the AP;
and the ADSP transmits a fourth message to the AP, wherein the fourth message is used for indicating the AP to obtain the first log based on the memory information of the ADSP.
3. The method of claim 2, wherein the ADSP delivering a fourth message to the AP comprises: the ADSP triggers an interrupt to the AP.
4. A method according to any of claims 1-3, wherein the third message comprises: the send_ssr_command message, after the AP transmits the third message to the ADSP, further includes: the ADSP is restarted.
5. The method of any of claims 1-4, wherein the AP delivering a third message to the ADSP comprises:
and when the AP determines that the electronic equipment is in the user test version, the AP transmits the third message to the ADSP.
6. The method of claim 5, wherein when the AP determines that the electronic device is a user test version, the AP communicates the third message to the ADSP, comprising:
when the AP determines that the electronic equipment is the user test version and the AP determines that the thread running in the electronic equipment cannot be matched with a preset field, the AP transmits the third message to the ADSP; the preset fields are related to one or more of the following: thread name, reason for triggering the ADSP restart.
7. The method according to any one of claims 1-6, further comprising:
at a sixth moment, the AP transmits a fifth message to the ADSP, where the fifth message requires the ADSP reply;
A seventh moment, when the AP does not receive the reply of the ADSP, 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 exceed the preset time period;
when the AP determines that the electronic equipment is a user test version and the AP determines that a thread running in the electronic equipment can be matched with a preset field, the AP obtains a second log, the content of the second log is more than that of the first log, and the second log comprises memory information of the ADSP.
8. The method of claim 7, wherein the second log comprises a memory dump file fulldump for the electronic device.
9. The method of any of claims 1-8, wherein the first log comprises a memory dump file ramdump of the ADSP, and wherein the format of the first log comprises an ELF format.
10. The method according to any one of claims 1-9, wherein before the AP delivers the third message to the ADSP, further comprising:
if the electronic equipment is networked, the AP sends the reason for restarting the ADSP to a cloud server;
If the electronic equipment is not networked, the AP stores the reason triggering the ADSP restarting in the local area of the electronic equipment, and after the electronic equipment is networked, the AP sends the reason triggering the ADSP restarting to the cloud server.
11. The method of claim 1, wherein the hardware abstraction layer of the AP comprises an audio module, the kernel layer of the AP comprises an audio driver,
before the AP delivers the third message to the ADSP, it includes:
the audio module determines that the reply of the ADSP is not received within the preset time period;
the audio module transmits a sixth message to the audio driver, wherein the sixth message is used for indicating the audio driver to execute a process of restarting ADSP;
the audio driver determines the electronic equipment as a user test version;
the audio driver determines that the audio driver is not matched with a preset field;
the audio driver sends the reason for restarting the ADSP to a cloud server;
the AP delivering a third message to the ADSP comprising: the audio driver communicates the third message to the ADSP;
the AP obtains a first log comprising: the audio driver obtains the first log based on the memory information of the ADSP.
12. An electronic device, comprising: a memory for storing a computer program and a processor for executing the computer program to perform the method of any of claims 1-11.
13. A computer readable storage medium storing instructions that, when executed, cause a computer to perform the method of any one of claims 1-11.
14. A computer program product comprising a computer program which, when run, causes an electronic device to perform the method of any one of claims 1-11.
CN202310942746.3A 2023-07-28 2023-07-28 Message processing method and related device Pending CN117714271A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310942746.3A CN117714271A (en) 2023-07-28 2023-07-28 Message processing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310942746.3A CN117714271A (en) 2023-07-28 2023-07-28 Message processing method and related device

Publications (1)

Publication Number Publication Date
CN117714271A true CN117714271A (en) 2024-03-15

Family

ID=90150359

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310942746.3A Pending CN117714271A (en) 2023-07-28 2023-07-28 Message processing method and related device

Country Status (1)

Country Link
CN (1) CN117714271A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160327596A1 (en) * 2015-05-06 2016-11-10 Qualcomm Incorporated Behavioral Analysis To Detect Anomalous Electromagnetic Emissions
CN107360321A (en) * 2017-06-30 2017-11-17 维沃移动通信有限公司 The detection method and mobile terminal of a kind of digital signal processor DSP
CN107545067A (en) * 2017-09-13 2018-01-05 广东欧珀移动通信有限公司 Log information report method, device and storage medium, ADSP and terminal
US20180129828A1 (en) * 2016-11-04 2018-05-10 Qualcomm Incorporated Exclusive execution environment within a system-on-a-chip computing system
CN108541050A (en) * 2018-03-29 2018-09-14 广东欧珀移动通信有限公司 Information processing method, device, mobile terminal and computer readable storage medium
WO2020173377A1 (en) * 2019-02-28 2020-09-03 华为技术有限公司 Log information generating method and apparatus, and electronic device
WO2023130938A1 (en) * 2022-01-10 2023-07-13 荣耀终端有限公司 Method and apparatus for transmitting call audio data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160327596A1 (en) * 2015-05-06 2016-11-10 Qualcomm Incorporated Behavioral Analysis To Detect Anomalous Electromagnetic Emissions
US20180129828A1 (en) * 2016-11-04 2018-05-10 Qualcomm Incorporated Exclusive execution environment within a system-on-a-chip computing system
CN107360321A (en) * 2017-06-30 2017-11-17 维沃移动通信有限公司 The detection method and mobile terminal of a kind of digital signal processor DSP
CN107545067A (en) * 2017-09-13 2018-01-05 广东欧珀移动通信有限公司 Log information report method, device and storage medium, ADSP and terminal
CN108541050A (en) * 2018-03-29 2018-09-14 广东欧珀移动通信有限公司 Information processing method, device, mobile terminal and computer readable storage medium
WO2020173377A1 (en) * 2019-02-28 2020-09-03 华为技术有限公司 Log information generating method and apparatus, and electronic device
WO2023130938A1 (en) * 2022-01-10 2023-07-13 荣耀终端有限公司 Method and apparatus for transmitting call audio data

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
C. INGUIMBERT等: "Anomalies of the ADSP 21060 Onboard the DEMETER Satellite", 《 IEEE TRANSACTIONS ON NUCLEAR SCIENCE》, 21 November 2013 (2013-11-21) *
姚爱琴;张东宁;单永利;: "基于ADSP-BF533的视频监测系统设计", 中北大学学报(自然科学版), no. 01, 28 February 2007 (2007-02-28) *
张小玉;胡卫东;蔡桂芳;: "火控系统智能故障诊断专家系统设计", 信阳师范学院学报(自然科学版), no. 01, 30 January 2006 (2006-01-30) *
龚健;华更新;孙越;衣学慧;: "基于多种并发机制的卫星电子设备地面测试软件设计方法", 空间控制技术与应用, no. 03, 15 June 2012 (2012-06-15) *

Similar Documents

Publication Publication Date Title
CN106557402B (en) Mobile terminal and exception information processing method
CN114553814B (en) Method and device for processing push message
WO2022253158A1 (en) User privacy protection method and apparatus
CN117707439A (en) Log printing method and related device
CN116669064B (en) Wireless protocol testing method and electronic equipment
CN117149476A (en) Fault reporting method and related device
CN113961534B (en) Method and electronic equipment for generating log file
CN116700768A (en) Application processing method and related device
CN117714271A (en) Message processing method and related device
WO2021052489A1 (en) Method for determining fault computing core in multi-core processor and electronic device
CN114816973A (en) Method and device for debugging codes, electronic equipment and readable storage medium
CN114006969B (en) Window starting method and electronic equipment
CN116701320B (en) Log generation method and related device
CN115016665B (en) Frozen screen fault detection method, electronic equipment and computer readable storage medium
CN116662150B (en) Application starting time-consuming detection method and related device
CN112286596A (en) Message display method and electronic equipment
CN116089563B (en) Log processing method and related device
CN115202902B (en) Method for controlling process interaction and related device
CN117076089B (en) Application management method, terminal device and storage medium
CN116089110B (en) Method for controlling process interaction and related device
CN116701134B (en) Data processing method and electronic equipment
CN114650332B (en) Information processing method, system and computer storage medium
CN116662270B (en) File analysis method and related device
CN117858279A (en) SIM card service processing method and related device
CN116737258A (en) Method and related device for unloading application

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination