USB equipment access method and device, terminal equipment and storage medium

By building a USB virtual network card between the cloud PC terminal and the host, the problem of remote management of USB devices in cloud PCs is solved, and the over IP function of USB devices is realized, reducing costs and improving compatibility and scalability.

CN119127765APending Publication Date: 2024-12-13BANGYAN TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411087110.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Remote management of USB devices cannot be achieved in a cloud PC environment, resulting in the inability to use USB devices on a cloud PC.

Method used

By building a USB virtual network card between the cloud PC terminal and the host, using the USB interface module to obtain and parse USB device plug-in and unplug information, establish a data link, and identify and call USB devices through the USB driver to realize the over IP function of the USB device. .

Benefits of technology

Without a network interface connection, remote management of USB devices is realized, reducing the development and use costs of remote management, and has good compatibility and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127765A_ABST
    Figure CN119127765A_ABST
Patent Text Reader

Abstract

The invention provides a USB equipment access method and device, terminal equipment and a storage medium, and relates to the field of computers.The method comprises the steps that when a cloud PC terminal detects that USB equipment is accessed, USB equipment plugging and unplugging information is obtained through a USB interface module; analyzing the plugging information of the USB equipment to obtain a plugging state of the USB equipment; establishing a data link between the USB interface module and the host through the USB virtual network card, and sending the plugging state of the USB equipment to the host through the data link; if the host determines that the plugging state of the USB equipment is a USB equipment access state, the host identifies the USB equipment through a USB drive program; and after the host identifies the USB equipment, the host drives and calls the USB equipment through the data link. The invention aims to solve the problem that the remote management function of the USB equipment cannot be realized on the cloud PC, so that the use of the USB equipment cannot be realized on the cloud PC.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a USB device access method, a USB device access device, a terminal device, and a computer-readable storage medium. Background Art

[0002] With the development of cloud computing technology, cloud computers (cloud PCs) have been widely used as a new computer usage model. Cloud PCs refer to the technology that provides computer computing power and storage resources to users through the network. Cloud PCs have the advantages of easy management, flexible expansion, and low cost, so they are widely used in corporate offices, education and training, games and entertainment, etc.

[0003] When using a cloud PC, users may need to use various USB devices, such as printers, USB flash drives, cameras, etc. However, since the host itself is not directly connected to the USB device, the remote management (over IP) function of the USB device cannot be implemented on the cloud PC, that is, the use of the USB device cannot be implemented on the cloud PC. Summary of the invention

[0004] The present application provides a USB device access method, apparatus, terminal device and computer-readable storage medium, aiming to solve the problem that the remote management function of USB devices cannot be implemented on cloud PCs, and thus the USB devices cannot be used on cloud PCs.

[0005] To achieve the above object, the present application provides a USB device access method, which is applied to a cloud desktop system, wherein the cloud desktop system includes a cloud PC terminal and a cloud PC server, wherein the cloud PC server includes a USB interface module, a USB virtual network card and a host, and the USB interface module is used to communicate with the cloud PC terminal; the method includes:

[0006] When the cloud PC terminal detects that a USB device is connected, the USB device plug-in information is obtained through the USB interface module;

[0007] Parsing the USB device plug-in and unplug-out information to obtain the USB device plug-in and unplug-out status;

[0008] Building a data link between the USB interface module and the host through the USB virtual network card, and sending the plug-in and unplug-out status of the USB device to the host through the data link;

[0009] If the host determines that the plug-in / unplug-out state of the USB device is the USB device access state, the host identifies the USB device through a USB driver;

[0010] After the host recognizes the USB device, the host drives and calls the USB device through the data link.

[0011] To achieve the above-mentioned purpose, the present application also provides a USB device access device, which is applied to a cloud desktop system, wherein the cloud desktop system includes a cloud PC terminal and a cloud PC server, wherein the cloud PC server includes a USB interface module, a USB virtual network card and a host, and the USB interface module is used to communicate with the cloud PC terminal; the device includes:

