Redirection method and device of USB (Universal Serial Bus) multimode equipment, electronic equipment and medium

By loading the USB redirection driver and redirecting the USB multimode device to the cloud desktop, the problem that the cloud desktop cannot recognize the USB multimode device mode is solved, and the effect of users using USB multimode devices normally in the cloud desktop is achieved.

CN119557050APending Publication Date: 2025-03-04NEW H3C CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411707731.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the cloud desktop scenario, when the USB multimode device switches mode, the cloud desktop cannot correctly identify the device mode of the USB multimode device, resulting in the user being unable to use the USB multimode device normally.

Method used

By obtaining device information of USB multimode device and loading the USB redirection driver according to the preset USB driver replacement policy, the driver is used to redirect the USB multimode device to the cloud desktop to ensure the correct identification and switching of device mode.

Benefits of technology

It solves the problem that users cannot correctly identify the device type mode of USB multimode devices in the cloud desktop, allowing users to use USB multimode devices normally in the cloud desktop.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557050A_ABST
    Figure CN119557050A_ABST
Patent Text Reader

Abstract

The invention provides a redirection method and device for USB multimode equipment, electronic equipment and a medium. The method comprises the following steps: acquiring equipment information of the USB multi-mode equipment, wherein the USB multi-mode equipment is in a first mode; if the equipment information is matched with the preset USB driver replacement strategy, loading a USB redirection driver; redirecting the USB multimode device in the first mode to the cloud desktop by using a USB redirection drive; and after the USB multi-mode equipment is switched from the first mode to the second mode, redirecting the USB multi-mode equipment in the second mode to the cloud desktop by utilizing the USB redirection drive.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing technology, and in particular to a method, device, electronic device and medium for redirecting a USB multi-mode device. Background Art

[0002] With the development of desktop virtualization technology, various USB devices are often used in cloud desktop scenarios, such as USB flash drives, USB cameras, USB wireless network cards, USB printers, etc. Among them, some USB devices are multi-mode devices, such as USB wireless network cards with built-in driver software, which have two modes: USB storage device and USB wireless network card. Another example is a USB printer with built-in driver software, which has two modes: USB storage device and USB printer.

[0003] In the cloud desktop scenario, when a USB multi-mode device switches modes, the cloud desktop cannot correctly identify the device mode of the USB multi-mode device, resulting in users being unable to use the USB multi-mode device normally in the cloud desktop. Summary of the invention

[0004] In order to overcome the problems existing in the related art, this specification provides a redirection method, apparatus, electronic device and medium for a USB multi-mode device.

[0005] According to a first aspect of an embodiment of the present specification, a redirection method for a USB multi-mode device is provided, which is applied to a terminal device, wherein the terminal device is connected to the USB multi-mode device via a USB, and the method comprises: obtaining device information of the USB multi-mode device, wherein the USB multi-mode device is in a first mode; if the device information matches a preset USB driver replacement policy, loading a USB redirection driver; redirecting the USB multi-mode device in the first mode to a cloud desktop using the USB redirection driver; and after the USB multi-mode device switches from the first mode to the second mode, redirecting the USB multi-mode device in the second mode to the cloud desktop using the USB redirection driver.

[0006] According to a second aspect of an embodiment of the present specification, a redirection device for a USB multi-mode device is provided, which is applied to a terminal device, wherein the terminal device is connected to the USB multi-mode device via a USB, and the device comprises: a device information acquisition module, which is used to acquire device information of the USB multi-mode device, wherein the USB multi-mode device is in a first mode; a first loading module, which is used to load a USB redirection driver if the device information matches a preset USB driver replacement policy; a first redirection module, which is used to redirect the USB multi-mode device in the first mode to a cloud desktop using the USB redirection driver; and a second redirection module, which is used to redirect the USB multi-mode device in the second mode to the cloud desktop using the USB redirection driver after the USB multi-mode device switches from the first mode to the second mode.

