CN-122019290-A - USB communication exception processing method, computing device and storage medium
Abstract
The disclosure relates to a processing method, a computing device and a storage medium for USB communication abnormality, which are applied to a USB host and comprise the steps of responding to the USB host and the USB device communication abnormality, sending a reset signal to the USB device through an auxiliary channel of a non-USB channel, determining that the USB device receives the reset signal to reset and releases the reset, enabling the USB host to enter waiting time, responding to the detection of a connection event with the USB device, and initiating first enumeration to the USB device after the waiting time to reestablish USB communication connection with the USB device. The method provided by the application reduces the recovery time after communication abnormality, and simultaneously resets only equipment with communication abnormality, reduces the influence on other services in the system, and further improves the user experience.
Inventors
- LIU NING
- ZHAO XIAOBO
- Hu mingcheng
- FANG BINBIN
- Shen Zhulong
Assignees
- 先临三维科技股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251231
Claims (15)
- 1. A USB communication exception handling method is applied to a USB host, and comprises the following steps: Responding to abnormal communication between the USB host and the USB equipment, and sending a reset signal to the USB equipment through an auxiliary channel of a non-USB channel; determining that the USB host enters waiting time after the USB device receives the reset signal to reset and releases the reset, and In response to detecting a connection event with the USB device, initiating a first enumeration to the USB device after the waiting time to reestablish a USB communication connection with the USB device.
- 2. The method of claim 1, wherein one master processor in a computing device is defined as the USB host and one or more slave processors in the computing device are defined as the USB device.
- 3. The method of claim 1, wherein prior to sending a reset signal to the USB device over an auxiliary channel other than the USB channel, further comprising: The USB host resets, wherein the resetting comprises resetting a USB controller and a physical layer interface of the USB host; Initiating a second enumeration to the USB device after the USB host releases the reset; and responding to the second enumeration failure, and sending a reset signal to the USB device through an auxiliary channel of a non-USB channel.
- 4. The method of claim 1, further comprising: responding to the first enumeration failure, and resetting the USB host; And after the USB host releases reset, initiating third enumeration to the USB device.
- 5. The method of claim 1, wherein the communication exception refers to monitoring for an enumeration failure event or a signal integrity exception event.
- 6. The method of claim 1, wherein the USB host and a plurality of USB devices are connected, and transmitting a reset signal to the USB devices through an auxiliary channel other than a USB channel comprises: and responding to normal communication between the USB host and at least one USB device, and sending a reset signal to the USB device with abnormal communication through an auxiliary channel of a non-USB channel.
- 7. The method of any of claims 1-6, wherein the auxiliary channel is at least one of GPIO, UART, SPI, I C.
- 8. A USB communication exception handling method is applied to USB equipment and comprises the following steps: Receiving a reset signal sent by a USB host, wherein the reset signal is sent by the USB host through an auxiliary channel of a non-USB channel under the condition that the USB host responds to abnormal communication of the USB host and the USB device; performing a reset and releasing the reset after a first period of time, and And receiving a first enumeration initiated by the USB host, and reestablishing USB communication connection with the USB host in response to the first enumeration, wherein the first enumeration is initiated by the USB host after the USB device releases reset to enter waiting time, and responds to detection of a connection event with the USB device and after the waiting time.
- 9. The method of claim 8, wherein the performing the reset and releasing the reset after the first duration comprises: Resetting is carried out, and a USB controller and a physical layer interface of the USB device are reset; the reset is released after the first period of time and waits for a second period of time.
- 10. The method of claim 8, wherein prior to receiving the reset signal sent by the USB host, further comprising: Receiving a second enumeration sent by the USB host, and establishing USB communication connection with the USB host in response to the second enumeration, wherein the second enumeration is initiated after the USB host resets and releases the reset; and ending the processing flow of USB communication exception in response to the second enumeration success, or waiting for a reset signal sent by the USB host in response to the second enumeration failure.
- 11. A USB communication exception handling method is applied to a computing device comprising a USB host and a USB device, and comprises the following steps: the USB host responds to abnormal communication between the USB host and the USB equipment, and the USB host sends a reset signal to the USB equipment through an auxiliary channel of a non-USB channel; The USB equipment receives a reset signal sent by the USB host, executes reset and releases the reset after a first duration; The USB host enters waiting time; the USB host initiating a first enumeration to the USB device after the waiting time in response to detecting a connection event with the USB device, and The USB device receives the first enumeration, and reestablishes USB communication connection with the USB host in response to the first enumeration.
- 12. The method of claim 10, wherein one master processor in the computing device is defined as the USB host and one or more slave processors in the computing device are defined as the USB device.
- 13. A computing device comprising a USB host and a USB device, wherein the USB host is configured to: Responding to abnormal communication between the USB host and the USB equipment, and sending a reset signal to the USB equipment through an auxiliary channel of a non-USB channel; determining that the USB device receives the reset signal to reset and release the reset, entering the waiting time, and In response to detecting a connection event with the USB device, initiating a first enumeration to the USB device after the latency to reestablish a USB communication connection with the USB device; The USB device is configured to: Receiving a reset signal sent by the USB host, wherein the reset signal is sent by the USB host through an auxiliary channel of a non-USB channel under the condition that the USB host and the USB device are abnormal in communication; performing a reset and releasing the reset after a first period of time, and And receiving a first enumeration initiated by the USB host, and reestablishing USB communication connection with the USB host in response to the first enumeration, wherein the first enumeration is initiated by the USB host after the USB device releases reset to enter waiting time, and responds to detection of a connection event with the USB device and after the waiting time.
- 14. The computing device of claim 13, wherein one master processor in the computing device is defined as the USB host and one or more slave processors in the computing device are defined as the USB device.
- 15. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method for handling USB communication anomalies according to any one of claims 1 to 12.
Description
USB communication exception processing method, computing device and storage medium Technical Field The present disclosure relates to the field of computer technologies, and in particular, to a method for processing a USB communication exception, a computing device, and a storage medium. Background As embedded systems have increased in complexity, multiprocessor co-architecture has become a mainstream solution to meet high performance computing requirements. In such systems, universal serial bus (Universal Serial Bus, USB) is often used for high-speed interconnection between processors due to its transmission efficiency and deployment cost advantages. However, in the scenario that the internal multiprocessor of the device is interconnected through the USB, due to the inaccessible physical layer (PHYSICAL LAYER Inaccessibility), once the communication abnormality occurs (for example, the host cannot identify the device), the related method can only realize the restoration by forcibly resetting the complete machine system under the condition that the connection cannot be restored by the manual plug operation. However, the mode of resetting the whole system is long (for example, the time is more than or equal to 20 seconds), and the system reset also causes the operation of the associated service terminal, so that the user experience is poor. Disclosure of Invention In order to solve the technical problems described above, embodiments of the present disclosure provide a method for processing a USB communication exception, a computing device, and a storage medium. In a first aspect, an embodiment of the present disclosure provides a method for processing a USB communication exception, which is applied to a USB host, including: Responding to abnormal communication between the USB host and the USB device, and sending a reset signal to the USB device through an auxiliary channel of a non-USB channel; Determining the waiting time of the USB host after the USB device receives the reset signal to reset and releases the reset, and In response to detecting a connection event with the USB device, a first enumeration is initiated to the USB device after the waiting time to reestablish a USB communication connection with the USB device. In a second aspect, an embodiment of the present disclosure provides a method for processing a USB communication exception, which is applied to a USB device, including: Receiving a reset signal sent by a USB host, wherein the reset signal is sent by the USB host through an auxiliary channel of a non-USB channel under the condition that the USB host responds to abnormal communication of the USB host and USB equipment; And receiving a first enumeration initiated by the USB host, and reestablishing the USB communication connection with the USB host in response to the first enumeration, wherein the first enumeration is initiated by the USB host after the USB device releases the reset into the waiting time, in response to detecting a connection event with the USB device and after the waiting time. In a third aspect, an embodiment of the present disclosure provides a method for processing a USB communication exception, applied to a computing device including a USB host and a USB device, including: The USB host responds to abnormal communication between the USB host and the USB device, and the USB host sends a reset signal to the USB device through an auxiliary channel of a non-USB channel; The USB equipment receives a reset signal sent by the USB host, executes reset and releases the reset after a first duration; The USB host enters waiting time; The USB host initiating a first enumeration to the USB device after a wait time in response to detecting a connection event with the USB device, and The USB device receives the first enumeration, and reestablishes a USB communication connection with the USB host in response to the first enumeration. In a fourth aspect, embodiments of the present disclosure provide a computing device comprising a USB host and a USB device, wherein the USB host is configured to: Responding to abnormal communication between the USB host and the USB device, and sending a reset signal to the USB device through an auxiliary channel of a non-USB channel; Determining that the USB device receives the reset signal to reset and release the reset, entering the waiting time, and In response to detecting a connection event with the USB device, initiating a first enumeration to the USB device after the waiting time to reestablish a USB communication connection with the USB device; the USB device is configured to: Receiving a reset signal sent by a USB host, wherein the reset signal is sent by the USB host through an auxiliary channel of a non-USB channel under the condition that the USB host responds to abnormal communication of the USB host and USB equipment; performing a reset and releasing the reset after a first period of time, and And receiving a first enumeration initiated by the