[0012] The device detection module is used to obtain the USB device plug-in information through the USB interface module when the cloud PC terminal detects that a USB device is connected;

[0013] A status analysis module, used to analyze the USB device plug-in information to obtain the USB device plug-in status;

[0014] A channel building module, used to build a data link between the USB interface module and the host through the USB virtual network card, and send the plug-in and unplug-out status of the USB device to the host through the data link;

[0015] A device identification module, configured to identify the USB device by using a USB driver if the host determines that the plug-in state of the USB device is the USB device connected state;

[0016] The device calling module is used for, after the host recognizes the USB device, the host drives and calls the USB device through the data link.

[0017] To achieve the above-mentioned purpose, the present application also provides a terminal device, which includes: a memory and a processor; wherein the memory is connected to the processor and is used to store programs, and the processor is used to implement any one of the USB device access methods described above by running the programs stored in the memory.

[0018] To achieve the above objectives, the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the USB device access method as described above.

[0019] The embodiments of the present application disclose a method, device, terminal device and computer-readable storage medium for accessing USB devices. The method includes: when the cloud PC terminal detects that a USB device is connected, the USB device plugging and unplugging information is obtained through the USB interface module; the USB device plugging and unplugging information is parsed to obtain the plugging and unplugging status of the USB device; a data link between the USB interface module and the host is established through a USB virtual network card, and the plugging and unplugging status of the USB device is sent to the host through the data link; if the host determines that the plugging and unplugging status of the USB device is the USB device access status, the host identifies the USB device through the USB driver; after the host identifies the USB device, the host drives and calls the USB device through the data link. In this way, when the cloud PC server and the host are not connected using a network interface, an IP channel between the cloud PC terminal and the host can be established through a USB simulated virtual network card, thereby realizing the over IP function of the USB device, and reducing the development cost and use cost of remote management, and having good compatibility and scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 It is a flowchart of a USB device access method provided by an embodiment of the present application;

[0022] Figure 2 A schematic diagram of an application scenario of a USB device access method provided in an embodiment of the present application;

[0023] Figure 3 A schematic diagram of a flow chart of a method for generating a USB virtual network card provided in an embodiment of the present application;

[0024] Figure 4 A schematic diagram of an application scenario of another USB device access method provided in an embodiment of the present application;

[0025] Figure 5 It is a flowchart of another USB device access method provided by an embodiment of the present application;

[0026] Figure 6 A schematic block diagram of a USB device access device provided in an embodiment of the present application;

[0027] Figure 7 A schematic block diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0029] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions. In addition, although the functional modules are divided in the device schematic, in some cases, the module division can be different from that in the device schematic.

[0030] The term "and / or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0031] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0032] To facilitate understanding of the embodiments of the present application, some backgrounds involved in the embodiments of the present application are briefly described below.

[0033] The present application proposes a USB device access method, which can build an IP channel between a cloud PC terminal and a host through a USB simulated virtual network card when the cloud PC server and the host are not connected using a network interface, thereby realizing the over IP function of the USB device, and can also reduce the development cost and use cost of remote management, and has good compatibility and scalability.

[0034] See also Figure 1 , Figure 1 It is a flow chart of a USB device access method provided in an embodiment of the present application. In this embodiment, the USB device access method is applied to a cloud desktop system, the cloud desktop system includes a cloud PC terminal and a cloud PC server, the cloud PC server includes a USB interface module, a USB virtual network card and a host, and the USB interface module is used to communicate with the cloud PC terminal.

[0035] like Figure 2As shown, USB devices may include devices connected via USB protocol such as printers, USB flash drives, cameras, and mice. The cloud desktop system includes a cloud PC terminal and a cloud PC server. The cloud PC terminal may be set up on the user side, and the cloud PC server may be set up in a computer room or other places. The cloud PC server may include a USB interface module, a USB virtual network card, and at least one host.

[0036] Exemplarily, the USB interface module is used to communicate with the cloud PC terminal. The cloud PC server can generally include multiple hosts, so that the multiple hosts can be managed uniformly to save the space occupied by the hosts.