[0007] According to a third aspect of the embodiments of this specification, there is provided an electronic device, including:

[0008] processor;

[0009] a memory for storing processor-executable instructions;

[0010] The processor is configured to execute the redirection method for a USB multi-mode device according to the first aspect or any corresponding implementation manner thereof.

[0011] According to the fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the redirection method for a USB multi-mode device of the above-mentioned first aspect or any corresponding implementation method thereof.

[0012] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:

[0013] In the embodiments of the present specification, the USB redirection driver is automatically loaded according to the USB driver replacement strategy, and the USB redirection driver takes over the driver of the USB multi-mode device in the terminal operating system, thereby redirecting the device to the cloud desktop. This can solve the problem that the user cannot correctly identify the device type mode of the USB multi-mode device in the cloud desktop, so that the user can use the USB multi-mode device normally in the cloud desktop.

[0014] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.

[0016] Figure 1 It is a schematic diagram of a system architecture shown in this specification according to an exemplary embodiment.

[0017] Figure 2 This is a flowchart of a redirection method for a USB multi-mode device according to an exemplary embodiment of this specification.

[0018] Figure 3 This is a flowchart of another method for redirecting a USB multi-mode device according to an exemplary embodiment of this specification.

[0019] Figure 4 It is a hardware structure diagram of a computer device where the redirection device of the USB multi-mode device in the embodiment of this specification is located.

[0020] Figure 5 This is a block diagram of a redirection device for a USB multi-mode device according to an exemplary embodiment of the present specification. DETAILED DESCRIPTION

[0021] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this specification. Instead, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the appended claims.

[0022] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. The singular forms "a", "the" and "the" used in this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0023] It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0024] Next, the embodiments of this specification are described in detail.

[0025] The following combination Figure 1 The system architecture of the redirection method and apparatus for USB multi-mode devices in the embodiments of this specification is described. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of this specification can be applied, to help those skilled in the art understand the technical content of this specification, but it does not mean that the embodiments of this specification cannot be used in other devices, systems, environments or scenarios.

[0026] Figure 1 It is a schematic diagram of a system architecture shown in this specification according to an exemplary embodiment.

[0027] like Figure 1 As shown, the system architecture may include, for example, a terminal device, a network and a server. The network is used to provide a medium for a communication link between the terminal device and the server. The network may include various connection types, such as wired and / or wireless communication links, etc.

[0028] Users can use terminal devices to interact with servers through the network to receive or send messages, etc. Various communication client applications can be installed on the terminal devices, such as service access clients, web browser applications, search applications, instant messaging tools, email clients and / or social platform software.

[0029] The terminal device can be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers and desktop computers, etc. The terminal device can be connected to a USB multimode device, which refers to a USB device that can be operated in multiple modes or uses. After being connected to a computer or host, this type of device can change its device mode as needed. For example, a USB multimode device can include a USB wireless network card, a USB printer, a USB camera, etc. with multiple modes.

[0030] The server can be a server that provides cloud desktop services. Cloud desktop services are a desktop virtualization solution based on cloud computing technology, which allows users to access a virtualized desktop environment through the Internet. This service provides a centrally managed, scalable, on-demand computing environment, and users can remotely access the server from a terminal device to obtain cloud desktop services.

[0031] In the cloud desktop scenario, the following problem exists: the cloud desktop cannot correctly identify the device mode of the USB multi-mode device when the USB multi-mode device switches modes. After the driver is installed in the cloud desktop, the USB multi-mode device is always in the initial device mode and cannot be switched to other device modes.

