USB debugging system
By introducing cloud server and real-time communication technology SignalR in the USB debugging system, the collaboration of multiple devices and the real-time distribution and forwarding of data is achieved, and the limitations of the debugging system in the existing technology are solved, and the flexibility and security of debugging are improved.
Patent Information
- Application Number
- CN202411719163.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-21
AI Technical Summary
The existing USB debugging system can only be debugged locally, which poses the risk of network delay and data leakage, and is difficult to operate on the mobile terminal, so it is impossible to achieve collaborative cooperation between multiple devices.
Through cloud servers, real-time communication technology SignalR is used to instantly distribute and forward data, and to ensure data security through multiple verification mechanisms. It provides access modules for mobile terminals and USB receivers to realize real-time data transmission.
Real-time transmission of data between different devices is realized, the flexibility and convenience of debugging is improved, network delay and data leakage risks are reduced, and multi-device collaborative cooperation is supported.
Smart Images

Figure CN119669040A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a USB debugging system. Background Art
[0002] USB (Universal Serial Bus) is a standard interface widely used between computers and their peripheral devices. It supports hot-swap and plug-and-play functions. USB debugging allows developers to communicate with devices through the USB interface and perform operations such as installing applications and reading logs.
[0003] In the existing technology, the current technology of USB debugging system can only be debugged locally. The device is connected to the local computer, and the data is sent and received on the local computer. If the device is debugged using remote desktop, there will also be related problems. For example, the data transmitted over the network is large (including the frames of the remote desktop), and there is a risk of network delay; there is a risk of data leakage on the local computer; it is difficult to operate on the mobile terminal and cannot be done anytime and anywhere; only one device can be remotely debugged at a time.
[0004] In summary, how to solve the problem in the prior art that only one device can be remotely debugged at a time using remote desktop debugging has become a difficult problem that needs to be solved urgently in the art. Therefore, it is necessary to propose a USB debugging system. Summary of the invention
[0005] To solve the above problems, the present invention provides a USB debugging system, which utilizes a cloud server to achieve multi-device collaboration, realizes instant distribution and forwarding of data, enables real-time transmission of data between different devices, and improves the flexibility and convenience of debugging.
[0006] In order to achieve the above-mentioned purpose, the technical solution of the present invention is as follows: A USB debugging system includes an access module, a receiving module, a sending module, a cloud server, a mobile terminal and a USB receiver.
[0007] The access module is used to receive the PID, VID, ReadEndPoint and WriteEndpoint values of the input USB device; receive the USB device connection instruction; determine whether the PID, VID, ReadEndPoint and WriteEndpoint values of the USB device are correct, and output the USB device connection result.
[0008] The receiving module is used to display the received data in the data receiving area after the USB device is successfully connected.
[0009] The sending module is used to fill in the data to be sent in the sending data area; receive the data sending instruction; determine whether the data is sent successfully, and output the result of data sending.
[0010] Cloud servers are used to distribute and forward data in real time using real-time communication technologies.
[0011] The mobile terminal is used to connect to the cloud server, obtain and display data, and input debugging data and send it to the cloud server.
[0012] USB receiver, used to drive USB devices to run and connect to the cloud server.
[0013] Further, when the mobile terminal accesses the USB device, login verification is adopted; the login verification includes the following steps:
[0014] S101, a user enters a user name and password on a login interface of a mobile terminal.
[0015] S102, after the user clicks the login button, the mobile terminal sends the login information to the cloud server through the network.
[0016] S103, after receiving the login request, the cloud server verifies whether the user name and password entered by the user are correct; and outputs the login verification result.
[0017] Further, the mobile terminal uses the MAC address for verification when accessing the USB receiver; the MAC address verification includes the following steps:
[0018] S201, after the user clicks a button for connecting to a USB receiver on the mobile terminal, the mobile terminal sends the acquired MAC address to the USB receiver.
[0019] S202, the USB receiver compares the received MAC address with a preset authorized MAC address.
[0020] S203, matching is performed according to the authorized list of MAC addresses; and the MAC address matching result is output.
[0021] Furthermore, the USB receiver is authenticated by time periods when connected to the USB device; the authentication by time periods includes the following steps:
[0022] S301, setting a verification time period according to requirements.
[0023] S302, by comparing the current time with the set time period, determine whether the current time allows verification.
[0024] S303: Output the result of the time period verification.
[0025] Furthermore, the mobile terminal and the USB receiver use mutual identity authentication; the identity authentication includes the following steps:
[0026] S401, generating a key pair and a certificate on the mobile terminal and the USB receiver.
[0027] S402: The mobile terminal and the USB receiver send their respective certificates to each other.
[0028] S403, the mobile terminal and the USB receiver verify the certificate respectively.
[0029] S404: Output the result of the certificate verification.
[0030] Furthermore, the real-time communication technology uses SignalR.
[0031] Furthermore, mobile terminals include but are not limited to mobile phones, tablets and computers.
[0032] Furthermore, the USB receiver is selected from a computer.
[0033] Furthermore, a conversion module is included, and the conversion module is used to exchange the hexadecimal string with the byte array.
[0034] Furthermore, it also includes a monitoring module, which is used to monitor the data transmission and resend the data when the data transmission fails.
[0035] The above scheme has the following beneficial effects:
[0036] 1. The USB standard of the present invention provides basic hardware support for the USB debugging system, allowing the device to quickly exchange data with the computing device through the USB interface. After the USB device is successfully connected, the receiving module is responsible for displaying the received data in the data receiving area. The user can view the data stream transmitted by the device in real time on the interface. During the data transmission process, if the network is interrupted, the system can automatically resume the transmission to ensure the integrity and consistency of the data.
[0037] Cloud servers are used to achieve multi-device collaboration and instant data distribution and forwarding, allowing data to be transmitted in real time between different devices. Users can perform remote debugging through mobile terminals without having to visit the device in person, thereby improving the flexibility and convenience of debugging.
[0038] 2. The present invention uses the network and SignalR real-time communication technology to transmit only device data, with low network latency. The system can transmit USB device data in real time between the client and the server, thereby achieving low-latency data synchronization. It allows Web applications to achieve real-time two-way communication between the server and the client; it can build responsive applications and maintain a good user experience even under poor network conditions.
[0039] 3. The present invention adopts multiple verification mechanisms. The system only transmits necessary device data and does not involve other data on the local computer, reducing the risk of data leakage. Through login verification, MAC address verification and mutual identity authentication mechanism, the security of the system is further enhanced to prevent unauthorized access. Encryption technology is used in the data transmission process to ensure the security of data during transmission; only authorized users can access and transmit data.
[0040] 4. The present invention interchanges hexadecimal strings with byte arrays; the user can input data in the form of a hexadecimal string, and the conversion module converts it into a byte array that can be transmitted; similarly, the received byte array can also be converted into a hexadecimal string and displayed to the user.
[0041] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 FIG. 4 is a structural block diagram of a USB debugging system in an embodiment of the present invention.
[0043] Figure 2 4 is a system architecture diagram of the business process in an embodiment of the present invention.
[0044] Figure 3 This is a diagram of the main interface of the USB debugging system in an embodiment of the present invention.
[0045] Figure 4 This is a message prompt diagram showing successful connection of a USB device in an embodiment of the present invention.
[0046] Figure 5 This is a message prompt diagram of a USB device connection failure in an embodiment of the present invention.
[0047] Figure 6 This is a display diagram of received data in an embodiment of the present invention.
[0048] Figure 7 This is a display diagram of sending data in an embodiment of the present invention.
[0049] Figure 8 This is a message prompt diagram for sending data in an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The following is further described in detail through specific implementation methods:
[0051] Embodiment 1:
[0052] As attached Figure 1-Figure 8 As shown: A USB debugging system includes an access module, a receiving module, a sending module, a cloud server, a mobile terminal and a USB receiver. Among them, the access module is mainly used to connect the USB device. The receiving module receives the data transmitted by the USB device. The sending module is used to send the specified data to the USB device. The cloud server is used to distribute and forward data in real time. The mobile terminal is used to connect to the cloud server, obtain and display data. The USB receiver is used to drive the USB device to run; and connect to the cloud server.
[0053] The following is a detailed explanation of each function:
[0054] The access module is used to receive the PID, VID, ReadEndPoint and WriteEndpoint values of the input USB device; receive the USB device connection instruction; determine whether the PID, VID, ReadEndPoint and WriteEndpoint values of the USB device are correct, and output the USB device connection result.
[0055] Specifically, the user starts the application on the mobile terminal and sees fields for entering USB device parameters on the interface: the user enters these parameters in sequence, for example:
[0056] PID:0x0FA0
[0057] VID:0x0403
[0058] ReadEndPoint:0x82
[0059] WriteEndpoint:0x01
[0060] After the user enters the required parameters and clicks the "Connect" button, the application will call the access module to process the user's request. The access module begins to analyze after receiving the user's input.
[0061] The access module first checks whether there is a matching device. If no matching device is found, an error message "USB device not found" is output. If a matching device is found but cannot be opened, an error message "failed to open device" is output. If the device is successfully opened, the corresponding configuration settings are made and a notification of successful connection "USB device connected successfully" is output.
[0062] The receiving module is used to display the received data in the data receiving area after the USB device is successfully connected.
[0063] The sending module is used to fill in the data to be sent in the sending data area; receive the data sending instruction; determine whether the data is sent successfully, and output the result of data sending.
[0064] Specifically, when the USB device is successfully connected, the receiving module will be responsible for displaying the received data in the data receiving area. The specific implementation is as follows: Assume that the data receiving area is a TextBox control; data receiving event processing function; update the display content of the data receiving area; automatically scroll to the bottom of the text box.
[0065] The user can fill in the data to be sent in the send data area and click the "Send" button to send the data. The sending module will be responsible for sending data, determining whether the data is successfully sent, and outputting the sending result. The specific implementation is as follows: Assume that the send data area is a TextBox control; the click event processing function of the send button; output information according to the sending result; clear the send data area; display the message of successful sending; display the message of failed sending.
[0066] The cloud server is used to distribute and forward data in real time using real-time communication technology, wherein the real-time communication technology selected is SignalR.
[0067] The mobile terminal is used to connect to the cloud server, obtain and display data, and input debugging data to send to the cloud server. The mobile terminal includes but is not limited to mobile phones, tablets and computers. In this embodiment, a mobile phone is selected.
[0068] The USB receiver is used to drive the USB device to run and connect to the cloud server, wherein the USB receiver is a computer.
[0069] Specifically, Figure 2 As shown, the business process of this system is as follows:
[0070] Device A is connected to computer A, and computer A needs to use the driver of device A for communication; this USB debugging system needs to be installed on computer A, connected to the Internet, and send data to the cloud server; the cloud server distributes and forwards data in real time through SignalR real-time communication technology.
[0071] The mobile phone obtains and displays data by connecting to the cloud server; the mobile phone inputs debugging data and sends it to the cloud server; the cloud server sends the data to computer A; computer A sends the data to device A through the driver.
[0072] The specific implementation process is as follows: first accurately fill in the PID, VID, ReadEndPoint and WriteEndpoint values of the USB device, and then click Connect USB; a message will pop up from the bottom to indicate whether the connection is successful or not, such as Figure 4 and Figure 5 shown.
[0073] After the connection is successful, if the USB device data is received, the received data will be displayed in the data receiving area, such as Figure 6 As shown; if you send data to the USB device, fill in the data to be sent in the send data area, such as Figure 7 Click Send, and a prompt message will pop up from the bottom to show whether the sending is successful or not, as shown in the following figure: Figure 8 shown.
[0074] Embodiment 2:
[0075] The difference from the above embodiment is that login verification is used when the mobile phone is connected to the USB device; the login verification includes the following steps:
[0076] S101, the user enters the user name and password on the login interface of the mobile phone.
[0077] S102, after the user clicks the login button, the mobile phone sends the login information to the cloud server through the network.
[0078] S103, after receiving the login request, the cloud server verifies whether the user name and password entered by the user are correct; and outputs the login verification result.
[0079] When a mobile phone is connected to a computer, the MAC address is used for verification; MAC address verification includes the following steps:
[0080] S201, after the user clicks the button to connect to the computer on the mobile phone, the mobile phone sends the obtained MAC address to the computer.
[0081] S202, the computer compares the received MAC address with the preset authorized MAC address.
[0082] S203, matching is performed according to the authorized list of MAC addresses; and the MAC address matching result is output.
[0083] When a computer is connected to a USB device, time-division verification is used; time-division verification includes the following steps:
[0084] S301, setting a verification time period according to requirements.
[0085] S302, by comparing the current time with the set time period, determine whether the current time allows verification.
[0086] S303: Output the result of the time period verification.
[0087] The mobile phone and computer use mutual identity authentication; identity authentication includes the following steps:
[0088] S401, generate a key pair and certificate on the mobile phone and computer.
[0089] S402, the mobile phone and the computer send their respective certificates to each other.
[0090] S403, the mobile phone and the computer respectively verify each other's certificates.
[0091] S404: Output the result of the certificate verification.
[0092] The specific implementation process is as follows: when the mobile phone is connected to a USB device, security is enhanced by identifying the MAC address of the connected device; to prevent the USB device from being maliciously accessed without the owner's consent, the owner authentication is required when switching the connection mode to ensure that personal data can only be accessed after the owner's authorization. At this time, the owner authentication can be completed by verifying the password.
[0093] When a computer is connected to a USB device, it will perform a series of hardware detection and enumeration processes, including identifying the type, speed, configuration, etc. of the device. During this process, the computer will use the endpoint authentication mechanism in the USB protocol to ensure that the communication with the device is safe and reliable. Endpoint authentication is part of the USB protocol, which allows a secure communication channel to be established between the host and the device.
[0094] Mutual authentication between mobile phones and computers is achieved in a variety of ways. This authentication method can ensure that both parties are legitimate communication parties and prevent security issues such as man-in-the-middle attacks or data leakage. For example, on an Android device, you can connect to a computer through USB debugging mode, and perform identity authentication and authorization during the connection process.
[0095] Embodiment 3:
[0096] As attached Figure 1 As shown, the difference from the above embodiment is that the USB debugging system provided by the present invention also includes a conversion module and a monitoring module. The conversion module is mainly used to exchange the hexadecimal string with the byte array; the monitoring module is used to monitor the data transmission; and resend the data when the data transmission fails.
[0097] The specific implementation process is as follows: the user starts the application on the mobile terminal and enters the hexadecimal string to be sent to the USB device, for example: "FF AA 5500". When the user clicks the "Send" button, the application calls the conversion module to convert the input hexadecimal string into a byte array; the converted byte array is: {0xFF, 0xAA, 0x55, 0x00}.
[0098] Next, the monitoring module is responsible for sending the byte array to the USB device through the cloud server. The monitoring module will check whether the data is sent successfully and automatically retry if it fails. Assuming that the first send fails, the monitoring module will capture the exception and automatically retry the send until the data is successfully sent or the maximum number of retries is reached.
[0099] Embodiment 4:
[0100] The difference from the above embodiment is that the USB debugging system provided by the present invention runs on the following code:
[0101]
[0102]
[0103]
[0104]
[0105]
[0106]
[0107]
[0108]
[0109] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the invention.
Claims
1. A USB debugging system, comprising an access module, a receiving module, a sending module, a cloud server, a mobile terminal and a USB receiver, characterized in that: The access module is used to receive the PID, VID, ReadEndPoint and WriteEndpoint values of the input USB device; receive the USB device connection instruction; determine whether the PID, VID, ReadEndPoint and WriteEndpoint values of the USB device are correct, and output the USB device connection result; The receiving module is used to display the received data in the data receiving area after the USB device is successfully connected; The sending module is used to fill in the data to be sent in the sending data area; receive the data sending instruction; determine whether the data is successfully sent, and output the result of data sending; Cloud servers for real-time data distribution and forwarding using real-time communication technology; Mobile terminal, used to connect to the cloud server, obtain and display data; And input debugging data and send it to the cloud server; USB receiver, used to drive USB devices to run and connect to the cloud server.
2. The USB debugging system according to claim 1, characterized in that: Login verification is used when the mobile terminal accesses the USB device; Login verification includes the following steps: S101, the user enters a user name and password on a login interface of a mobile terminal; S102, after the user clicks the login button, the mobile terminal sends the login information to the cloud server through the network; S103, after receiving the login request, the cloud server verifies whether the user name and password entered by the user are correct; and outputs the login verification result.
3. The USB debugging system according to claim 2, characterized in that: The MAC address is used for verification when the mobile terminal is connected to the USB receiver; the MAC address verification includes the following steps: S201, after the user clicks the button for connecting to the USB receiver on the mobile terminal, the mobile terminal sends the acquired MAC address to the USB receiver; S202, the USB receiver compares the received MAC address with a preset authorized MAC address; S203, matching is performed according to the authorized list of MAC addresses; and the MAC address matching result is output.
4. The USB debugging system according to claim 3, characterized in that: When the USB receiver is connected to a USB device, time-division verification is used; time-division verification includes the following steps: S301, setting a verification time period according to requirements; S302, by comparing the current time with the set time period, determining whether the current time allows verification; S303: Output the result of the time period verification.
5. The USB debugging system according to claim 4, characterized in that: The mobile terminal and the USB receiver use mutual identity authentication; Identity authentication includes the following steps: S401, generating a key pair and a certificate on the mobile terminal and the USB receiver; S402, the mobile terminal and the USB receiver send their respective certificates to each other; S403, the mobile terminal and the USB receiver verify the certificate respectively; S404: Output the result of the certificate verification.
6. The USB debugging system according to claim 5, characterized in that: SignalR is used as the real-time communication technology.
7. The USB debugging system according to claim 6, characterized in that: Mobile terminals include but are not limited to mobile phones, tablets and computers.
8. The USB debugging system according to claim 7, characterized in that: The USB receiver is a computer.
9. The USB debugging system according to claim 8, characterized in that: The invention also comprises a conversion module, which is used for exchanging the hexadecimal character string with the byte array.
10. The USB debugging system according to claim 9, characterized in that: It also includes a monitoring module, which is used to monitor the data transmission and resend the data when the data transmission fails.