[0037] Before implementing the USB device access method provided in this application, a method for generating a USB virtual network card is first introduced. The cloud PC server also includes a USB driver module and a network module.

[0038] Specifically, the network module is used to transmit the data received by the USB interface module to the cloud PC server through the network; the USB driver module is used to simulate the driver program of the USB device on the cloud PC server, thereby realizing the use of the USB device on the host.

[0039] Exemplarily, the USB interface module, the network module and the USB driver module can be integrated on a circuit board, and the circuit board is also integrated with a power module to provide power support for the entire cloud desktop system. The network module can use a wired network or a wireless network. The USB driver module can use an open source USB driver, thereby reducing the development cost and use cost of remote management.

[0040] like Figure 3 As shown, the method for generating the USB virtual network card includes steps S201 to S202.

[0041] S201. Generate a USB virtual network card on the cloud PC server through a USB driver module.

[0042] S202: Obtain device parameters of the USB interface module and the host, and configure device parameters of the USB virtual network card according to the device parameters, so that the USB virtual network card can achieve communication connection with the USB interface module and the host.

[0043] Among them, the device parameters of the USB interface module may include the interface parameters, communication parameters, etc. of the USB interface module, and the device parameters of the host may include the interface parameters, communication parameters, etc. of the host, so that the USB virtual network card can be connected to the IP network of the USB interface module and the host.

[0044] Specifically, the interface parameters and communication parameters of the USB interface module and the host, such as the communication protocol, etc., can be obtained. According to the device parameters of the USB interface module and the host obtained above, the device parameters of the USB virtual network card can be configured in a targeted manner, so that the IP network between the USB virtual network card and the USB interface module and the host is opened up, so that the USB virtual network card can communicate with the USB interface module and the host.

[0045] Exemplarily, the cloud PC server can use the Linux USB Gadget function to create a USB virtual network card, and configure the device parameters of the USB virtual network card in a targeted manner according to the device parameters of the USB interface module and the host obtained above, so that the IP network between the USB virtual network card and the USB interface module and the host is connected, so that the USB virtual network card can communicate with the USB interface module and the host.

[0046] In an embodiment of the present application, a USB virtual network card can be generated by using an open source USB driver through a USB driver module, and the device parameters of the USB virtual network card can be configured in a targeted manner, so that the IP network between the USB virtual network card and the USB interface module and the host is connected, providing a communication basis for the host to access the USB device, and the development cost and usage cost are low.

[0047] In some embodiments, after configuring the device parameters of the USB virtual network card according to the device parameters, a data link between the USB virtual network card and the host is established through the USB bus, so that the USB virtual network card can send USB data information to the host. Thus, a data link between the USB virtual network card and the host can be generated, so that data exchange can be achieved between the USB virtual network card and the host.

[0048] Specifically, after configuring the device parameters of the USB virtual network card, the host can scan the USB virtual network card through the USB bus, thereby discovering the USB virtual network card on the cloud PC server and loading the corresponding driver, so that the host can establish a data link with the USB virtual network card through the USB bus, so that data exchange can be achieved between the USB virtual network card and the host.

[0049] In some embodiments, the USB virtual network card is detected by the USB driver module; if the USB virtual network card is detected to be in an abnormal state, the USB virtual network card is re-registered. This ensures that the USB virtual network card is in an available state, so that the IP channel between the cloud PC terminal and the host remains connected, ensuring the overIP function of the USB device.

[0050] Specifically, the USB driver module can monitor the USB virtual network card in real time, thereby being able to detect the real-time status of the USB virtual network card.

[0051] Exemplarily, the status of the USB virtual network card can be detected through the USB driver module; if the status of the USB virtual network card is detected to be normal, it can be determined that the IP channel between the USB virtual network card and the host remains connected; if the status of the USB virtual network card is detected to be abnormal, the USB virtual network card is re-registered to ensure that the IP channel between the USB virtual network card and the host remains connected.

[0052] like Figure 1 As shown, the USB device access method includes steps S101 to S105.