[0032] Take a multi-mode printer as an example. When a multi-mode printer device is inserted into a terminal, the initial mode is a USB storage device. The operating system of the terminal broadcasts a device insertion event, which is detected by the USB redirection service. After the USB redirection service finds that a new USB device has been inserted, it is ready to redirect it to the cloud desktop. But first, the driver of this device needs to be replaced with a USB redirection driver. The reason for replacing the USB redirection driver is that it is necessary to take over the control of this USB device so that other programs in the operating system cannot use this USB device. The driver replacement process requires resetting the multi-mode printer device. During the reset process, the multi-mode printer device is first ejected and then inserted. After reinsertion, the multi-mode printer is still a USB storage device type. The USB filter driver of the terminal kernel loads the USB redirection driver for the multi-mode printer device object. When the USB redirection service detects that the device has completed loading the USB redirection driver, it can initiate USB redirection and share the multi-mode printer to the cloud desktop.

[0033] According to the normal USB redirection process, a virtual USB device object is created in the cloud desktop. Then the cloud desktop operating system loads the USB storage driver for the virtual device according to the device classification "USB storage" and displays it as a storage device. At this time, if the driver of this multi-mode printer has not been installed in the cloud desktop, you need to install the driver manually. After the installation is complete, the kernel loads the multi-mode printer driver. The multi-mode printer driver will send a mode switching instruction to the virtual USB device object to switch the printer device to USB printer mode.

[0034] After receiving the command to switch modes, the multi-mode printer of the terminal will reset to switch from USB storage mode to USB printer mode. During this reset process, the multi-mode printer device will be ejected and then inserted from the terminal operating system. The USB redirection service of the terminal listens to the device ejection event and unredirects the device from the virtual machine. Then, the multi-mode device is reinserted into the terminal. At this time, the multi-mode printer is already in printer mode. The USB redirection service of the terminal listens to the device insertion event and prepares to redirect the device to the cloud desktop. It sends a command to reset the device to the multi-mode printer again to replace the driver with the USB redirection driver. The multi-mode device is reset again, and after being ejected and reinserted, its working mode returns to the initial USB storage device mode. The terminal operating system loads the USB redirection driver for the multi-mode device. The USB redirection service detects that the USB redirection driver has been loaded for the multi-mode printer and redirects the device to the cloud desktop.

[0035] After the multi-mode printer is redirected to the cloud desktop again, because it is in USB storage device mode, the corresponding virtual device in the cloud desktop is also in storage device mode. The cloud desktop operating system loads the USB storage driver for the virtual device according to the device classification, and the multi-mode printer is still a storage device in the cloud desktop. Therefore, this device is always identified as a USB storage device in the cloud desktop and cannot be used normally.

[0036] The following is a detailed description of the redirection method for a USB multi-mode device provided in the embodiments of this specification. Figure 2 As shown, Figure 2 This is a flowchart of a method for redirecting a USB multi-mode device according to an exemplary embodiment of this specification. The method can be applied to a terminal device, and the terminal device can be connected to a USB multi-mode device via USB. The method for redirecting a USB multi-mode device provided in the embodiment of this specification may include the following steps.

[0037] In step 210, device information of the USB multi-mode device is obtained, and the USB multi-mode device is in the first mode.

[0038] In step 220, if the device information matches the preset USB driver replacement policy, the USB redirection driver is loaded.

[0039] In step 230, the USB multi-mode device in the first mode is redirected to the cloud desktop using a USB redirection driver.

[0040] In step 240, after the USB multi-mode device is switched from the first mode to the second mode, the USB multi-mode device in the second mode is redirected to the cloud desktop using a USB redirection driver.

[0041] According to the embodiments of the present specification, the USB redirection driver is automatically loaded according to the USB driver replacement strategy, and the USB redirection driver takes over the driver of the USB multi-mode device in the terminal operating system, thereby redirecting the device to the cloud desktop. This can solve the problem that the user cannot correctly identify the device type mode of the USB multi-mode device in the cloud desktop, so that the user can use the USB multi-mode device normally in the cloud desktop.

