CN-120750799-B - Communication fault processing method and electronic equipment
Abstract
The embodiment of the application provides a communication fault processing method and electronic equipment, wherein the electronic equipment comprises an AP and an ADSP, at least one first QMI channel exists between the AP and the ADSP, and a second QMI channel and a third QMI channel; the fourth QMI channel is any one of at least one first QMI channel and is used for transmitting data of the first service, if the response of the ADSP to the first message is not overtime, the AP sends a second message to the ADSP through the third QMI channel, the second message is used for requesting to restart a process corresponding to the first service in the ADSP, if the response of the ADSP to the first message is overtime, the AP sends a first instruction to the ADSP, and the first instruction is used for indicating to restart a subsystem running in the ADSP. According to the method, QMI communication is restored by adopting different restarting modes according to different faults, so that influence on the service which does not have faults in an ADSP system is prevented, and user experience is improved.
Inventors
- ZHONG WEI
Assignees
- 荣耀终端股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20240830
Claims (13)
- 1. A method for processing communication failure, the method being executed by an electronic device, wherein the electronic device includes an application processor AP and an application digital signal processor ADSP, at least one first QMI channel for transmitting traffic exists between the AP and the ADSP, and a second QMI channel and a third QMI channel also exist between the AP and a kernel layer of the ADSP, the method comprising: the AP sends a first message to the ADSP through the second QMI channel under the condition of abnormal communication of a fourth QMI channel, wherein the fourth QMI channel is any one of at least one first QMI channel and is used for transmitting data of first service; if the response of the ADSP to the first message is not overtime, the AP sends a second message to the ADSP through the third QMI channel, wherein the second message is used for requesting restarting the process corresponding to the first service in the ADSP; if the response of the ADSP to the first message is overtime, the AP sends a first instruction to the ADSP, wherein the first instruction is used for indicating restarting of a subsystem running in the ADSP.
- 2. The method of claim 1, wherein the AP, before sending a second message to the ADSP via the third QMI channel if the reply to the first message by the ADSP does not timeout, further comprises: If the AP receives a third message sent by the ADSP through the second QMI channel within a first preset time period after the first message is sent, determining that the response of the ADSP to the first message is not overtime; if the AP does not receive the third message sent by the ADSP through the second QMI channel within the first preset duration after sending the first message, the AP determines whether the number of times of sending the first message is equal to a first number threshold; If the number of times of sending the first message is equal to the first time threshold, determining that the response of the ADSP to the first message is overtime; and if the sending times of the first message are smaller than the first time threshold value, returning to the execution step, wherein the AP sends the first message to the ADSP through the second QMI channel.
- 3. The method of claim 2, wherein the AP acts as a server for communication and the ADSP acts as a client for communication during communication based on the second QMI channel.
- 4. A method according to claim 3, wherein the first message is a broadcast notification message, and the second message and the third message are both request messages.
- 5. The method according to claim 4, wherein the method further comprises: If the AP receives the third message sent by the ADSP through the second QMI channel within the first preset duration after sending the first message, the AP sends a fourth message to the ADSP, where the fourth message is a response message of the third message.
- 6. The method of claim 3, wherein prior to the AP sending the first message to the ADSP over the second QMI channel, the method further comprises: In response to the ADSP powering up, the ADSP sends a registration request message to the AP, where the registration request message is used to request registration port information.
- 7. The method of claim 1, wherein after the AP sends a second message to the ADSP over the third QMI channel, the method further comprises: If the AP does not receive a fifth message sent by the ADSP through the third QMI channel within a second preset time period after the second message is sent, the AP sends the first instruction to the ADSP, and the fifth message is a response message of the second message.
- 8. The method of claim 1, wherein a first Glink channel also exists between the AP and a kernel layer of the ADSP, the AP sending a first instruction to the ADSP, the method comprising: The AP sends the first instruction to the ADSP through the first Glink channel; after the AP sends the first instruction to the ADSP, the method further includes: After the subsystem running in the ADSP is restarted successfully, the ADSP sends a first signal to the AP through the first Glink channel.
- 9. The method according to any one of claims 1 to 8, wherein in case of abnormal communication of the fourth QMI channel, the AP further comprises, before sending the first message to the ADSP via the second QMI channel: the AP sends a sixth message to the AP through the fourth QMI channel, wherein the sixth message is used for requesting the data of the first service; If the AP does not receive a seventh message sent by the ADSP through the fourth QMI channel within a third preset time period after the sixth message is sent, determining that the fourth QMI channel is normal in communication; If the AP does not receive the seventh message sent by the ADSP through the fourth QMI channel within the third preset duration after sending the sixth message, determining whether the number of times of sending the sixth message is equal to a second number of times threshold; if the number of times of sending the sixth message is equal to the second number threshold, determining that the fourth QMI channel communication is abnormal; and if the sending times of the sixth message are smaller than the second time threshold, returning to the execution step, wherein the AP sends the sixth message to the AP through the fourth QMI channel.
- 10. The method according to any one of claims 1 to 8, wherein the first QMI channel is used for transmitting sensor traffic data, audio traffic data or charging traffic data.
- 11. The electronic device is characterized by comprising a plurality of processors and a memory, wherein the processors comprise an application processor AP and an application digital signal processor ADSP; the memory is coupled with the plurality of processors, the memory for storing computer program code comprising computer instructions that are invoked by the plurality of processors to cause the electronic device to perform the method of any one of claims 1 to 10.
- 12. A chip system for application to an electronic device, the chip system comprising a plurality of processors including an application processor AP and an application digital signal processor ADSP, the plurality of processors for invoking computer instructions to cause the electronic device to perform the method of any of claims 1 to 10.
- 13. A computer readable storage medium comprising instructions that, when run on an electronic device, cause the electronic device to perform the method of any one of claims 1 to 10.
Description
Communication fault processing method and electronic equipment Technical Field The present application relates to the field of electronic technologies, and in particular, to a method for processing a communication failure and an electronic device. Background The high-pass message interface (qualcomm MESSAGING INTERFACE, QMI) is a message communication mechanism for multiprocessor inter-process communication. QMI is widely used in electronic devices for communication between an application processor (application processor, AP) and a processor of a subsystem, and between an AP and an Application Digital Signal Processor (ADSP), among which QMI communication is one of them. There are a large number of QMI channels between the AP and the ADSP for various traffic data interactions, for example, sensor data interactions, audio data interactions, and power data interactions. Therefore, when the communication of the QMI channel is interrupted, it is important to resume the communication in time for the normal operation of the electronic device. In the conventional art, if a certain QMI channel communication between an AP and an ADSP is interrupted, the ADSP subsystem is restarted to resume the QMI channel communication. However, with this approach, all traffic in the ADSP subsystem is affected, affecting the user experience. Disclosure of Invention The application provides a communication fault processing method and electronic equipment, which can detect the fault condition of the QMI communication function of an ADSP, recover the QMI communication by adopting different restarting modes by different faults, prevent the influence on the business which does not have faults in the ADSP system while recovering the communication, and improve the user experience. In a first aspect, the present application provides a method for processing a communication failure, where the method is executed by an electronic device, the electronic device includes an application processor AP and an application digital signal processor ADSP, at least one first QMI channel for transmitting a service exists between the AP and the ADSP, a second QMI channel and a third QMI channel exist between the AP and a kernel layer of the ADSP, and the method includes, in a case where communication of the fourth QMI channel is abnormal, the AP sending a first message to the ADSP through the second QMI channel, the fourth QMI channel is any one of the at least one first QMI channel, the fourth QMI channel is used for transmitting data of a first service, if a response of the ADSP to the first message is not timed out, the AP sending a second message to the ADSP through the third QMI channel, the second message is used for requesting to restart a process corresponding to the first service in the ADSP, and if a response of the ADSP to the first message is timed out, the AP sends a first instruction to the ADSP, the first instruction is used for instructing to restart a subsystem running in the ADSP. The first QMI channel is also called the traffic QMI channel. The second QMI channel is also called a failure detection QMI channel. The third QMI channel is also referred to as a process restart QMI channel. The fourth QMI channel is, for example, a sensor QMI channel. The first message may be a detected broadcast message in a specific embodiment. The second message may be a process restart request message in a specific embodiment. The first instruction may be a subsystem restart instruction in a specific embodiment. In the communication failure processing method provided in the first aspect of the present application, when the fourth QMI channel is abnormal in communication, the AP sends a first message to the ADSP through the second QMI channel, and determines whether the system-level QMI communication function of the ADSP is normal according to the response of the ADSP to the first message. Since the second QMI channel is the channel between the AP and the kernel layer of the ADSP. Therefore, if the response of the ADSP to the first message is not overtime, it indicates that the system-level QMI communication function of the ADSP is normal, and may be that the process corresponding to the first service running in the ADSP fails, so that the fourth QMI communication function is abnormal, so that the communication of the fourth QMI channel is restored by restarting the process corresponding to the first service in the ADSP, thus preventing the influence on other processes in the ADSP, preventing the influence on other services, and preventing the influence on the use of the user. If the response of ADSP to the first message is overtime, it shows that the system-level QMI communication function of ADSP is abnormal, and the system-level QMI communication function is recovered by restarting the ADSP subsystem, so that the communication of the currently-found fault QMI channel (namely, the fourth QMI channel) is recovered, the communication of other QMI channels is