[0053] S101. When the cloud PC terminal detects that a USB device is connected, the USB device plugging and unplugging information is obtained through the USB interface module.

[0054] Among them, the USB interface module can be connected to the cloud PC terminal for communication, so as to receive the USB device plugging and unplugging information sent by the cloud PC terminal. The USB device plugging and unplugging information may include USB device information, such as the USB device type and the actual communication link.

[0055] like Figure 4 As shown, in some embodiments, the USB interface module is connected to the cloud PC terminal through a switch, and a preset communication link between the USB interface module and the cloud PC terminal is established through the switch; the USB interface module obtains the USB device plug-in information through the preset communication link. Thus, the preset communication link can be established through the switch to enable data exchange between the USB interface module and the cloud PC terminal.

[0056] The preset communication link is used to represent a preset communication link for data transmission between the USB interface module and the cloud PC terminal.

[0057] Specifically, the USB interface module can realize communication connection with the cloud PC terminal through the switch, so that a data link with the USB virtual network card can be established through the switch, so that the IP network between the USB interface module and the cloud PC terminal can be opened, so that data exchange can be realized between the USB virtual network card and the host.

[0058] For example, when the cloud PC terminal is in use, it will automatically start the USB server program, which is used to receive the connection request of the host, so as to realize the interaction of USB data information. At this time, the cloud PC terminal monitors the USB interface status, and reports the device plug-in and unplug status on the USB interface to the cloud PC user terminal application. The cloud PC terminal notifies the USB interface module of the received USB device plug-in and unplug message through the IP network.

[0059] S102: Analyze the USB device plug-in and unplug-out information to obtain the USB device plug-in and unplug-out status.

[0060] The USB device plug-in and unplug-out status may include a USB device connected status and a USB device disconnected status.

[0061] In some embodiments, the USB device plugging and unplugging information is parsed to obtain the USB device type and the actual communication link; the USB device type and the actual communication link are verified; if both the USB device type and the actual communication link are successfully verified, the USB device plugging and unplugging status is generated. In this way, the USB device plugging and unplugging information sent by the cloud PC terminal can be verified, thereby ensuring the security of the USB device plugging and unplugging information.

[0062] The USB device type may include a printer, a USB flash drive, a camera, a mouse, etc. The actual communication link is used to indicate the communication link for actual data transmission between the USB interface module and the cloud PC terminal.

[0063] Specifically, since the USB interface module and the cloud PC terminal need to transmit data, and during the data transmission process, the USB device plug-in information is easily tampered with maliciously, so that the host can access a USB device of unknown origin, it is necessary to verify the USB device plug-in information to ensure the security of the cloud PC server and the host. The embodiment of the present application verifies the USB device type and the actual communication link, and generates the USB device plug-in status when both the USB device type and the actual communication link are successfully verified, thereby ensuring the security of the cloud PC server and the host.

[0064] Exemplarily, the USB device type and the actual communication link are verified; if the USB device type and the actual communication link are both successfully verified, the USB device plug-in status is generated; if the USB device type or the actual communication link verification fails, the generation of the USB device plug-in status is stopped, the connection between the USB interface module and the cloud PC terminal is disconnected, and a secure reconnection is performed.

[0065] In some embodiments, it is determined whether the USB device type is a preset USB device type; if the USB device type is a preset USB device type, it is determined whether the actual communication link is a preset communication link; if the actual communication link is a preset communication link, it is determined that both the USB device type and the actual communication link are successfully verified. In this way, the USB device type and the communication link can be verified, thereby ensuring the security of the USB device plug-in and unplug information.

[0066] Among them, the preset USB device type is the USB device type actually inserted into the cloud PC terminal, and the preset communication link is the pre-established communication link between the USB interface module and the cloud PC terminal.

[0067] Specifically, determine whether the USB device type is a preset USB device type; if the USB device type is the preset USB device type, determine whether the actual communication link is the preset communication link; if the USB device type is not the preset USB device type, determine that the USB device plug-in information verification is unsuccessful; if the actual communication link is the preset communication link, determine that both the USB device type and the actual communication link are successfully verified; if the actual communication link is not the preset communication link, determine that the USB device plug-in information verification is unsuccessful.

