Method for finding interrupt device, slave device, master device and storage medium
By receiving and recording task process information in the connection device between the slave device outside USB and the master device, finding and re-enuming interrupted slave devices, the problem of abnormal device disconnection is solved, and troubleshooting efficiency and automatic recovery capabilities are improved. .
Patent Information
- Application Number
- CN202010714129.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-22
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2040-07-22
AI Technical Summary
After a large number of external USB slave devices are connected to the master device, it is easy to cause abnormal disconnection of the device due to problems such as power supply of the main board and operating system stability of the master device. It is difficult to quickly find the interrupted slave device in an unattended environment, resulting in Difficulty in troubleshooting.
By establishing a connection device between the slave and the master device, each device receives and records task process information, uses the interrupted task process information to find the interrupted slave device, and re-enumerates the connections if necessary to restore communication.
It realizes the quick find interrupted slave devices when the device is disconnected abnormally, improves troubleshooting efficiency, ensures that the device automatically re-communicates when unattended, and solves the interruption caused by the power supply of the master device and the stability of the operating system. Open the problem.
Smart Images

Figure CN114050965B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to, but are not limited to, the field of device circuits, and specifically, to, but are not limited to, a method for searching for an interrupt device, a master-slave device, a terminal, and a storage medium. Background Art
[0002] The quality of USB cables and USB-HUBs on the market varies. Some products have low stability, which causes the USB external slave device to be abnormally disconnected from the main control device due to various reasons when the device is connected and communicated with the main control device for a long time. There are problems such as power supply problems of the main control device motherboard and operating system stability that cause the USB external slave device to be abnormally disconnected from the main control device. Especially when a large number of slave devices are connected to the main control device and in an unattended environment, the task is easily interrupted, such as when the user is copying an oversized file or connecting a mobile phone to perform other tasks. If the user connects a lot of devices, it will be very troublesome for the user to find the device for troubleshooting, and it is not easy to find the disconnected slave device from the prompt in the main control device's operating system. Summary of the invention
[0003] The method for searching for interrupted devices, slave devices, master devices and storage media provided by the embodiments of the present invention mainly solve the technical problem that when a large number of slave devices are connected to a master device, the USB external slave device is abnormally disconnected from the master device and the interrupted slave device cannot be found as soon as possible.
[0004] In order to solve the above technical problem, an embodiment of the present invention provides a method for searching an interrupt device, the method is applied to a USB external slave device, the number of the slave devices is at least two, and the method comprises:
[0005] Each slave device is connected to the master device via a connecting device; the connecting device includes at least two ports;
[0006] Each slave device receives the task progress information sent by the master device respectively; the task progress information includes: the task progress information recorded when the master device and the corresponding slave devices execute each task;
[0007] When the task process information interruption sent by the master device is received, the interrupted slave device is found according to the interrupted task process information.
[0008] The embodiment of the present invention further provides a method for searching an interrupt device, the method being applied to a master device, and the method comprising:
[0009] Access each slave device through the connecting device;
[0010] Recording task progress information of each task executed by each slave device and the master device;
[0011] The task progress information of the master device and the corresponding slave devices executing each task is sent to each slave device respectively; the task progress information sent to each slave device is used for each slave device to find the interrupted slave device according to the received task information when the task progress information sent by the master device is interrupted.
[0012] An embodiment of the present invention further provides a USB external slave device, the slave device comprising a processor, a memory and a communication bus;
[0013] The communication bus is used to realize the connection and communication between the processor and the memory;
[0014] The processor is used to execute one or more computer programs stored in the memory to implement each step of the above method for searching for an interrupt device.
[0015] An embodiment of the present invention further provides a master device, the master device comprising a processor, a memory and a communication bus;
[0016] The communication bus is used to realize the connection and communication between the processor and the memory;
[0017] The processor is used to execute one or more computer programs stored in the memory to implement each step of the above method for searching for an interrupt device.
[0018] An embodiment of the present invention also provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to implement the steps of the above-mentioned method for searching for interrupt devices.
[0019] An embodiment of the present invention also provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to implement the steps of the above-mentioned method for searching for interrupt devices.
[0020] According to the method for finding an interrupted device, slave device, master device and storage medium provided by the embodiment of the present invention, each slave device is connected to the master device through a connecting device, and each slave device receives the task progress information of the master device and each corresponding slave device executing each task sent by the master device. In certain implementation processes, when a large number of USB external slave devices are abnormally disconnected from the main control device, including but not limited to, the interrupted slave device can be found as soon as possible, thereby facilitating the user to find the device as soon as possible for troubleshooting and improving the troubleshooting efficiency.
[0021] Other features and corresponding beneficial effects of the present invention are described in the latter part of the specification, and it should be understood that at least part of the beneficial effects become obvious from the description in the specification of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A basic flow chart of a method for searching for interrupt devices according to the first embodiment of the present invention;
[0023] Figure 2 A detailed flow chart of a method for searching for an interrupt device according to the second embodiment of the present invention;
[0024] Figure 3 A basic flow chart of a method for searching for an interrupt device according to a third embodiment of the present invention;
[0025] Figure 4 This is a diagram showing a selection box interface of a master device in Embodiment 3 of the present invention;
[0026] Figure 5 An interface diagram showing a countdown prompt box displayed by a master device in Embodiment 3 of the present invention;
[0027] Figure 6 Another interface diagram of a countdown prompt box displayed by a master device in Embodiment 3 of the present invention;
[0028] Figure 7 A detailed flow chart of a method for searching an interrupt device according to a fourth embodiment of the present invention;
[0029] Figure 8 This is a flow chart of a normal device connection method according to Embodiment 5 of the present invention;
[0030] Fig. 9 This is a flowchart of the abnormal disconnection between the mobile phone and the PC and the implementation on the PC side according to the fifth embodiment of the present invention;
[0031] Fig.10 This is a flowchart of the abnormal disconnection between the mobile phone and the PC and the implementation on the mobile phone side according to the fifth embodiment of the present invention;
[0032] Fig.11 This is a schematic diagram of the composition of a USB external slave device according to a sixth embodiment of the present invention;
[0033] Fig.12 A schematic diagram of the composition of a main device according to Embodiment 7 of the present invention;
[0034] Fig.13 This is a schematic diagram of the structure of a USB external slave device according to Embodiment 8 of the present invention;
[0035] Fig.14 This is a schematic diagram of the structure of a main device according to Embodiment 9 of the present invention. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the following is a further detailed description of the embodiments of the present invention through specific implementation methods combined with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0037] Embodiment 1:
[0038] In order to solve the technical problem that when a large number of slave devices are connected to a master device, the interrupted slave device cannot be found as soon as possible due to abnormal disconnection of the USB external slave device and the master device, the present invention provides a method for finding the interrupted device. The method for finding the interrupted device proposed by the present invention is described below in conjunction with an embodiment.
[0039] See also Figure 1 , Figure 1 A basic flow chart of a method for searching for an interrupt device provided in Embodiment 1 of the present invention, the method comprising:
[0040] S101. Each slave device is connected to a master device via a connecting device.
[0041] In this embodiment, this method is applied to a USB external slave device, which may be a mobile phone, a camera, a printer, a smart watch, a tablet computer, etc. This is just an example and is not limited to the above slave devices. The number of slave devices in this embodiment is at least two. The connecting device may be a hub or an OTG connector. The connecting device includes at least two ports for accessing the slave device.
[0042] In some embodiments, the protection process may be initiated after the connecting device is connected to each slave device.
[0043] In some embodiments, after connecting the main device through the connecting device, it can also include: receiving the port information of the connecting device of each slave device connected to the main device, and forming a mapping relationship between each slave device and each port information; finding the interrupted slave device according to the interrupted task process information also includes: finding the port information corresponding to at least one slave device according to the mapping relationship between each slave device and each port information, and the at least one slave device is an interrupted slave device. After receiving the port information, it can be displayed on the screen of the slave device, which is convenient for users to find the corresponding port.
[0044] S102. Each slave device receives task progress information sent by the master device.
[0045] The task progress information includes: the task progress information recorded when the master device and the corresponding slave devices execute each task; wherein the executed tasks may be copying files, charging, controlling other tasks of the slave devices, etc.
[0046] In some embodiments, the task progress information content specifically includes: the last recorded file size information, the file binary code, and the task information.
[0047] In some embodiments, the master device starts task information to the protection process, and then continuously receives the task execution flag sent by the master device, that is, the task process information.
[0048] In some embodiments, the task progress information sent by the master device is received in at least one of the following ways: media transfer protocol MTP mode, ADB mode, wifi, control instructions transmitted through USB or small computer system interface SCSI instructions, and information exchange connection is established by establishing TCP / IP communication with the master device through the slave device virtual remote network driver interface specification RNIDS port. In this way, adding a communication protocol based on the USB protocol allows both the master device and the slave device to obtain the status of the task. For example, whether the task is in progress or has ended. If the master device is disconnected from the slave device when the task is not executed, there is no need to restart the task after the connection is automatically restored. If the connection is disconnected during task execution, the task can be re-executed after the connection is automatically restored.
[0049] The information exchange by sending USB transfer control tranfer contrl and scsi instructions is similar to the way of establishing TCP / IP communication with the main device through the slave device virtual remote network driver interface specification RNIDS port, and the transmission information needs to be translated into binary instructions.
[0050] S103. When receiving the task process information interruption sent by the master device, find the interrupted slave device according to the interrupted task process information.
[0051] In some embodiments, finding the interrupted slave device according to the interrupted task progress information includes: each slave device can detect the received task progress information by itself, and when the task progress information is not updated, the slave device that should execute the specific task is found according to the task progress information of the specific task that has not been updated, and the slave device is the interrupted slave device. In this embodiment, when a slave device with unupdated task progress information is detected, the interruption prompt information can be displayed on the display screen of the slave device or a sound prompt can be emitted.
[0052] In some embodiments, after finding the interrupted slave device according to the interrupted task process information, it also includes that the interrupted slave device re-enumerates itself or an external device re-enumerates the interrupted slave device to restore the connection between the interrupted slave device and the master device. The interrupted slave device re-enumerates the slave devices of the terminal by itself, including: switching the connection mode between the interrupted slave device and the master device or pulling down the DP signal line level or controlling the connection between the master device and the interrupted slave device through a digital relay in the interrupted slave device. The switching connection mode between the interrupted slave device and the master device can be one of the following: charging only, multimedia transmission MTP mode, file transfer, image transfer, etc. Pulling down the DP signal line level can be forced to pull it down by the USB controller of the slave device. And re-enumerating the interrupted slave device by an external device to control the connection of the interrupted slave device of the master device can be a digital relay externally connected to the slave device.
[0053] In some embodiments, when receiving the task progress information interruption sent by the receiving master device, it is detected whether the task progress information of the interrupted slave device only contains charging information. If it only contains charging information, there is no need to re-enumerate the interrupted slave device. In this way, when the slave device is disconnected from the master device, it can automatically determine whether it needs to re-establish the connection with the PC. If it is not performing a task with the PC, such as only charging, it does not need to re-establish the connection with the PC.
[0054] In some embodiments, when the slave device is connected to the master device, the slave device may automatically compensate the voltage and current of the VCC line during re-enumeration to achieve a stable connection.
[0055] In some embodiments, the interruption of receiving the task progress information of the master device includes: not receiving the task progress information of the master device within a preset time.
[0056] In some embodiments, when the interrupted slave device is repeatedly enumerated in multiple ways and still fails to restore the connection between the interrupted slave device and the master device, the port information of the interrupted slave device connected to the connecting device can be displayed on the screen of the slave device to prompt the user, so that the user can take corresponding actions in time to solve the technical problem caused by the physical connection disconnection. In particular, a sound alarm can also be issued when repeated enumeration still fails to establish a connection with the master device.
[0057] In some embodiments, after the interrupted slave device is re-enumerated, the interrupted slave device and the master device are connected again, and the task progress information of the master device is continued to be received, and the task is continued from the breakpoint. After the task is completed, the slave device sends all the acquired task progress information to the master device, and the master device verifies it. After the verification passes, the task is terminated. If the verification fails, the task is re-executed, and the task progress information is sent to the slave device again. The task completion can be a sign of the completion of the task sent by the master device. When the device is connected to the master device via an OTG connector, the master device can record whether the task is completed, and the slave device re-executes the task when the connection is re-established.
[0058] The method for finding an interrupted device provided by an embodiment of the present invention connects each slave device to a master device through a connecting device, and each slave device receives the master device and the task process information executed by each slave device sent by the master device. When a large number of USB external slave devices, including but not limited to, are abnormally disconnected from the main control device, the interrupted slave device can be found as soon as possible, thereby facilitating the user to find the device as soon as possible for troubleshooting and improving the troubleshooting efficiency.
[0059] Embodiment 2:
[0060] The method for finding interrupted devices of the present invention enables to find the interrupted slave devices as soon as possible when a large number of USB external slave devices are abnormally disconnected from the main control device. For ease of understanding, the method for finding interrupted devices of the present invention is described below in conjunction with an application scenario.
[0061] Figure 2 This is a detailed flow chart of a method for searching for an interrupt device according to Embodiment 2 of the present invention, the method comprising:
[0062] S201. Each slave device is connected to the master device via a connecting device.
[0063] In some embodiments, the method is applied to a USB external slave device, which may be a mobile phone, a camera, a printer, a smart watch, a tablet computer, etc. This is just an example and is not limited to the above slave devices. The number of slave devices in this embodiment is 200. The connecting device may be a hub HUB, which includes at least 200 ports for accessing the slave devices.
[0064] S202: Receive the port information of the connection device of each slave device connected to the master device, and form a mapping relationship between each slave device and each port information.
[0065] S203. Each slave device receives task progress information of each task executed by the master device and each corresponding slave device, sent by the master device.
[0066] In this embodiment, the task progress information content specifically includes: the last recorded file size information, the file binary code, and the task information.
[0067] In this embodiment, the task progress information sent by the master device is received in at least one of the following ways: media transfer protocol MTP mode, ADB mode, wifi, USB transmission control instructions or small computer system interface SCSI instructions, and connecting to the master device through the virtual remote network driver interface specification RNIDS port of the slave device. In this way, adding a communication protocol based on the USB protocol can enable both the master device and the slave device to obtain the status of the task.
[0068] S204. When it is detected that a slave device has not received the task progress information of the master device within a preset time, the interrupted slave device is found according to the interrupted task progress information, the interrupted slave device is automatically re-enumerated, and the connection between the interrupted slave device and the master device is restored.
[0069] In this embodiment, finding the interrupted slave device according to the interrupted task progress information includes: each slave device can detect the received task progress information by itself, and when the task progress information is not updated, then according to the specific task that has not been updated, according to the task progress information of the specific task, find the slave device that should execute the specific task, and the slave device is the interrupted slave device. In this embodiment, when a slave device with unupdated task progress information is detected, the interruption prompt information can be displayed on the display screen of the slave device or a sound prompt can be emitted.
[0070] Re-enumerating the slave devices of the terminal includes: switching the connection mode between the interrupted slave device and the master device or forcibly pulling down the DP signal line level or controlling the connection between the master device and the interrupted slave device through a digital relay in the interrupted slave device. The switching connection mode between the interrupted slave device and the master device may be one of the following: charging only, multimedia transmission MTP mode, file transfer, image transfer, etc.
[0071] The method for finding an interrupted device provided by an embodiment of the present invention comprises: each slave device connects each slave device to a master device through a connecting device, and each slave device receives port information of a connecting device of each slave device connected to the master device. Each slave device receives the master device sent by the master device and the task process information executed by each corresponding slave device. When it is detected that a device has not received the task process information of the master device within a preset time, the interrupted slave device is found according to the interrupted task process information, the interrupted slave device is automatically re-enumerated, and the connection between the interrupted slave device and the master device is restored. When a large number of USB external slave devices are connected to the master device and there is an abnormal disconnection between the slave device and the master device, the interrupted slave device can be found as soon as possible, and the connection between the slave device and the master device can be re-established, so that the device can automatically re-communicate with the master device in an unattended state, and the problem of abnormal disconnection between the USB external slave device and the master device caused by the power supply problem of the mainboard of the master device, the stability of the operating system, etc. is promptly eliminated. In a scenario with a large number of devices, the user can quickly find the host port connected to the device through the abnormal device, so that the user can quickly eliminate the problem.
[0072] Embodiment three:
[0073] In order to solve the technical problem that when a large number of slave devices are connected to a master device, a USB external slave device is abnormally disconnected from the master device and the interrupted slave device cannot be found as soon as possible, the present invention provides a method for finding an interrupted device. The method for finding an interrupted device proposed by the present invention is described below in conjunction with an embodiment.
[0074] See also Figure 3 , Figure 3 A basic flow chart of a method for searching an interrupt device provided in Embodiment 3 of the present invention, the method comprising:
[0075] S301, access each slave device through a connecting device.
[0076] In this embodiment, the method is applied to a main device, which may be a mobile phone, a smart watch, a computer, etc. This is just an example and is not limited to the above main devices. The connecting device may be a hub or an OTG connector.
[0077] In some embodiments, after connecting to each slave device through the connecting device, the protection process can be started. After connecting to each slave device through the connecting device, the process can also include: obtaining the port information of each slave device corresponding to the connecting device connected to the master device; and sending the port information to each slave device connected to the corresponding port. After obtaining the port information of each slave device corresponding to the connecting device connected to the master device, it can be displayed on the screen of the master device.
[0078] In some embodiments, obtaining the port information of each slave device corresponding to the connection device connected to the master device may also include: obtaining the port information and the serial number of each slave device corresponding to the port information; binding the port information with the serial number of each slave device corresponding to the port information and storing them in the master device. The information binding the display port information with the serial number of each slave device corresponding to the port information may also be displayed on the screen of the master device.
[0079] S302, recording the task progress information of each slave device and the master device.
[0080] In some embodiments, recording the task progress information of each slave device and the master device can be recorded in real time. Recording the task progress information of each slave device and the master device can include: starting the task, sending the start information to the protection process of the slave device. The master device continuously sends the task execution mark to the slave device. The task execution mark is the task progress information, and the process information includes: the file size information recorded last time, the file binary code, and the task information.
[0081] It is worth noting that in some embodiments, each port information and the serial number of each slave device corresponding to each port information are obtained; each port information and the serial number of each slave device corresponding to each port information are bound and stored in the master device;
[0082] Recording the task progress information of each task executed by each slave device and the master device includes: binding the task progress information corresponding to each task to the serial number and port information of each corresponding slave device respectively.
[0083] S303, sending task progress information of the master device and the corresponding slave devices executing each task to each slave device respectively.
[0084] It is worth noting that the task progress information sent to each slave device can be used to find the interrupted slave device according to the received task information when the task progress information sent by the master device is interrupted.
[0085] Wherein, when the task process information sent by the master device is interrupted, each slave device finds the interrupted slave device according to the received task information, and the master device can also find the interrupted slave device by finding the serial number of the corresponding slave device bound to the task process information according to the recorded task process information. Alternatively, the master device can find the port position by finding the port information of the corresponding slave device bound to the task process information according to the recorded task process information.
[0086] In some embodiments, when the recording of task progress information between each slave device and the master device is abnormally interrupted, the interrupted slave device is waiting to be restored to the master device; wherein the recording of task progress information between each slave device and the master device is abnormally interrupted, that is, the slave device and the master device are abnormally interrupted. When the interrupted slave device is restored to the master device, a selection box or a countdown prompt box is displayed on the master device. Among them, the judgment condition for the interrupted slave device to restore the connection with the master device can be based on obtaining the serial number of the slave device that has been restored to the connection, and comparing the serial number with the serial number of the slave device that has not completed the task before. If they are consistent, a selection box or a countdown prompt box is displayed on the master device, wherein the selection box can be as follows: Figure 4 As shown, the content of the selection box can be a selection box that prompts whether to continue or terminate. The countdown prompt is to automatically continue the task. The countdown prompt box can be as follows Figure 5 As shown, it can also be set as Figure 6 When the task is automatically continued after the countdown ends, the master device continues to record the task progress information in real time and can send it to the slave device in real time or according to a preset period until the task ends. When the task ends, the task end flag can be sent to the slave device.
[0087] In some embodiments, after sending the task end mark to the slave device, a verification file of the slave device is received, and the verification file is the task progress data received by the slave device from the master device. The master device compares the verification data with the task progress data recorded by the master device, and if they are consistent, the task ends. If they are inconsistent, the task is re-executed.
[0088] The method for finding an interrupted device provided by an embodiment of the present invention connects each slave device to a master device through a connecting device, the master device records the task progress information of each slave device and the master device, and the master device sends the task progress information of the master device and each corresponding slave device executing each task to each slave device. When a large number of USB external slave devices, including but not limited to, are abnormally disconnected from the main control device, the interrupted slave device can be found as soon as possible according to the task progress information.
[0089] Embodiment 4:
[0090] The method for finding interrupted devices of the present invention enables to find the interrupted slave devices as soon as possible when a large number of USB external slave devices are abnormally disconnected from the main control device. For ease of understanding, the method for finding interrupted devices of the present invention is described below in conjunction with an application scenario.
[0091] Figure 7 This is a detailed flow chart of a method for searching an interrupt device according to a fourth embodiment of the present invention, the method comprising:
[0092] S701. Access each mobile phone through a connecting device.
[0093] In this embodiment, the method is applied to a master device, which is a computer, wherein the connecting device is a hub, and each slave device is a mobile phone.
[0094] S702, obtaining the port information of the connection device corresponding to each mobile phone connected to the computer and the serial number of each mobile phone corresponding to each port information.
[0095] S703: Display the information of each display port and the binding information of the corresponding serial number of each mobile phone on the screen of the computer.
[0096] S704, recording the task progress information of each mobile phone and computer in real time.
[0097] The task execution mark is the task process information, and the process information includes: the last recorded file size information, file binary code, task information, and path.
[0098] S705, sending task progress information of the computer and the corresponding mobile phones executing the tasks to each mobile phone respectively.
[0099] The task progress information is the task progress information of the mobile phone and the computer. Multiple mobile phones are connected to the computer, and there are multiple task progress information. Each mobile phone receives the task progress information of the mobile phone and the computer.
[0100] S706, detecting whether there is an abnormal interruption between the mobile phone and the computer.
[0101] In this embodiment, when there is an abnormal interruption between the mobile phone and the computer, S707 is executed. When there is no interruption, S714 is executed.
[0102] S707. Detect whether the disconnected mobile phone and computer are restored.
[0103] When the connection is restored, execute S708. Otherwise, execute S715.
[0104] S708. Display a selection box on the computer screen.
[0105] The selection box has two options: "Continue" and "Terminate". When the user clicks "Continue", S709 is executed.
[0106] S709. The computer continues the task from the breakpoint until the task is completed and sends a task completion flag to the mobile phone.
[0107] S710. Receive the verification file sent by the mobile phone.
[0108] S711. Verify the verification file sent by the mobile phone.
[0109] When the verification file and the task process information recorded on the computer are consistent, if the verification is successful, S712 is executed. If the verification fails, S713 is executed.
[0110] S712, end.
[0111] S713, re-execute the task, restart the task, and send the task progress information to the interrupted mobile phone.
[0112] S714, continue to send the task progress information executed by the master device and the corresponding slave devices to each slave device respectively until the task is completed, and send the task completion mark to the mobile phone.
[0113] S715: If the reconnection fails within the preset time, the task is terminated.
[0114] The method for finding interrupted devices provided by the embodiment of the present invention is that the computer accesses each mobile phone through the HUB, obtains the port information of the connection device corresponding to each mobile phone connected to the computer and the serial number of each mobile phone corresponding to each port information. The information binding the display port information with the serial number of each corresponding mobile phone is displayed on the screen of the computer. Then the task process information of the tasks performed by each mobile phone and the computer is recorded in real time, and the task process information of the computer and the corresponding mobile phones is sent to each mobile phone respectively. Detect whether there is an abnormal interruption between the mobile phone and the computer, and wait for the mobile phone to reconnect to the computer in the case of interruption. After the reconnection is successful, a selection box for whether to continue the task is displayed on the computer side. After the user chooses to continue, the task is continued until the task is completed, and the task end mark is sent to the interrupted mobile phone. Then the verification file of the mobile phone that is finally interrupted is received. The computer compares the verification file and the task process information recorded on the computer side and ends the task if they are consistent. If they are inconsistent, the task is re-executed. It can be realized that when a large number of USB external slave devices are abnormally disconnected from the main device after being connected to the main device, the interrupted slave device can be found as soon as possible, and the connection between the slave device and the main device can be tried to be re-established. After the connection is successful, the device can automatically re-communicate with the main device in an unattended state. By re-enumerating the interrupted slave devices, the technical problem of abnormal disconnection of USB external slave devices from the main device due to power supply problems of the main device motherboard, operating system stability and other problems can be solved. In the scenario with a large number of devices, users can quickly find the host port connected to the device through the abnormal device, so that users can quickly eliminate the problem.
[0115] Embodiment 5
[0116] The method for finding an interrupted device of the present invention enables a large number of USB external slave devices to be abnormally disconnected from the master device, and the interrupted slave device can be found as soon as possible. For ease of understanding, the method for finding an interrupted device of the present invention is described below in conjunction with an application scenario. The slave device in the application scenario is a mobile phone, and the master device is a computer PC.
[0117] Figure 8 This is a flow chart of a method for normal device connection according to Embodiment 5 of the present invention, the method comprising:
[0118] S801. Each mobile phone is plugged into a HUB device to connect to a PC and start the background protection process on the mobile phone.
[0119] S802: The PC detects that a mobile phone is inserted and starts a background protection process on the PC.
[0120] S803, the PC obtains the serial number SerialNumber of the mobile phone and the port binding corresponding to the mobile phone inserted into the HUB device.
[0121] In this embodiment, the PC binds the serial number and the port information and displays them on the PC screen.
[0122] S804. The PC sends the information of each port to the mobile phone connected to the corresponding port.
[0123] S805. The mobile phone receives the port information and displays it.
[0124] S806, the PC starts the task and sends the startup information to the mobile phone to protect the process.
[0125] S807. The mobile phone obtains the startup information.
[0126] S808. The PC records task information, including the path of the copied file, the copying process, and the process of controlling the mobile phone.
[0127] S809, the mobile phone waits for the task completion mark.
[0128] S810. The PC continues to send a task execution flag to the mobile phone.
[0129] The execution flag includes: the file size information recorded last time, the file binary code, and the task information.
[0130] S811. The mobile phone receives a task execution flag.
[0131] S812. The PC end task is executed, the task ends, and a task end flag is sent.
[0132] S813, the mobile phone receives the task completion flag.
[0133] When the mobile phone is abnormally disconnected from the PC, the process implemented on the PC side is as follows Fig. 9 As shown:
[0134] S901. Mission begins.
[0135] S902. Continuously record the task progress, such as: step n, xxxth byte, and send it to the mobile phone.
[0136] S903: Task not completed interruption.
[0137] S904. After the task device is online (determining whether it is a device that has not completed the task through the device SerialNumber), a pop-up prompt is displayed to prompt whether to continue or terminate and a countdown is performed.
[0138] S905: If the countdown is stopped, the task is terminated.
[0139] S906. Continue the task after the countdown is completed.
[0140] S907: After the task is completed, a task completion flag is sent.
[0141] When the mobile phone is abnormally disconnected from the PC, the process implemented on the mobile phone side is as follows Fig.10 As shown:
[0142] S1001. Receive a message indicating that a task has started on the PC side.
[0143] S1002. Continuously record the task progress, such as: step n, xxxth byte.
[0144] S1003. Interrupt when the task completion flag is not received.
[0145] S1004: Re-enumerate the device.
[0146] S1005: After enumerating the devices, if a task continuation flag is received, the task continues; if no task continuation flag is received, the devices are re-enumerated.
[0147] S1006. Continue the task after receiving the task continuation flag.
[0148] S1007. Mission completed.
[0149] S1008. After the task is completed, a task completion flag is sent.
[0150] In this embodiment, the PC accesses each mobile phone through the HUB, obtains the port information of each mobile phone corresponding to the device connected to the computer and the serial number of each mobile phone corresponding to each port information. The information binding the display port information with the serial number of each corresponding mobile phone is displayed on the screen of the computer. Then the task is started, the task process information of each mobile phone and the computer is recorded, and the task process information of the computer and the corresponding mobile phone execution is sent to each mobile phone respectively. Wait for the mobile phone to reconnect to the computer in the case of interruption. After the reconnection is successful, a selection box or a countdown box is displayed on the computer side. After the user chooses to continue or end the task when the road is over, the task continues until the task is completed, and the task end mark is sent to the interrupted mobile phone. It can be realized that when a large number of USB external slave devices are connected to the main control device and there is an abnormal disconnection between the slave device and the main device, the interrupted slave device can be found as soon as possible, and the connection between the slave device and the main device can be automatically tried to be re-established. After the connection is successfully restored, the device can automatically re-communicate with the main device in an unattended state. In the scenario with a large number of devices, the user can quickly find the host port connected to the device through the abnormal device, so that the user can quickly troubleshoot the problem.
[0151] Embodiment six:
[0152] In order to solve the technical problem that when a large number of slave devices are connected to a master device, a USB external slave device is abnormally disconnected from the master device and the interrupted slave device cannot be found as soon as possible, the present invention provides a USB external slave device. The USB external slave device proposed by the present invention is described below in conjunction with an embodiment.
[0153] See also Fig.11 As shown, Fig.11 This is a schematic diagram of the composition of a USB external slave device provided in Embodiment 6 of the present invention, wherein the slave device includes a startup module 1101 and a receiving module 1102. The number of the slave devices is at least two;
[0154] The startup module 1101 is used to connect to the main device through a connecting device; the connecting device includes at least two ports;
[0155] The receiving module 1102 is used to receive the task progress information of each task executed by the master device and the corresponding slave devices sent by the master device. The task progress information includes: the file size information recorded last time, the file binary code, and the task information;
[0156] The search module 1103 is used to search for the interrupted slave device according to the interrupted task process information when receiving the task process information interruption sent by the master device.
[0157] In some embodiments, the slave device also includes a recovery module 1104, which is used to restore the connection between the interrupted slave device and the master device by causing the interrupted slave device to re-enumerate itself or an external device to re-enumerate the interrupted slave device after the interrupted slave device is found according to the interrupted task process information.
[0158] The USB external slave device may be a mobile phone, a camera, a printer, a smart watch, a tablet computer, etc., which are only examples and are not limited to the above slave devices. The number of slave devices in this embodiment is at least two. The connecting device may be a hub or an OTG connector. The connecting device includes at least two ports for accessing the slave device.
[0159] In some embodiments, the receiving module 1102 can also be used to receive the port information of the connection device of each slave device connected to the master device. After receiving the port information, it can be displayed on the screen of the slave device, so that the user can find the corresponding port conveniently.
[0160] In some embodiments, the task progress information sent by the master device is received in at least one of the following ways: media transfer protocol MTP mode, ADB mode, wifi, control instructions transmitted via USB or small computer system interface SCSI instructions, and connecting to the master device via the slave device virtual remote network driver interface specification RNIDS port. In this way, adding a communication protocol based on the USB protocol allows both the master device and the slave device to obtain the status of the task. For example, whether the task is in progress or has ended. If the master device is disconnected from the slave device when the task is not executed, there is no need to restart the task after the connection is automatically restored. If the connection is disconnected during task execution, the task can be re-executed after the connection is automatically restored.
[0161] The interrupted slave device re-enumerates itself including: switching the connection mode between the interrupted slave device and the master device or pulling down the DP signal line level or controlling the connection between the master device and the interrupted slave device through a digital relay in the interrupted terminal. The switching connection mode between the interrupted slave device and the master device may be one of the following: charging only, multimedia transmission MTP mode, file transfer, image transfer, etc. Pulling down the DP signal line level may be forced to pull down by the USB controller of the slave device. The digital relay that controls the connection of the interrupted slave device of the master device through a digital relay may be integrated in the slave device or may be an external digital relay.
[0162] In some embodiments, when receiving the task progress information interruption sent by the receiving master device, it is detected whether the task progress information of the interrupted slave device only contains charging information. If it only contains charging information, there is no need to re-enumerate the interrupted slave device. In this way, when the slave device is disconnected from the master device, it can automatically determine whether it needs to re-establish the connection with the PC. If it is not performing a task with the PC, such as only charging, it does not need to re-establish the connection with the PC.
[0163] In some embodiments, the interruption of receiving the task progress information of the master device includes: not receiving the task progress information of the master device within a preset time.
[0164] In some embodiments, when the interrupted slave device is repeatedly enumerated in multiple ways and still fails to restore the connection between the interrupted slave device and the master device, the port information of the interrupted slave device connected to the connecting device can be displayed on the screen of the slave device to prompt the user, so that the user can take corresponding actions in time to solve the technical problem caused by the physical connection disconnection. In particular, a sound alarm can also be issued when repeated enumeration still fails to establish a connection with the master device.
[0165] In some embodiments, after the interrupted slave device is re-enumerated, the interrupted slave device and the master device are connected again, and the task progress information of the master device is continued to be received, and the task is continued from the breakpoint. After the task is completed, the slave device sends all the acquired task progress information to the master device, and the master device verifies it. After the verification passes, the task is terminated. If the verification fails, the task is re-executed, and the task progress information is sent to the slave device again. The task completion can be a sign of the completion of the task sent by the master device. When the device is connected to the master device via an OTG connector, the master device can record whether the task is completed, and the slave device re-executes the task when the connection is re-established.
[0166] The slave device provided in the embodiment of the present invention connects each slave device to the master device through a connecting device, and each slave device receives the master device and the task process information executed by each corresponding slave device sent by the master device. When a large number of USB external slave devices, including but not limited to, are abnormally disconnected from the main control device, the fault can be found as soon as possible and the interrupted slave device can be discovered.
[0167] Embodiment seven:
[0168] In order to solve the technical problem that when a large number of slave devices are connected to a master device, USB external slave devices are abnormally disconnected from the master device due to problems such as power supply problems of the master device mainboard and stability of the operating system, and the interrupted slave devices cannot be found as soon as possible, the present invention provides a master device. The master device proposed by the present invention is described below in conjunction with an embodiment.
[0169] See also Fig.12 As shown, Fig.12 A schematic diagram of the composition of a master device provided in Embodiment 7 of the present invention, wherein the master device includes a starting module 1201, a recording module 1202, and a sending module 1203;
[0170] A startup module 1201 is used to access each slave device through a connection device;
[0171] The recording module 1202 is used to record in real time the task progress information of each task executed by each slave device and the master device;
[0172] The sending module 1203 is used to send task progress information executed by the master device and the corresponding slave devices to each slave device respectively.
[0173] The main device may be a mobile phone, a smart watch, a computer, etc., which are just examples and are not limited to the above main devices. The connecting device may be a hub or an OTG connector.
[0174] In some embodiments, after the connection device is connected to each slave device, the protection process can be started. The recording module 1202 can also be used to obtain the port information of each slave device corresponding to the connection device connected to the master device; and send the port information to each slave device connected to the corresponding port. After the port information of each slave device corresponding to the connection device connected to the master device is obtained, it can be displayed on the screen of the master device.
[0175] In some embodiments, obtaining the port information of each slave device corresponding to the connection device connected to the master device may also include: obtaining the serial number of each slave device corresponding to each port information and each port information; binding the serial number of each slave device corresponding to each port information and storing it in the master device. The information bound to the serial number of each display port information and the serial number of each slave device may also be displayed on the screen of the master device. In some embodiments, obtaining the serial number of each slave device corresponding to each port information; binding the serial number of each slave device corresponding to each port information and storing it in the master device, recording the task progress information of each task executed by each slave device and the master device may also include: binding the task progress information corresponding to each task to the serial number and port information of each slave device respectively; when the task progress information sent by the master device is interrupted, each slave device finds the interrupted slave device according to the received task information, and the master device finds the interrupted slave device according to the recorded task progress information.
[0176] In some embodiments, when the task process information recording of each slave device and the master device is abnormally interrupted, the interrupted slave device is waiting to be connected to the master device again; wherein the abnormal interruption of the task process information recording of each slave device and the master device means that the slave device and the master device are abnormally interrupted. When the interrupted slave device is connected to the master device again, a selection box or a countdown prompt box is displayed on the master device.
[0177] Among them, the judgment condition for the interrupted slave device to restore the connection with the master device can be based on obtaining the serial number of the slave device that has restored the connection, comparing the serial number with the serial number of the slave device that has not completed the task before, and if they are consistent, a selection box or a countdown prompt box is displayed on the master device, wherein the content of the selection box can be a selection box prompting whether to continue or terminate. The countdown prompt is to automatically continue the task. It can be set to automatically continue the task after the countdown ends. When the task is automatically continued at the end of the countdown, the master device continues to record the task progress information in real time and can send it to the slave device in real time or according to a preset period. Until the task is completed. When the task ends, a task end flag can be sent to the slave device.
[0178] In some embodiments, the master device further includes a verification module, which is used to receive a verification file from the slave device after sending a task completion flag to the slave device, and the verification file is the task progress data received by the slave device from the master device. The master device compares the verification data with the task progress data recorded by the master device, and if they are consistent, the task is completed. If they are inconsistent, the task is re-executed.
[0179] The master device provided by the embodiment of the present invention connects each slave device to the master device through a connecting device, and the master device records the task process information of each slave device and the master device in real time. The master device sends the task process information of the master device and each corresponding slave device to each slave device, so that each slave device can find the interrupted slave device according to whether the task process information is updated. It can be realized that when a large number of USB external slave devices, including but not limited to, are abnormally disconnected from the master control device, the interrupted slave device can be found as soon as possible.
[0180] Embodiment eight:
[0181] In order to solve the technical problem that when a large number of slave devices are connected to a master device, USB external slave devices are abnormally disconnected from the master device due to problems such as power supply problems of the master device mainboard and stability of the operating system, and the interrupted slave device cannot be found as soon as possible, the present invention provides a USB external slave device. The slave device proposed by the present invention is described below in conjunction with an embodiment.
[0182] See also Fig.13 , Fig.13 1 is a schematic diagram of the structure of the slave device of the eighth embodiment. It includes a processor 1301, a memory 1302 and a communication bus 1303, wherein:
[0183] The communication bus 1303 is used to realize the connection and communication between the processor 1301 and the memory 1302;
[0184] The processor 1301 is configured to execute one or more computer programs stored in the memory 1302 to implement at least one step in the method for searching for an interrupt device in the first or second embodiment.
[0185] The present embodiment also provides a computer-readable storage medium, which includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable readonly memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer.
[0186] The computer-readable storage medium in this embodiment can be used to store one or more computer programs, and the one or more computer programs stored therein can be executed by a processor to implement at least one step of the method for searching for an interrupt device in the above-mentioned first and second embodiments.
[0187] Embodiment nine:
[0188] In order to solve the technical problem that when a large number of slave devices are connected to a master device, USB external slave devices are abnormally disconnected from the master device due to problems such as power supply problems of the master device mainboard and stability of the operating system, and the interrupted slave devices cannot be found as soon as possible, the present invention provides a master device. The master device proposed by the present invention is described below in conjunction with an embodiment.
[0189] See also Fig.14 , Fig.14 14 is a schematic diagram of the structure of the slave device of the eighth embodiment. It includes a processor 1401, a memory 1402 and a communication bus 1403, wherein:
[0190] The communication bus 1403 is used to realize the connection and communication between the processor 1401 and the memory 1402;
[0191] The processor 1401 is configured to execute one or more computer programs stored in the memory 1402 to implement at least one step in the method for searching for an interrupt device in the third or fourth embodiment.
[0192] The present embodiment also provides a computer-readable storage medium, which includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable readonly memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer.
[0193] The computer-readable storage medium in this embodiment can be used to store one or more computer programs, and the one or more computer programs stored therein can be executed by a processor to implement at least one step of the method for searching for an interrupt device in the above-mentioned third and fourth embodiments.
[0194] It can be seen that those skilled in the art should understand that all or some of the steps, systems, and functional modules / units in the above disclosed methods can be implemented as software (which can be implemented with computer program code executable by a computing device), firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component can have multiple functions, or a function or step can be performed by several physical components in cooperation. Some or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit.
[0195] In addition, it is well known to those skilled in the art that communication media generally contain computer readable instructions, data structures, computer program modules or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery media. Therefore, the present invention is not limited to any specific hardware and software combination.
Claims
1. A method for finding an interrupt device, characterized in that: The method is applied to a USB external slave device, the number of the slave devices is at least two, and the method comprises: Each slave device is connected to the master device via a connecting device; the connecting device includes at least two ports; Receiving port information of the connection device of each slave device connected to the master device, and forming a mapping relationship between each slave device and each port information; Each slave device receives the task progress information sent by the master device respectively; the task progress information includes: the task progress information recorded when the master device and the corresponding slave devices execute each task; When receiving the task process information interruption sent by the master device, finding the interrupted slave device according to the interrupted task process information; The interrupted slave device re-enumerates itself or an external device re-enumerates the interrupted slave device, and restores the connection between the interrupted slave device and the master device; The port information corresponding to the interrupted slave device is found according to the mapping relationship.
2. The method for finding an interrupt device according to claim 1, characterized in that: The task progress information sent by the master device is received in at least one of the following ways: media transfer protocol MTP mode, Android debug bridge ADB mode, wifi, transmission control instructions via USB or small computer system interface SCSI instructions, and connection with the master device through the slave device virtual remote network driver interface specification RNIDS port.
3. The method for finding an interrupt device according to claim 1, characterized in that: The interrupted slave device re-enumerates itself including: switching the connection mode between the interrupted slave device and the master device; or pulling down the DP signal line level; or controlling the connection between the master device and the interrupted slave device through a digital relay in the interrupted slave device.
4. A method for finding an interrupt device, characterized in that: The method is applied to a master device, and the method comprises: Access each slave device through the connecting device; Recording task progress information of each task executed by each slave device and the master device; Acquire the port information of the connection devices corresponding to the slave devices connected to the master device; Sending the port information to each slave device connected to each port respectively; The task progress information of the master device and the corresponding slave devices executing each task is sent to each slave device respectively; the task progress information sent to each slave device is used for, when the task progress information sent by the master device is interrupted, each slave device finds the interrupted slave device according to the received task information, so that the interrupted slave device re-enumerates itself or an external device re-enumerates the interrupted slave device, restores the connection between the interrupted slave device and the master device, and determines the port information of the interrupted slave device.
5. The method for finding an interrupt device according to claim 4, characterized in that: Acquiring the port information of the connection device corresponding to each slave device connected to the master device further includes: acquiring the port information and the serial number of each slave device corresponding to each port information; binding the port information and the serial number of each slave device corresponding to each port information and storing them in the master device; The recording of the task progress information of each task executed by each slave device and the master device comprises: binding the task progress information corresponding to each task to the serial number and port information of each corresponding slave device respectively; When the task progress information sent by the master device is interrupted, each slave device finds the interrupted slave device according to the received task information, which further includes: the master device finds the interrupted slave device according to the recorded task progress information.
6. The method for finding an interruption device according to claim 4 or 5, characterized in that: The method further comprises: When the task process information recording of each slave device and the master device is abnormally interrupted, waiting for the interrupted slave device to restore the connection with the master device; When the interrupted slave device is restored to the master device, a selection box or a countdown prompt box is displayed on the master device.
7. A USB external slave device, the slave device comprising a processor, a memory and a communication bus; The communication bus is used to realize the connection and communication between the processor and the memory; The processor is used to execute one or more computer programs stored in the memory to implement the steps of the method for searching for an interrupt device according to any one of claims 1 to 3.
8. A host device, comprising a processor, a memory and a communication bus; The communication bus is used to realize the connection and communication between the processor and the memory; The processor is configured to execute one or more computer programs stored in the memory to implement the steps of the method for searching for an interrupt device as claimed in any one of claims 4 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to implement the steps of the method for searching for an interrupt device as claimed in any one of claims 1 to 3.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more computer programs, and the one or more computer programs can be executed by one or more processors to implement the steps of the method for searching for an interrupt device as claimed in any one of claims 4 to 6.
Citation Information
Patent Citations
Method and device for updating parent task progress
CN105260287A
System optimization method and device, storage medium and terminal equipment
CN107766218A
Method and Apparatus for Enabling Content to be Shared Among Multiple Devices in a Secure Environment
US20080109656A1
Information processing apparatus, and method for controlling the same
US20100332692A1
Proxy Responder for Handling Anomalies in a Hardware System
US20130262918A1