[0042] According to an embodiment of the present specification, a USB multi-mode device may be a USB device with multiple modes, such as a USB wireless network card with built-in driver software, a USB printer, a USB camera, etc. Exemplarily, in the present embodiment, a USB multi-mode device may include a first mode and a second mode. The first mode may, for example, be the initial device mode of the USB multi-mode device. The second mode may, for example, be the device mode corresponding to the target function of the USB multi-mode device. For example, for a multi-mode USB printer, the first mode may be a USB memory mode, and the second mode may be a USB printer mode. In the USB memory mode, the USB printer is identified as a USB memory and can be used to provide a device driver. In the USB printer mode, the USB printer is identified as a USB printer and can be used to provide a printing function.

[0043] According to an embodiment of the present specification, the device information of the USB multi-mode device may include, for example, various information that can be used to match the device.

[0044] According to an embodiment of the present specification, the USB driver replacement policy can be used to indicate which USB devices need to automatically replace the driver. For USB devices that need to automatically replace the driver, as soon as the USB device is inserted into the USB interface of the terminal, the USB redirection driver is loaded for this device object, rather than waiting for the USB redirection service to perform the redirection operation. The advantage of this is that the driver replacement action during the USB redirection operation is avoided, and the device will not be reset during the redirection process, thereby ensuring that the working mode of the USB multi-mode device will not be changed to the initial USB storage mode due to the redirection operation.

[0045] Optionally, the device information may include, for example, at least one of a hardware identification and a compatible identification. Among them, the hardware identification may include a hardware ID. The hardware ID is a unique definition used to identify the hardware configuration of a computer or device. It can be generated by hardware information such as the motherboard, CPU, hard disk, etc., and the ID of each computer is unique. The hardware ID can help the system identify and match the corresponding driver to ensure that the device can work properly. The compatible identification may include a compatible ID. The compatible ID is a string defined by the device manufacturer to indicate that any driver package that claims to support the device can be used with a device with this ID. When the hardware ID of the device cannot accurately match the existing driver, the operating system can find a suitable driver package through the compatible ID to ensure that the device can work properly. The existence of a compatible ID improves the compatibility of the device and the success rate of device installation.

[0046] Correspondingly, the hardware identification and / or compatible identification of each USB multimode device can be recorded in advance in the USB driver replacement policy. Based on this, it can be determined whether the USB driver replacement policy contains at least one of the hardware identification and compatible identification of the USB multimode device. If the USB driver replacement policy contains at least one of the hardware identification and compatible identification of the USB multimode device, it is determined that the USB multimode device matches the USB driver replacement policy. Otherwise, it is determined that the USB multimode device does not match the USB driver replacement policy.

[0047] Optionally, after the USB multimode device in the first mode is redirected to the cloud desktop using the USB redirection driver, if the cloud desktop has not installed the second mode driver, the second mode driver can be installed. In this embodiment, the first mode may include a USB memory mode, and when the USB multimode device is in the USB memory mode, it is identified as a USB memory. Based on this, the terminal device can obtain the second mode driver from the USB multimode device in the USB memory mode, and then send the second mode driver to the cloud desktop, and then the cloud desktop installs the second mode driver.

[0048] Optionally, after installing the second mode driver, the cloud desktop can use the second mode driver to control the USB multi-mode device to switch the mode, so as to switch the device mode from the first mode to the second mode. Based on this, the cloud desktop can use the second mode driver to generate a mode switching instruction, and then send it to the USB multi-mode device via the terminal device, so that the USB multi-mode device switches from the first mode to the second mode according to the mode switching instruction.

[0049] After receiving the mode switching instruction, the USB multi-mode device will reset to switch the mode. During the reset, the USB multi-mode device is first ejected and then reinserted. After detecting that the USB multi-mode device is ejected, the terminal device can cancel the redirection of the current USB multi-mode device to the cloud desktop. After the USB multi-mode device is reinserted, the USB multi-mode device switches from the first mode to the second mode. After the terminal device detects that the USB multi-mode device is reinserted, it can reload the USB redirection driver, and then use the USB redirection driver to redirect the USB multi-mode device to the cloud desktop.