[0068] Exemplarily, if the preset USB device type is a mouse, the preset communication link is communication link A. If it is determined that the USB device type obtained by parsing is a mouse, and the actual communication link obtained by parsing is also communication link A, then it is determined that both the USB device type and the actual communication link are successfully verified. If the USB device type obtained by parsing is a printer, or the actual communication link obtained by parsing is communication link B, then it is determined that the USB device plug-in information verification is unsuccessful.

[0069] S103, building a data link between the USB interface module and the host through the USB virtual network card, and sending the USB device plug-in status to the host through the data link.

[0070] The data link may be a link for data transmission between the USB interface module and the host.

[0071] In some embodiments, the host includes a host network card, and the host identifies the USB virtual network card through a USB bus; after the host identifies the USB virtual network card, the USB virtual network card is assigned network address information; based on the network address information, the USB virtual network card is bound to the host network card to establish a data link between the USB interface module and the host. Thus, a data link can be established between the USB interface module and the host through the USB virtual network card, so that the USB interface module and the host can perform data transmission.

[0072] The network address information is the IP address and gateway of the USB virtual network card host. The host network card is the real network card on the host.

[0073] Specifically, the host can identify the generated USB virtual network card through the USB bus. After the host identifies the USB virtual network card, it assigns an IP address and gateway to the USB virtual network card. The cloud PC server configures iptables rules to forward the traffic of the USB virtual network card to the host network card. The host runs the usbip_client program to communicate with the USB interface module through the USB virtual network card. At this time, the host traffic enters the USB interface module through the USB virtual network card. The cloud PC server uses iptables to forward the traffic of the USB virtual network card to the host network card and hides the address at the host network card exit, thereby binding the USB virtual network card to the host network card to establish a data link between the USB interface module and the host.

[0074] Exemplarily, after the host recognizes the USB virtual network card, the host can bind to the DHCP server to assign an IP address and gateway of 192.168.1.2 and 192.168.1.1 respectively to the USB virtual network card.

[0075] S104: If the host determines that the plug-in state of the USB device is the USB device connected state, the host identifies the USB device through a USB driver.

[0076] The USB device plug-in and unplug-out status may include a USB device connected status and a USB device disconnected status.

[0077] Specifically, if the USB device plug-in / plug-out state is determined to be the USB device connected state, and after the USB device plug-in / plug-out information is successfully verified, the host may identify the USB device by loading a built-in USB driver.

[0078] Exemplarily, if the USB device plug-in and unplug-out state is determined to be the USB device connected state, the host can load an open source USB driver to identify the connected USB device through the USB driver so as to subsequently drive and call the USB device.

[0079] S105: After the host recognizes the USB device, the host drives and calls the USB device through the data link.

[0080] Specifically, after the host recognizes the USB device, the host can drive and call the USB device through the data link, so that the cloud PC terminal can send USB data information to the host through the USB bus, so that the host can access the USB device and process the USB data information.

[0081] The USB data information may include USB disk data, printer data, camera data and other data used to interact with the host.

[0082] For example, the host can drive the USB device to connect to the host, and call U disk data, printer data, camera data and other data, so that the above data can be processed on the host, thereby realizing the over IP function of the USB device, and can also reduce the development cost and use cost of remote management, and has good compatibility and scalability.

[0083] Exemplarily, when receiving the disconnection status of the USB device, the host may disconnect the host from the USB virtual network card through the USB driver, thereby implementing the unplugging operation of the USB device.

[0084] like Figure 5 As shown, the following will be combined Figure 5 The workflow of the USB device access method provided in the embodiment of the present application is described, and the steps include step S301-step S301.

[0085] S301, the cloud PC terminal is turned on and the USB server program is automatically started to receive the connection of the host and the USB data interaction request.

[0086] S302: The cloud PC terminal monitors the USB interface status. If it is detected that a USB device is plugged in or out of the USB interface, the cloud PC user terminal notifies the cloud PC server of the received USB device plugging and unplugging message through the IP network.

[0087] S303: The cloud PC server parses the received USB device plug-in and unplug-out message, and sends the USB device plug-in and unplug-out status to the host through the USB virtual network card.

[0088] S304: The host receives the USB device access status, loads the USB device through the USB driver and connects to the cloud PC terminal.

[0089] S305: After receiving the USB device mounting request, the cloud PC terminal connects to the host, establishes a USB data transceiver channel, and implements the USB over IP service function.

[0090] S306: The host receives the status of the USB device being unplugged, and disconnects from the USB virtual network card through the USB driver, thereby implementing the unplugging operation of the USB device.

[0091] The present application discloses a method for accessing a USB device. When a cloud PC terminal detects that a USB device is connected, the USB device plugging and unplugging information is obtained through a USB interface module; the USB device plugging and unplugging information is parsed to obtain the plugging and unplugging status of the USB device; a data link between the USB interface module and the host is built through a USB virtual network card, and the plugging and unplugging status of the USB device is sent to the host through the data link; if the host determines that the plugging and unplugging status of the USB device is the USB device access status, the host identifies the USB device through a USB driver; after the host identifies the USB device, the host drives and calls the USB device through the data link. In this way, when the cloud PC server and the host are not connected using a network interface, an IP channel between the cloud PC terminal and the host can be built through a USB simulated virtual network card, thereby realizing the over IP function of the USB device, and reducing the development cost and use cost of remote management, and having good compatibility and scalability.

[0092] See also Figure 6 , Figure 6 It is a schematic block diagram of a USB device access device provided in an embodiment of the present application. The USB device access device is applied to a cloud desktop system. The cloud desktop system includes a cloud PC terminal and a cloud PC server. The cloud PC server includes a USB interface module, a USB virtual network card and a host. The USB interface module is used to communicate with the cloud PC terminal.

[0093] Specifically, Figure 6 As shown, the USB device access apparatus 400 includes: a device detection module 401 , a state analysis module 402 , a channel building module 403 , a device identification module 404 and a device calling module 405 .

[0094] The device detection module 401 is used to obtain the USB device plug-in information through the USB interface module when the cloud PC terminal detects that a USB device is connected;

[0095] The status analysis module 402 is used to analyze the USB device plug-in information to obtain the USB device plug-in status;

[0096] A channel building module 403 is used to build a data link between the USB interface module and the host through the USB virtual network card, and send the plug-in status of the USB device to the host through the data link;

[0097] The device identification module 404 is used for, if the host determines that the plug-in state of the USB device is the USB device connected state, the host identifies the USB device through a USB driver;

[0098] The device calling module 405 is used for the host to drive and call the USB device through the data link after the host recognizes the USB device.

[0099] In some embodiments, the channel building module 403, the host is used to identify the USB virtual network card through the USB bus; after the host identifies the USB virtual network card, the USB virtual network card is assigned network address information; based on the network address information, the USB virtual network card is bound to the host network card to establish a data link between the USB interface module and the host

[0100] In some embodiments, the USB driver module 406 is used to generate the USB virtual network card on the cloud PC server through the USB driver module; obtain the device parameters of the USB interface module and the host, and configure the device parameters of the USB virtual network card according to the device parameters so that the USB virtual network card can achieve communication connection with the USB interface module and the host.

[0101] In some embodiments, the USB driver module 406 is further used to detect the status of the USB virtual network card through the USB driver module; if it is detected that the status of the USB virtual network card is abnormal, the USB virtual network card is re-registered.

[0102] In some embodiments, the device detection module 401 is further used to establish a preset communication link between the USB interface module and the cloud PC terminal through the switch; the USB interface module obtains USB device plug-in information through the preset communication link.

[0103] In some embodiments, the status analysis module 402 is also used to parse the USB device plug-in and unplug-in information to obtain the USB device type and the actual communication link; verify the USB device type and the actual communication link; if the USB device type and the actual communication link are both verified successfully, the USB device plug-in and unplug-in status is generated.