[0050] like Figure 3 FIG. 1 is a flowchart of another method for redirecting a USB multi-mode device according to an exemplary embodiment.

[0051] Exemplarily, in this embodiment, the terminal device may include an operating system, a USB redirection service, and a cloud desktop client (referred to as the client). The server may include a cloud desktop operating system. The USB multi-mode device may be a multi-mode printer.

[0052] In this implementation, the method for redirecting a USB multi-mode device may include the following steps:

[0053] After the cloud desktop client is started, it will send a USB policy to the terminal's USB redirection service. This policy will specify which USB devices need to have their drivers automatically replaced. After receiving the USB policy, the USB redirection service will send it to the USB filter driver.

[0054] After the USB multi-mode device is inserted into the terminal, the USB multi-mode device is initially in the first mode (USB storage mode).

[0055] The USB filter driver in the terminal operating system kernel determines whether the device information of the USB multi-mode device matches the USB driver replacement policy. If the device information matches the USB driver replacement policy, the USB redirection driver corresponding to the USB multi-mode device is loaded. Then, the terminal operating system broadcasts the device insertion event. The USB redirection service listens to the device insertion and prepares to perform USB redirection. The newly inserted device has already loaded the USB redirection driver, so USB redirection can be initiated directly without resetting the device to replace the driver.

[0056] The USB redirection service of the terminal redirects the USB multi-mode device to the cloud desktop. A corresponding virtual USB device is added to the cloud desktop, and its device mode is the first mode, so the cloud desktop operating system will load the first mode driver for it. Exemplarily, in this embodiment, the first mode can be a USB storage mode, and correspondingly, the first mode driver can be a USBstorage driver.

[0057] If the second mode driver is not installed in the cloud desktop, you need to install the second mode driver in the cloud desktop. For example, the cloud desktop can use the USB storage driver to obtain the second mode driver from the USB multi-mode device in USB storage mode via the terminal. Then the cloud desktop loads the second mode driver. If the cloud desktop has previously installed the second mode driver, the installation step is omitted.

[0058] The second mode driver can send a switching mode instruction to the USB multi-mode device to switch the device working mode to the second mode. The switching mode instruction is forwarded layer by layer through USB redirection and finally sent to the USB multi-mode device connected to the terminal.

[0059] The USB multi-mode device is reset according to the switch mode instruction. During this reset process, the USB multi-mode device is first ejected from the terminal operating system and then inserted. Therefore, the terminal operating system will broadcast the device unplugging event and the device plugging event one by one.

[0060] The USB redirection service of the terminal monitors the device pop-up event, cancels the redirection of the USB multi-mode device, and returns the USB multi-mode device to the terminal. Then, the USB multi-mode device is reinserted into the terminal, and the USB multi-mode device is now in the second mode. In this embodiment, the second mode can be a printer mode. Because the USB filter driver of the terminal judges according to the policy, the system automatically loads the USB redirection driver. Therefore, after receiving the device insertion event of the USB multi-mode device, the USB redirection service of the terminal directly uses the USB redirection driver to redirect the USB multi-mode device to the cloud desktop without resetting the device.

[0061] Because the device is not reset again, the virtual USB device added to the cloud desktop after redirection will maintain the same second mode as the terminal USB multi-mode device, and the cloud desktop will load the second mode driver for it accordingly. For example, in this embodiment, the USB multi-mode device is switched to printer mode, and the cloud desktop operating system will correctly identify the USB multi-mode device as a printer device and load the corresponding printer driver for it.

[0062] Corresponding to the embodiments of the aforementioned method, this specification also provides embodiments of a redirection device for a USB multi-mode device and a terminal to which it is applied.