[0104] In some embodiments, the status analysis module 402 is also used to determine whether the USB device type is a preset USB device type; if the USB device type is the preset USB device type, determine whether the actual communication link is the preset communication link; if the actual communication link is the preset communication link, determine that both the USB device type and the actual communication link are verified successfully.

[0105] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0106] The method and apparatus of the present application can be used in many general or special computing system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer terminal devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices.

[0107] See also Figure 7 , Figure 7 A schematic block diagram of the structure of a terminal device 500 provided in an embodiment of the present application.

[0108] like Figure 7 As shown, the terminal device 500 may include a processor 501 and a memory 502, and the processor 501 and the memory 502 are connected via a bus 503, such as an I2C (Inter-integrated Circuit) bus.

[0109] In an exemplary embodiment, the processor 501 can be used to provide computing and control capabilities to support the operation of the entire terminal device. The processor 501 can be a central processing unit (CPU), and the processor 501 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0110] Specifically, the memory 502 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.

[0111] Those skilled in the art will understand that Figure 7The structure shown in the figure is only a block diagram of a partial structure related to the embodiment of the present application, and does not constitute a limitation on the terminal device to which the embodiment of the present application is applied. The specific server may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0112] The processor 501 is used to run a computer program stored in the memory, and implement any one of the USB device access methods provided in the embodiments of the present application when executing the computer program.

[0113] In one embodiment, the processor 501 is used to run a computer program stored in a memory, and implement the following steps when executing the computer program: when the cloud PC terminal detects that a USB device is connected, the USB device plug-in information is obtained through the USB interface module; the USB device plug-in information is parsed to obtain the USB device plug-in status; a data link between the USB interface module and the host is established through the USB virtual network card, and the USB device plug-in status is sent to the host through the data link; if the host determines that the USB device plug-in status is a USB device access status, the host identifies the USB device through a USB driver; after the host identifies the USB device, the host drives and calls the USB device through the data link.

[0114] In one embodiment, the processor 501 is also used to implement: the host identifies the USB virtual network card through the USB bus; after the host identifies the USB virtual network card, allocates network address information to the USB virtual network card; based on the network address information, binds the USB virtual network card to the host network card to establish a data link between the USB interface module and the host.

[0115] In one embodiment, the processor 501 is also used to implement: generating the USB virtual network card on the cloud PC server through the USB driver module; obtaining device parameters of the USB interface module and the host, and configuring the device parameters of the USB virtual network card according to the device parameters so that the USB virtual network card can achieve communication connection with the USB interface module and the host.

[0116] In one embodiment, the processor 501 is further used to implement: performing status detection on the USB virtual network card through the USB driver module; if it is detected that the status of the USB virtual network card is abnormal, re-registering the USB virtual network card.

[0117] In one embodiment, the processor 501 is further used to implement: establishing a preset communication link between the USB interface module and the cloud PC terminal through the switch; and the USB interface module obtaining USB device plug-in and unplugging information through the preset communication link.

[0118] In one embodiment, the processor 501 is also used to implement: parsing the USB device plug-in and unplug-out information to obtain the USB device type and the actual communication link; verifying the USB device type and the actual communication link; if the USB device type and the actual communication link are both successfully verified, generating the USB device plug-in and unplug-out status.

[0119] In one embodiment, the processor 501 is also used to implement: determining whether the USB device type is a preset USB device type; if the USB device type is the preset USB device type, determining whether the actual communication link is the preset communication link; if the actual communication link is the preset communication link, determining that both the USB device type and the actual communication link are verified successfully.

[0120] It should be noted that technicians in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working process of the terminal device described above can refer to the corresponding process in the aforementioned USB device access method embodiment, and will not be repeated here.

[0121] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed, any one of the USB device access methods provided in the embodiments of the present application is implemented.

[0122] The computer-readable storage medium may be an internal storage unit of the smart glasses described in the foregoing embodiments, such as a memory of the smart glasses. The computer-readable storage medium may also be an external storage device of the smart glasses, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the smart glasses.