[0063] The embodiment of the redirection device of the USB multi-mode device in this specification can be applied to computer devices, such as servers or terminal devices. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, if Figure 4 As shown in the figure, it is a hardware structure diagram of the computer device where the redirection device of the USB multi-mode device in the embodiment of this specification is located. Figure 4 In addition to the processor 410, memory 430, network interface 420, and non-volatile memory 440 shown, the server or electronic device where the device 431 is located in the embodiment may also include other hardware according to the actual function of the computer device, which will not be described in detail.

[0064] like Figure 5 As shown, Figure 5 This is a block diagram of a redirection device for a USB multi-mode device according to an exemplary embodiment of this specification. The device can be applied to a terminal device, and the terminal device is connected to the USB multi-mode device via a USB. The device includes:

[0065] The device information acquisition module 510 is used to acquire device information of a USB multi-mode device, where the USB multi-mode device is in a first mode;

[0066] A first loading module 520, configured to load a USB redirection driver if the device information matches a preset USB driver replacement policy;

[0067] A first redirection module 530, configured to redirect a USB multi-mode device in a first mode to a cloud desktop using a USB redirection driver;

[0068] The second redirection module 540 is used to redirect the USB multi-mode device in the second mode to the cloud desktop using a USB redirection driver after the USB multi-mode device switches from the first mode to the second mode.

[0069] Optionally, the device information includes at least one of a hardware identifier and a compatible identifier; the apparatus may further include:

[0070] A matching module, used to determine whether the USB driver replacement strategy includes at least one of a hardware identifier and a compatible identifier of the USB multi-mode device;

[0071] The determination module is used to determine that the USB multi-mode device matches the USB driver replacement policy if the USB driver replacement policy contains at least one of the hardware identification and the compatible identification of the USB multi-mode device.

[0072] Optionally, the first mode includes a USB storage mode; the device may further include:

[0073] A driver acquisition module, used to use the USB redirection driver to redirect the USB multi-mode device in the first mode to the cloud desktop, and then use the first mode driver to acquire the second mode driver from the USB multi-mode device in the USB storage mode;

[0074] The driver sending module is used to send the second mode driver to the cloud desktop so that the cloud desktop can install the second mode driver.

[0075] Optionally, the device may further include:

[0076] A receiving module, used to receive a mode switching instruction sent by the cloud desktop;

[0077] The instruction sending module is used to send a mode switching instruction to the USB multi-mode device, so that the USB multi-mode device switches from the first mode to the second mode according to the mode switching instruction.

[0078] Optionally, the process of switching the USB multi-mode device from the first mode to the second mode includes ejecting the USB multi-mode device from the terminal device and then reinserting the USB multi-mode device into the terminal device; the apparatus may further include:

[0079] A release module, used to release the redirection of the USB multi-mode device to the cloud desktop if the USB multi-mode device is detected to be ejected;

[0080] The second loading module is used to reload the USB redirection driver if it is detected that the USB multi-mode device is reinserted.

[0081] According to the embodiments of the present specification, the USB redirection driver is automatically loaded according to the USB driver replacement strategy, and the USB redirection driver takes over the driver of the USB multi-mode device in the terminal operating system, thereby redirecting the device to the cloud desktop. This can solve the problem that the user cannot correctly identify the device type mode of the USB multi-mode device in the cloud desktop, so that the user can use the USB multi-mode device normally in the cloud desktop.

[0082] Correspondingly, the present specification also provides an electronic device, which includes a processor; a memory for storing processor executable instructions; wherein the processor is configured to: obtain device information of a USB multi-mode device, the USB multi-mode device being in a first mode; if the device information matches a preset USB driver replacement policy, load a USB redirection driver; redirect the USB multi-mode device in the first mode to a cloud desktop using the USB redirection driver; after the USB multi-mode device switches from the first mode to the second mode, redirect the USB multi-mode device in the second mode to the cloud desktop using the USB redirection driver.

[0083] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0084] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying creative labor.

[0085] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0086] Those skilled in the art will readily appreciate other embodiments of the specification after considering the specification and practicing the invention claimed herein. The specification is intended to cover any variations, uses or adaptations of the specification that follow the general principles of the specification and include common knowledge or customary techniques in the art that are not claimed in the specification. The specification and examples are to be considered exemplary only, and the true scope and spirit of the specification are indicated by the following claims.

[0087] It should be understood that the present description is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.

[0088] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

Claims

1. A redirection method for a USB multi-mode device, applied to a terminal device, wherein the terminal device is connected to the USB multi-mode device via a USB, characterized in that: The method comprises: Acquire device information of the USB multi-mode device, where the USB multi-mode device is in a first mode; If the device information matches the preset USB driver replacement policy, then loading the USB redirection driver; Redirecting the USB multi-mode device in the first mode to the cloud desktop using the USB redirection driver; After the USB multi-mode device is switched from the first mode to the second mode, the USB multi-mode device in the second mode is redirected to the cloud desktop using a USB redirection driver.

2. The method according to claim 1, characterized in that The device information includes at least one of a hardware identifier and a compatible identifier; the method further includes: Determine whether the USB driver replacement policy includes at least one of the hardware identifier of the USB multi-mode device and the compatible identifier; If the USB driver replacement policy includes at least one of the hardware identifier of the USB multi-mode device and the compatible identifier, it is determined that the USB multi-mode device matches the USB driver replacement policy.

3. The method according to claim 1, characterized in that The first mode includes a USB storage mode; after redirecting the USB multi-mode device in the first mode to the cloud desktop using the USB redirection driver, the method further includes: Using the first mode driver, obtaining a second mode driver from the USB multi-mode device in the USB memory mode; The second mode driver is sent to the cloud desktop so that the cloud desktop installs the second mode driver.

4. The method according to claim 1, characterized in that The method further comprises: Receive the mode switching command sent by the cloud desktop; The mode switching instruction is sent to the USB multi-mode device, so that the USB multi-mode device switches from the first mode to the second mode according to the mode switching instruction.

5. The method according to claim 1, characterized in that The process of switching the USB multi-mode device from the first mode to the second mode includes ejecting the terminal device from the USB multi-mode device and then reinserting the terminal device; the method further includes: If it is detected that the USB multi-mode device is ejected, canceling the redirection of the USB multi-mode device to the cloud desktop; If it is detected that the USB multi-mode device is reinserted, the USB redirection driver is reloaded.

6. A redirection device for a USB multi-mode device, applied to a terminal device, wherein the terminal device is connected to the USB multi-mode device via a USB, characterized in that: The device comprises: A device information acquisition module, used to acquire device information of the USB multi-mode device, wherein the USB multi-mode device is in a first mode; A first loading module, configured to load a USB redirection driver if the device information matches a preset USB driver replacement policy; A first redirection module, configured to redirect the USB multi-mode device in the first mode to a cloud desktop using the USB redirection driver; The second redirection module is used to redirect the USB multi-mode device in the second mode to the cloud desktop using a USB redirection driver after the USB multi-mode device switches from the first mode to the second mode.

7. The device according to claim 6, characterized in that The device information includes at least one of a hardware identifier and a compatible identifier; the apparatus further includes: a matching module, configured to determine whether the USB driver replacement strategy includes at least one of the hardware identifier of the USB multi-mode device and the compatible identifier; The determination module is configured to determine that the USB multi-mode device matches the USB driver replacement policy if the USB driver replacement policy includes at least one of the hardware identifier of the USB multi-mode device and the compatible identifier.

8. The device according to claim 6, characterized in that The first mode includes a USB storage mode; the device further includes: A driver acquisition module, used for, after redirecting the USB multi-mode device in the first mode to the cloud desktop using the USB redirection driver, obtaining a second mode driver from the USB multi-mode device in the USB storage mode using the first mode driver; The driver sending module is used to send the second mode driver to the cloud desktop so that the cloud desktop can install the second mode driver.

9. An electronic device, comprising: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method according to any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 5.