[0123] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like.

[0124] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A USB device access method, characterized in that: Applied to a cloud desktop system, the cloud desktop system includes a cloud PC terminal and a cloud PC server, the cloud PC server includes a USB interface module, a USB virtual network card and a host, the USB interface module is used to communicate with the cloud PC terminal; the method includes: When the cloud PC terminal detects that a USB device is connected, the USB device plug-in information is obtained through the USB interface module; Parsing the USB device plug-in and unplug-out information to obtain the USB device plug-in and unplug-out status; Building a data link between the USB interface module and the host through the USB virtual network card, and sending the plug-in and unplug-out status of the USB device to the host through the data link; If the host determines that the plug-in / unplug-out state of the USB device is the USB device access state, the host identifies the USB device through a USB driver; After the host recognizes the USB device, the host drives and calls the USB device through the data link.

2. The method according to claim 1, characterized in that The host includes a host network card, and the data link between the USB interface module and the host is established through the USB virtual network card, and further includes: The host identifies the USB virtual network card through a USB bus; After the host recognizes the USB virtual network card, assigning network address information to the USB virtual network card; Based on the network address information, the USB virtual network card is bound to the host network card to establish a data link between the USB interface module and the host.

3. The method according to claim 1, characterized in that: The cloud PC server also includes a USB driver module, and the method further includes: Generate the USB virtual network card on the cloud PC server through the USB driver module; The device parameters of the USB interface module and the host are obtained, and the device parameters of the USB virtual network card are configured according to the device parameters so that the USB virtual network card can achieve communication connection with the USB interface module and the host.

4. The method according to claim 3, characterized in that The method further comprises: Performing status detection on the USB virtual network card through the USB driver module; If it is detected that the state of the USB virtual network card is an abnormal state, the USB virtual network card is re-registered.

5. The method according to claim 1, characterized in that The USB interface module is communicatively connected to the cloud PC terminal via a switch, and the method further includes: Establishing a preset communication link between the USB interface module and the cloud PC terminal through the switch; The obtaining of USB device plugging and unplugging information through the USB interface module includes: The USB interface module obtains USB device plug-in and unplug-out information through the preset communication link.

6. The method according to claim 1, characterized in that The step of parsing the USB device plug-in and unplug-out information to obtain the USB device plug-in and unplug-out status includes: Parsing the USB device plug-in and unplug-out information to obtain the USB device type and the actual communication link; Verifying the USB device type and the actual communication link; If both the USB device type and the actual communication link are successfully verified, the USB device plug-in status is generated.

7. The method according to claim 6, characterized in that The verifying the USB device type and the actual communication link includes: Determine whether the USB device type is a preset USB device type; If the USB device type is a preset USB device type, determining whether the actual communication link is the preset communication link; If the actual communication link is a preset communication link, it is determined that both the USB device type and the actual communication link are successfully verified.

8. A USB device access device, characterized in that: Applied to a cloud desktop system, the cloud desktop system includes a cloud PC terminal and a cloud PC server, the cloud PC server includes a USB interface module, a USB virtual network card and a host, the USB interface module is used to communicate with the cloud PC terminal; the device includes: The device detection module is used to obtain the USB device plug-in information through the USB interface module when the cloud PC terminal detects that a USB device is connected; A status analysis module, used to analyze the USB device plug-in information to obtain the USB device plug-in status; A channel building module, used to build a data link between the USB interface module and the host through the USB virtual network card, and send the plug-in and unplug-out status of the USB device to the host through the data link; A device identification module, configured to identify the USB device by using a USB driver if the host determines that the plug-in state of the USB device is the USB device connected state; The device calling module is used for, after the host recognizes the USB device, the host drives and calls the USB device through the data link.

9. A terminal device, characterized in that: The terminal device includes: a memory and a processor; wherein the memory is connected to the processor and is used to store programs, and the processor is used to implement any one of the USB device access methods described in claims 1 to 8 by running the programs stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the USB device access method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Dual-agent network isolation transmission method and device based on USBoIP and storage medium

    CN120602226A