CN109918320B - Control method and device of USB equipment and KVM control system - Google Patents

Control method and device of USB equipment and KVM control system Download PDF

Info

Publication number
CN109918320B
CN109918320B CN201910190151.0A CN201910190151A CN109918320B CN 109918320 B CN109918320 B CN 109918320B CN 201910190151 A CN201910190151 A CN 201910190151A CN 109918320 B CN109918320 B CN 109918320B
Authority
CN
China
Prior art keywords
usb
usb host
host
target
kvm
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910190151.0A
Other languages
Chinese (zh)
Other versions
CN109918320A (en
Inventor
关文杰
王志涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Tricolor Technology Co ltd
Original Assignee
Beijing Tricolor Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Tricolor Technology Co ltd filed Critical Beijing Tricolor Technology Co ltd
Priority to CN201910190151.0A priority Critical patent/CN109918320B/en
Publication of CN109918320A publication Critical patent/CN109918320A/en
Application granted granted Critical
Publication of CN109918320B publication Critical patent/CN109918320B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

The application provides a control method and device of USB equipment and a KVM control system, wherein the method comprises the following steps: judging whether a target Universal Serial Bus (USB) host is in an abnormal state or not; if yes, generating an enabling switching instruction; and starting the standby USB host to drive the USB equipment according to the enabling switching instruction. According to the embodiment of the application, when the target USB host is determined to be in the abnormal state, the standby USB host can be started according to the generated enabling switching instruction, so that the standby USB host replaces the target USB host to drive the USB equipment, and man-machine interaction is further achieved.

Description

Control method and device of USB equipment and KVM control system
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for controlling a USB device, and a KVM control system.
Background
Universal Serial Bus (USB) devices are used as Human Interface Devices (HID), and have the characteristics of being pluggable, reliable in data transmission, convenient to expand, low in cost and the like, and have become necessary peripherals of current electronic devices. Such as a mouse, keyboard, gamepad, etc., are commonly used USB devices.
In order to realize human-computer interaction, the USB device needs to establish a data transmission link with the USB host through the USB packet processing module, so that the USB host can drive the USB device through the established data transmission link, and after the USB device is successfully driven, the monitoring terminal can respond to an operation instruction sent by a user through the USB device through the data transmission link established between the USB packet processing module and the USB device.
However, once the USB host is abnormal, the data transmission link between the USB device and the USB host is interrupted, so that the USB device cannot be driven, thereby affecting human-computer interaction.
Disclosure of Invention
In view of this, an object of the present invention is to provide a method and an apparatus for controlling a USB device, and a KVM control system, which can ensure that the USB device is normally driven, and implement human-computer interaction.
In a first aspect, an embodiment of the present application provides a method for controlling a USB device, where the method includes:
judging whether a target Universal Serial Bus (USB) host is in an abnormal state or not;
if yes, generating an enabling switching instruction;
and starting the standby USB host to drive the USB equipment according to the enabling switching instruction.
With reference to the first aspect, an embodiment of the present application provides a first possible implementation manner of the first aspect, where the starting, according to the enable switching instruction, a standby USB host to drive a USB device includes:
receiving an enumeration request sent by the standby USB host according to the enabling switching instruction, and sending the enumeration request to the USB equipment;
receiving device attribute information returned by the USB device in response to the enumeration request of the standby USB host;
and sending the equipment attribute information to the standby USB host to drive the USB equipment by the standby USB host.
With reference to the first possible implementation manner of the first aspect, an embodiment of the present application provides a second possible implementation manner of the first aspect, where determining whether the target USB host is in an abnormal state includes:
after determining that the target USB host executes initialization operation, receiving an enumeration request sent by the target USB host, and transmitting the enumeration request to the USB device;
receiving the device attribute information returned by the USB device in response to the enumeration request, and returning the device attribute information to the target USB host;
judging whether the number of the equipment attribute information is matched with a preset number or not;
if not, judging whether an enumeration request sent again by the target USB host is received within a preset time length;
if not, determining that the target USB host is in an abnormal state.
With reference to the first aspect, an embodiment of the present application provides a third possible implementation manner of the first aspect, where determining whether the target USB host is in an abnormal state includes:
judging whether a timing data packet sent by the target USB host is received at a preset time point or not;
if not, determining that the target USB host is in an abnormal state.
With reference to the first aspect, an embodiment of the present application provides a fourth possible implementation manner of the first aspect, where the standby USB host includes a virtual USB host and other USB hosts except the target USB host; before starting the standby USB host to drive the USB device according to the enable switching instruction, the method further includes:
acquiring the priority of the virtual USB host and other USB hosts except the target USB host;
the starting of the standby USB host according to the enabling switching instruction to drive the USB equipment comprises the following steps:
and starting the virtual USB host and other USB hosts except the target USB host according to the enabling switching instruction, wherein the hosts with the highest priority level drive the USB equipment.
With reference to the first aspect, an embodiment of the present application provides a fifth possible implementation manner of the first aspect, where the method further includes:
receiving a reset signal sent by the target USB host;
generating an enabling reset instruction according to the reset signal;
and starting the target USB host according to the enabling reset instruction so as to drive the USB equipment through the target USB host.
In a second aspect, an embodiment of the present application further provides a control apparatus for a USB device, where the control apparatus includes:
the judging module is used for judging whether the target universal serial bus USB host is in an abnormal state or not;
the generation module is used for generating an enabling switching instruction if the target USB host is in an abnormal state;
and the control module is used for starting the standby USB host to drive the USB equipment according to the enabling switching instruction.
With reference to the second aspect, an embodiment of the present application provides a first possible implementation manner of the second aspect, where the control module is specifically configured to:
receiving an enumeration request sent by the standby USB host according to the enabling switching instruction, and sending the enumeration request to the USB equipment;
receiving device attribute information returned by the USB device in response to the enumeration request of the standby USB host;
and sending the equipment attribute information to the standby USB host to drive the USB equipment by the standby USB host.
In a third aspect, an embodiment of the present application further provides a centralized KVM control system, including a plurality of hosts, a KVM signal switching device, a KVM seat end, and a USB device, where the plurality of hosts are connected to the KVM signal switching device, and the KVM signal switching device and the USB device are both connected to the KVM seat end;
the KVM seat end judges whether a host which drives the USB equipment currently is in an abnormal state or not, generates an enabling switching instruction when the host which drives the USB equipment currently is determined to be in the abnormal state, and transmits the enabling switching instruction to the KVM signal switching equipment;
the KVM signal switching device enables the plurality of hosts to be switched according to the enable switching instruction, so that the USB device is driven.
In a fourth aspect, an embodiment of the present application further provides a distributed KVM control system, where the distributed KVM control system includes a plurality of hosts, a KVM signal transmitting terminal corresponding to each host, a KVM signal receiving terminal, and a USB device, where the KVM signal transmitting terminal corresponding to each host is connected to the KVM signal receiving terminal, and the KVM signal receiving terminal is connected to the USB device;
the KVM signal receiving terminal judges whether a host currently driving the USB equipment is in an abnormal state or not, generates an enabling switching instruction when the host currently driving the USB equipment is determined to be in the abnormal state, and transmits the enabling switching instruction to the KVM signal transmitting terminal corresponding to each host;
and the KVM signal sending terminal corresponding to each host carries out enabling switching on the plurality of hosts according to the enabling switching instruction, so that the USB equipment is driven.
The embodiment of the application provides a control method and device of USB equipment and a KVM control system, wherein the method comprises the following steps: judging whether a target Universal Serial Bus (USB) host is in an abnormal state or not; if yes, generating an enabling switching instruction; and starting the standby USB host to drive the USB equipment according to the enabling switching instruction. According to the embodiment of the application, when the target USB host is determined to be in the abnormal state, the standby USB host can be started according to the generated enabling switching instruction, so that the standby USB host replaces the target USB host to drive the USB equipment, and man-machine interaction is further achieved.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a flowchart illustrating a control method of a USB device according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating another control method for a USB device according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating another control method for a USB device according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating another control method for a USB device according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating another control method for a USB device according to an embodiment of the present application;
FIG. 6 is a schematic diagram illustrating a centralized KVM control system according to the second embodiment of the present application;
FIG. 7 is a schematic structural diagram of a distributed KVM control system according to the third embodiment of the present application;
fig. 8 is a schematic structural diagram illustrating a control apparatus of a USB device according to a fourth embodiment of the present application;
fig. 9 shows a schematic structural diagram of an electronic device provided in embodiment five of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
At present, a data transmission link needs to be established between a USB device and a target USB host through a USB packet processing module, so that the target USB host can drive the USB device through the established data transmission link, and after the USB device is successfully driven, a richer control scheme can be executed by using the established data transmission link, for example, a pass-through function is executed on service data formed by the USB device in an interactive operation. However, once the target USB host is abnormal, the data transmission link between the USB device and the target USB host is interrupted, so that the USB device cannot be driven, thereby affecting human-computer interaction. In view of the above problems, the control method and device for the USB device and the KVM control system provided in the embodiments of the present application can ensure that the USB device is normally driven, and achieve human-computer interaction.
For the purpose of understanding the embodiments of the present application, a detailed description will be first provided for a control method of a USB device disclosed in the embodiments of the present application. Specifically, the first embodiment is described with the USB packet processing module as the execution main body.
Example one
As shown in fig. 1, a flowchart of a method for controlling a USB device with a USB packet processing module as an execution main body according to an embodiment of the present application is shown, which includes the following specific steps:
s101, judging whether the target universal serial bus USB host is in an abnormal state or not.
In a specific implementation, when a target Universal Serial Bus (USB) host normally drives a USB device, the USB packet processing module may transmit an operation instruction sent by a user through the USB device to the monitor terminal, so that the monitor terminal responds to the operation instruction.
Here, the USB packet processing module may determine the working state of the target USB host in real time, and when it is determined that the target USB host is in an abnormal state, the method provided in the embodiment of the present application is used to ensure that the USB can be normally driven, so as to implement human-computer interaction, and avoid the USB device being lost due to the abnormal state of the target USB host.
The specific method for determining whether the target USB host is abnormal may refer to the method steps in fig. 2 and fig. 3.
And S102, if the target USB host is in an abnormal state, generating an enabling switching instruction.
Here, the enable switch instruction may be generated when the USB packet processing module determines that the target USB host is in an abnormal state. Wherein the enable switch instruction may instruct the host other than the target USB host to form a data transmission link with the USB device.
And S103, starting the standby USB host to drive the USB equipment according to the enabling switching instruction.
In a specific implementation, the standby USB host may be a virtual USB host constructed by using the FPGA chip, or may be another USB host other than the target USB host.
The USB packet processing module transmits the enabling switching instruction to the standby USB host, and the standby USB host is started according to the received enabling switching instruction so as to achieve the purpose of replacing the target USB host to drive the USB equipment.
In a Keyboard Video Mouse (KVM) system, a virtual USB host and a plurality of physical USB hosts may be connected simultaneously, and before a standby USB host is started according to an enable switch instruction, priorities of the virtual USB host and the other USB hosts except for a target USB host may be obtained in advance, and a host with a highest priority among the virtual USB host and the other USB hosts except for the target USB host may be started according to the enable switch instruction. Priority levels are set in advance for the virtual USB host and other USB hosts except the target USB host, and the host with the highest priority level as a priority selection replaces the target USB host to drive the USB equipment.
Here, the priority levels of the virtual USB host and the other USB hosts except the target USB host may be set by the user according to the device attribute information of the virtual USB host and the other USB hosts except the target USB host, or may be set according to the usage requirement.
After the virtual USB host and the host with the highest priority in other USB hosts except the target USB host are started, if the host is judged to be in an abnormal state, the host with the second priority is started, and the like.
In specific implementation, the USB packet processing module may further transmit information that the target USB host is in an abnormal state to the monitoring terminal, and the monitoring terminal generates an enable switching instruction, transmits the enable switching instruction to the host selected by the user according to the selection of the user, and starts the host selected by the user.
Specifically, the method shown in fig. 2 may be used to start the standby USB host to drive the USB device according to the enable switching instruction, and the specific steps are as follows:
s201, receiving an enumeration request sent by the standby USB host according to the enabling switching instruction, and sending the enumeration request to the USB device.
In a specific implementation, when each host and the USB device initially establish a data communication link, the host enumerates the USB device before service data transmission.
In this embodiment of the present application, after the USB packet processing module sends the enable switching instruction to the standby USB host, and after it is determined that the standby USB host executes the initialization operation, an enumeration request sent by the standby USB host according to the enable switching instruction is received, and the enumeration request is sent to the USB device.
S202, receiving device attribute information returned by the USB device in response to the enumeration request of the standby USB host;
and S203, sending the device attribute information to the standby USB host so that the standby USB host drives the USB device.
In specific implementation, the USB device responds according to the received enumeration request, extracts request information in the enumeration request, and returns corresponding device attribute information to the USB packet processing module according to the request information in the enumeration request. For example, the request information in the enumeration request may include a request for the USB device to feed back the device type, the vendor, and the like.
And the USB packet processing module receives the device attribute information corresponding to the enumeration request returned by the USB device and returns the device attribute information to the standby USB host.
The device attribute information may include descriptors, device types, manufacturers, supported transmission types, and other related information.
Under the condition that the USB equipment is normally driven, the USB packet processing module can transmit the service data packet containing the operation instruction to the USB host or any standby USB host according to the actual interactive use condition of the USB equipment, so that the USB host responds to the operation instruction to execute corresponding operation and realize man-machine interaction.
Since the target USB host is in a different state when the enumeration request is sent to the USB device than after the enumeration of the USB device is completed, the target USB host may be determined when the enumeration request is sent to the USB device and after the enumeration of the USB device is completed. In the embodiment of the present application, whether the target USB host is in an abnormal state may be determined by the following two methods, and then the two methods are described separately.
The first method comprises the following steps:
as shown in fig. 3, a method for determining whether a target USB host is in an abnormal state when the target USB host executes an initialization operation includes the following specific steps:
s301, after the target USB host is determined to execute initialization operation, receiving an enumeration request sent by the target USB host, and transmitting the enumeration request to the USB device;
s302, receiving device attribute information returned by the USB device in response to the enumeration request, and returning the device attribute information to the target USB host;
s303, judging whether the number of the equipment attribute information is matched with a preset number or not;
s304, if the number of the device attribute information is not matched with the preset number, judging whether an enumeration request sent again by the target USB host is received within the preset time length;
s305, if the enumeration request sent again by the target USB host is not received within the preset time length, determining that the target USB host is in an abnormal state.
In a specific implementation, after determining that the target USB host performs the initialization operation, the USB packet processing module receives an enumeration request sent by the target USB host, and transmits the enumeration request to the USB device. And returning the device attribute information returned by the USB device in response to the enumeration request to the target USB host.
Here, the target USB host drives the device according to the device attribute information of the device, thereby implementing human-computer interaction. The USB packet processing module may preset a preset number of device attribute information corresponding to each USB device, and when the USB device returns the device attribute information to the USB packet processing module each time, the USB packet processing module may match the number of the received device attribute information with the preset number to determine whether the target USB host sends the enumeration request again.
And when the number of the device attribute information is determined not to be matched with the preset number, determining that the target USB host will send the enumeration request again. The USB packet processing module judges whether the enumeration request sent again by the target USB host is received within the preset time, and if the enumeration request sent again by the target USB host is not received within the preset time, the target USB host is determined to be in an abnormal state.
The target USB host may send the enumeration request to the USB device at least once, and the content of the enumeration request sent again may be the same as or different from the content of the enumeration request sent first.
And the second method comprises the following steps:
as shown in fig. 4, in order to determine whether the target USB host is in an abnormal state, the specific steps are as follows:
s401, judging whether a timing data packet sent by a target USB host is received at a preset time point;
s402, if the timing data packet sent by the target USB host is not received at the preset time point, determining that the target USB host is in an abnormal state.
In a specific implementation, in the process of executing the initialization operation and normally driving the USB device by the target USB host, the target USB host may send a timing data packet to the USB packet processing module according to a preset time point to represent that the target USB host is in a normal state.
The USB packet processing module judges whether a timing data packet sent by the target USB host is received at a preset time point in real time, and determines that the target USB host is in an abnormal state when the timing data packet sent by the target USB host is not received at the preset time point.
It should be noted that, in the process of executing the initialization operation by the target USB host, whether the target USB host is in the abnormal state may be determined according to the method shown in fig. 2, or whether the target USB host is in the abnormal state may be determined according to the method shown in fig. 3.
In a specific implementation, the factors causing the target USB host to be in the abnormal state include power failure of the target USB host, interruption of a connection line, and the like, and the user may help repair the abnormal state, for example, power up the target USB host so that the target USB host recovers the normal state.
After the target USB host recovers to the normal state, the target USB host may continue to normally drive the USB device according to the method shown in fig. 5, where the specific steps are as follows:
s501, receiving a reset signal sent by a target USB host;
s502, generating an enabling reset instruction according to the reset signal;
and S503, starting the target USB host according to the enabling reset instruction so as to drive the USB device through the target USB host.
In the embodiment of the application, after the target USB host recovers to a normal state, a reset signal may be generated and sent to the USB packet processing module, and the USB packet processing module generates an enable reset instruction according to the received reset signal and transmits the enable reset instruction to the target USB host.
After receiving the enable reset instruction, the target USB host sends an enumeration request to the USB device through the USB packet processing module, and then drives the USB device, and further interrupts the drive of the standby USB host to the USB host device.
It is worth mentioning that, after the target USB host recovers to the normal state, if the working state of the USB device is in the low-speed mode or the full-speed mode, the target USB host may directly send an enumeration request to the USB device through the USB packet processing module; if the working state of the USB device is in the high-speed mode, the USB bus, the device side, and the like need to be detected, and the USB bus is switched to the high-speed mode, and then the enumeration request may be sent to the USB device through the USB packet processing module.
According to the method, the enabling switching instruction is generated after the target USB host is determined to be in the abnormal state, the standby USB host is started, and therefore the standby USB host drives the USB equipment, the problem that in the prior art, when the target USB host is abnormal, a data transmission link between the USB equipment and the USB host is interrupted, the USB equipment cannot be driven, and therefore human-computer interaction is affected is solved.
Example two
A second embodiment of the present application provides a centralized KVM control system, referring to fig. 6, the centralized KVM control system includes a plurality of hosts, a KVM signal switching device, a KVM agent terminal, and a USB device, wherein the plurality of hosts are connected to the KVM signal switching device, and the KVM signal switching device and the USB device are both connected to the KVM agent terminal;
the KVM seat end judges whether a host currently driving the USB equipment is in an abnormal state or not, generates an enabling switching instruction when the host currently driving the USB equipment is determined to be in the abnormal state, and transmits the enabling switching instruction to the KVM signal switching equipment;
the KVM signal switching device enables the plurality of hosts to be switched according to the enable switching instruction, so that the USB device is driven.
As shown in fig. 6, the centralized KVM system includes other USB hosts 1, 2 and 3 in addition to the target USB host and the virtual USB host. The target USB host, the virtual USB host, the other USB hosts 1, the other USB hosts 2 and the other USB hosts 3 are connected with the KVM signal switching equipment at the same time, so that the purposes of receiving the operation instruction of a user and transmitting the video signal to the display are achieved. In practical applications, the number of other USB hosts may be set in the centralized KVM system according to actual requirements, which is not specifically limited in this embodiment of the present application.
The KVM seat end, namely the USB packet processing module, can transmit an enumeration request sent by the target USB host to the USB mouse and the USB storage device (both the USB mouse and the USB storage device are one of the USB devices) through the hub, and return device attribute information returned after the USB mouse and the USB storage device respond to the enumeration request to the target USB host, thereby driving the USB mouse and the USB storage device.
In a specific implementation, after the target USB host normally drives the USB mouse and the USB storage device, the listening terminal may receive an operation instruction sent by the user through the USB mouse, for example, displaying a video signal on a display, and respond to the operation instruction.
The KVM seat end can judge whether the target USB host is in an abnormal state or not in real time, and when the target USB host is determined to be in the abnormal state, the host with the highest priority level is started according to the priority levels of the virtual USB host, the other USB hosts 1, the other USB hosts 2 and the other USB hosts 3, so that the USB mouse and the USB storage device can be normally driven, and the monitoring terminal can receive an operation instruction sent by a user through the USB mouse, and the purpose of man-machine interaction is achieved.
EXAMPLE III
A third embodiment of the present application provides a distributed KVM control system, referring to fig. 7, where the distributed KVM control system includes a plurality of hosts, a KVM signal transmitting terminal, a KVM signal receiving terminal, and a USB device, where the KVM signal transmitting terminal corresponding to each host is connected to the KVM signal receiving terminal, and the KVM signal receiving terminal is connected to the USB device;
the KVM signal receiving terminal judges whether the host currently driving the USB equipment is in an abnormal state or not, generates an enabling switching instruction when the host currently driving the USB equipment is determined to be in the abnormal state, and transmits the enabling switching instruction to the KVM signal transmitting terminal corresponding to each host;
the KVM signal sending terminal corresponding to each host carries out enabling switching on the plurality of hosts according to the enabling switching instruction, so that the USB equipment is driven.
In a specific implementation, in the distributed KVM control system, since the host end and the KVM seat end are usually distributed in different places based on a network environment, two USB packet processing modules need to be arranged on a data transmission link between each host and the USB device to implement conversion between data and optical/network data so as to meet the requirements of a corresponding transmission protocol.
As can be seen from fig. 7, the distributed KVM control system specifically includes a target USB host, a virtual USB host, other USB hosts 1, and other USB hosts 2, where the target USB host corresponds to a KVM signal transmitting terminal 1, the other USB hosts 1 correspond to KVM signal transmitting terminals 2, the other USB hosts 2 correspond to KVM signal transmitting terminals 3, and the KVM signal transmitting terminals 1, 2, and 3 are all in communication connection with a KVM signal receiving terminal through a network bus. The KVM signal receiving terminal is connected with the monitoring terminal and the USB equipment. In practical applications, the number of other USB hosts may be set in the distributed KVM control system according to actual requirements, which is not specifically limited in this embodiment of the present application.
Here, the KVM signal receiving terminal, that is, the USB packet processing module, may transmit an enumeration request sent by the target USB host to the USB device through the USB bus, and return device attribute information returned by the USB device after responding to the enumeration request to the target USB host, thereby driving the USB device.
The KVM signal receiving terminal can judge whether the target USB host is in an abnormal state in real time, and when the target USB host is determined to be in the abnormal state, the host with the highest priority level is started according to the priority levels of the virtual USB host, the other USB hosts 1 and the other USB hosts 2, so that the USB equipment can be normally driven, and the monitoring terminal can receive an operation instruction sent by a user through the USB equipment, and the purpose of man-machine interaction is achieved.
Example four
Based on the same inventive concept, the third embodiment of the present application further provides a control apparatus for a USB device corresponding to the control method for a USB device, and since the principle of the apparatus in the third embodiment of the present application for solving the problem is similar to the control method for the USB device described above in the embodiments of the present application, the implementation of the apparatus may refer to the implementation of the method, and repeated details are omitted.
As shown in fig. 8, a control apparatus for a USB device according to an embodiment of the present application includes:
a judging module 801, configured to judge whether a target USB host is in an abnormal state;
a generating module 802, configured to generate an enable switching instruction if the target USB host is in an abnormal state;
and the control module 803 is configured to start the standby USB host to drive the USB device according to the enable switching instruction.
In an embodiment, the control module 803 is specifically configured to:
after the standby USB host is started according to the enabling switching instruction, receiving an enumeration request sent by the standby USB host according to the enabling switching instruction, and sending the enumeration request to the USB equipment;
receiving device attribute information returned by the USB device in response to the enumeration request of the standby USB host;
and sending the equipment attribute information to the standby USB host to drive the USB equipment by the standby USB host.
In another embodiment, the determining module 801 is specifically configured to:
after the target USB host is determined to execute initialization operation, receiving an enumeration request sent by the target USB host, and transmitting the enumeration request to the USB equipment;
receiving device attribute information returned by the USB device in response to the enumeration request, and returning the device attribute information to the target USB host;
judging whether the number of the equipment attribute information is matched with the preset number or not;
if not, judging whether an enumeration request sent again by the target USB host is received within a preset time length;
if not, determining that the target USB host is in an abnormal state.
In another embodiment, the determining module 801 is specifically configured to:
judging whether a timing data packet sent by a target USB host is received at a preset time point or not;
if not, determining that the target USB host is in an abnormal state.
In another embodiment, the control module 803 is further configured to:
acquiring the priority of the virtual USB host and other USB hosts except the target USB host;
and starting the virtual USB host and other USB hosts except the target USB host according to the enabling switching instruction, wherein the hosts with the highest priority level drive the USB equipment.
In another embodiment, the control apparatus for a USB device further includes:
a reset module 804, configured to receive a reset signal sent by the target USB host;
generating an enabling reset instruction according to the reset signal;
and starting the target USB host according to the enabling reset instruction so as to drive the USB equipment through the target USB host.
EXAMPLE five
As shown in fig. 9, a schematic structural diagram of an electronic device provided in an embodiment of the present application includes: a processor 901, a memory 902, and a bus 903, the memory 902 storing executable instructions, the processor 901 and the memory 902 communicating via the bus 903 when the electronic device is operating, the machine readable instructions when executed by the processor 901 performing the following:
judging whether a target Universal Serial Bus (USB) host is in an abnormal state or not;
if yes, generating an enabling switching instruction;
and starting the standby USB host to drive the USB equipment according to the enabling switching instruction.
Optionally, the method executed by the processor 901, after the starting of the standby USB host to drive the USB device according to the enable switching instruction, further includes:
receiving an enumeration request sent by a standby USB host according to an enabling switching instruction, and sending the enumeration request to the USB equipment;
receiving device attribute information returned by the USB device in response to the enumeration request of the standby USB host;
and sending the device attribute information to the standby USB host.
Optionally, in a method executed by the processor 901, determining whether the target USB host is in an abnormal state includes:
after the target USB host is determined to execute initialization operation, receiving an enumeration request sent by the target USB host, and transmitting the enumeration request to the USB equipment;
receiving device attribute information returned by the USB device in response to the enumeration request, and returning the device attribute information to the target USB host;
judging whether the number of the equipment attribute information is matched with the preset number or not;
if not, judging whether an enumeration request sent again by the target USB host is received within a preset time length;
if not, determining that the target USB host is in an abnormal state.
Optionally, in a method executed by the processor 901, determining whether the target USB host is in an abnormal state includes:
judging whether a timing data packet sent by a target USB host is received at a preset time point or not;
if not, determining that the target USB host is in an abnormal state.
Optionally, the processor 901 executes a method in which the standby USB host includes a virtual USB host and other USB hosts except the target USB host; before starting the standby USB host to drive the USB device according to the enable switching instruction, the method further includes:
acquiring the priority of the virtual USB host and other USB hosts except the target USB host;
the starting of the standby USB host according to the enabling switching instruction to drive the USB equipment comprises the following steps:
and starting the virtual USB host and other USB hosts except the target USB host according to the enabling switching instruction, wherein the hosts with the highest priority level drive the USB equipment.
Optionally, the method executed by the processor 901 further includes:
receiving a reset signal sent by a target USB host;
generating an enable reset instruction according to the reset signal;
and starting the target USB host according to the enabling reset instruction so as to drive the USB equipment through the target USB host.
The method and the apparatus for controlling a USB device and the computer program product of the KVM control system provided in the embodiments of the present application include a computer-readable storage medium storing program codes, where instructions included in the program codes may be used to execute the method in the foregoing method embodiments, and specific implementation may refer to the method embodiments, and will not be described herein again.
Specifically, the storage medium can be a general-purpose storage medium, such as a removable disk, a hard disk, and the like, and when a computer program on the storage medium is executed, the control method of the USB device can be executed, so that when it is determined that the target USB host is in an abnormal state, the standby USB host can be started according to the generated enable switching instruction, so that the standby USB host drives the USB device instead of the target USB host, and further human-computer interaction is achieved.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. A control method of a USB device, comprising:
judging whether a target Universal Serial Bus (USB) host is in an abnormal state or not;
if yes, generating an enabling switching instruction;
starting a standby USB host to drive the USB equipment according to the enabling switching instruction;
the standby USB host comprises a virtual USB host and other USB hosts except the target universal serial USB host; before starting the standby USB host to drive the USB device according to the enable switching instruction, the method further includes:
acquiring the priority of the virtual USB host and other USB hosts except the target universal serial USB host;
the starting of the standby USB host according to the enabling switching instruction to drive the USB equipment comprises the following steps:
and starting the virtual USB host and other USB hosts except the target USB host with the highest priority to drive the USB equipment according to the enabling switching instruction.
2. The method of claim 1, wherein the initiating the standby USB host to drive the USB device according to the enable switch command comprises:
receiving an enumeration request sent by the standby USB host according to the enabling switching instruction, and sending the enumeration request to the USB equipment;
receiving device attribute information returned by the USB device in response to the enumeration request of the standby USB host;
and sending the equipment attribute information to the standby USB host to drive the USB equipment by the standby USB host.
3. The method of claim 1, wherein determining whether the target USB host is in an abnormal state comprises:
after determining that the target universal serial USB host executes initialization operation, receiving an enumeration request sent by the target universal serial USB host, and transmitting the enumeration request to the USB device;
receiving device attribute information returned by the USB device in response to the enumeration request, and returning the device attribute information to the target universal serial USB host;
judging whether the number of the equipment attribute information is matched with a preset number or not;
if not, judging whether an enumeration request sent again by the target universal serial USB host is received within a preset time length;
if not, determining that the target universal serial USB host is in an abnormal state.
4. The method of claim 1, wherein determining whether the target USB host is in an abnormal state comprises:
judging whether a timing data packet sent by the target universal serial USB host is received at a preset time point or not;
if not, determining that the target universal serial USB host is in an abnormal state.
5. The method of claim 1, further comprising:
receiving a reset signal sent by the target universal serial USB host;
generating an enabling reset instruction according to the reset signal;
and starting the target universal serial USB host according to the enabling reset instruction so as to drive the USB equipment through the target universal serial USB host.
6. A control apparatus for a USB device, comprising:
the judging module is used for judging whether the target universal serial bus USB host is in an abnormal state or not;
the generation module is used for generating an enabling switching instruction if the target universal serial USB host is in an abnormal state;
the control module is used for starting the standby USB host to drive the USB equipment according to the enabling switching instruction;
the control module is further configured to:
acquiring the priority of a virtual USB host and other USB hosts except the target universal serial USB host;
starting the virtual USB host and other USB hosts except the target USB host according to the enabling switching instruction, wherein the hosts with the highest priority level drive the USB equipment;
the spare USB host includes: a virtual USB host and other USB hosts other than the target USB host.
7. The apparatus of claim 6, wherein the control module is specifically configured to:
receiving an enumeration request sent by the standby USB host according to the enabling switching instruction, and sending the enumeration request to the USB equipment;
receiving device attribute information returned by the USB device in response to the enumeration request of the standby USB host;
and sending the equipment attribute information to the standby USB host to drive the USB equipment by the standby USB host.
8. A centralized KVM control system is characterized by comprising a plurality of hosts, a KVM signal switching device, a KVM seat end and a USB device, wherein the hosts are connected with the KVM signal switching device, and the KVM signal switching device and the USB device are connected with the KVM seat end;
the KVM seat end judges whether a target universal serial USB host which drives the USB equipment currently is in an abnormal state or not, generates an enabling switching instruction when determining that the target universal serial USB host which drives the USB equipment currently is in the abnormal state, and transmits the enabling switching instruction to the KVM signal switching equipment;
the KVM signal switching device enables the plurality of hosts to be switched according to the enabling switching instruction, so that the USB device is driven;
the centralized KVM system comprises other USB hosts besides a target universal serial USB host and a virtual USB host;
the centralized KVM system is further configured to:
acquiring the priority of the virtual USB host and other USB hosts except the target universal serial USB host;
and starting the virtual USB host and other USB hosts except the target USB host with the highest priority to drive the USB equipment according to the enabling switching instruction.
9. A distributed KVM control system is characterized by comprising a plurality of hosts, a KVM signal transmitting terminal corresponding to each host, a KVM signal receiving terminal and a USB device, wherein the KVM signal transmitting terminal corresponding to each host is connected with the KVM signal receiving terminal, and the KVM signal receiving terminal is connected with the USB device;
the KVM signal receiving terminal judges whether a host currently driving the USB equipment is in an abnormal state or not, generates an enabling switching instruction when the host currently driving the USB equipment is determined to be in the abnormal state, and transmits the enabling switching instruction to the KVM signal transmitting terminal corresponding to each host;
the KVM signal sending terminal corresponding to each host carries out enabling switching on the plurality of hosts according to the enabling switching instruction, so that the USB equipment is driven;
the distributed KVM system comprises other USB hosts besides a target universal serial USB host and a virtual USB host;
the distributed KVM system is further configured to:
acquiring the priority of the virtual USB host and other USB hosts except the target universal serial USB host;
and starting the virtual USB host and other USB hosts except the target USB host with the highest priority to drive the USB equipment according to the enabling switching instruction.
CN201910190151.0A 2019-03-13 2019-03-13 Control method and device of USB equipment and KVM control system Active CN109918320B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910190151.0A CN109918320B (en) 2019-03-13 2019-03-13 Control method and device of USB equipment and KVM control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910190151.0A CN109918320B (en) 2019-03-13 2019-03-13 Control method and device of USB equipment and KVM control system

Publications (2)

Publication Number Publication Date
CN109918320A CN109918320A (en) 2019-06-21
CN109918320B true CN109918320B (en) 2021-05-11

Family

ID=66964668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910190151.0A Active CN109918320B (en) 2019-03-13 2019-03-13 Control method and device of USB equipment and KVM control system

Country Status (1)

Country Link
CN (1) CN109918320B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111782442B (en) * 2020-06-23 2024-01-12 深圳威尔视觉传媒有限公司 Device exception handling method, system, electronic device and storage medium
CN112596859A (en) * 2020-12-25 2021-04-02 创新科技术有限公司 USB transparent transmission method and device
CN112783701A (en) * 2020-12-30 2021-05-11 威创集团股份有限公司 USB function test method, device and equipment of KVM system
CN113660450A (en) * 2021-07-27 2021-11-16 深圳市拔超科技有限公司 Method and device for automatically switching video conference peripherals among multiple hosts
CN113835946B (en) * 2021-10-26 2023-12-12 北京淳中科技股份有限公司 Pressure test method for data exchange

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930411A (en) * 2009-06-24 2010-12-29 佳能株式会社 Messaging device and control method thereof
CN101989248A (en) * 2009-07-31 2011-03-23 比亚迪股份有限公司 Universal serial bus (USB) equipment and method for restarting USB equipment
CN102339259A (en) * 2010-07-27 2012-02-01 董建飞 Device and method for operating USB (universal serial bus) interface equipment
CN102594605A (en) * 2012-03-05 2012-07-18 深圳市迈昂科技有限公司 Dual-host port universal serial bus (USB) hub and working method thereof
CN106843527A (en) * 2017-01-20 2017-06-13 广州魅视电子科技有限公司 Distributed KVM attends a banquet cooperation management system
CN108521467A (en) * 2018-04-24 2018-09-11 上海晨驭信息科技有限公司 Collection fraction KVM remotely attends a banquet cooperative system
CN109213530A (en) * 2018-08-13 2019-01-15 百富计算机技术(深圳)有限公司 A kind of communication connecting method based on USB, mobile terminal and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106850715A (en) * 2015-12-04 2017-06-13 大唐移动通信设备有限公司 A kind of primary main frame dynamic selection method of Intrusion Detection based on host state and priority
CN106656299A (en) * 2016-12-12 2017-05-10 上海拆名晃信息科技有限公司 Method and device for data transmission between virtual reality device and computer mainframe
US10474606B2 (en) * 2017-02-17 2019-11-12 Hewlett Packard Enterprise Development Lp Management controller including virtual USB host controller

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930411A (en) * 2009-06-24 2010-12-29 佳能株式会社 Messaging device and control method thereof
CN101989248A (en) * 2009-07-31 2011-03-23 比亚迪股份有限公司 Universal serial bus (USB) equipment and method for restarting USB equipment
CN102339259A (en) * 2010-07-27 2012-02-01 董建飞 Device and method for operating USB (universal serial bus) interface equipment
CN102594605A (en) * 2012-03-05 2012-07-18 深圳市迈昂科技有限公司 Dual-host port universal serial bus (USB) hub and working method thereof
CN106843527A (en) * 2017-01-20 2017-06-13 广州魅视电子科技有限公司 Distributed KVM attends a banquet cooperation management system
CN108521467A (en) * 2018-04-24 2018-09-11 上海晨驭信息科技有限公司 Collection fraction KVM remotely attends a banquet cooperative system
CN109213530A (en) * 2018-08-13 2019-01-15 百富计算机技术(深圳)有限公司 A kind of communication connecting method based on USB, mobile terminal and storage medium

Also Published As

Publication number Publication date
CN109918320A (en) 2019-06-21

Similar Documents

Publication Publication Date Title
CN109918320B (en) Control method and device of USB equipment and KVM control system
CN107479721B (en) Storage device, system and method for remote multicomputer switching technology
EP3223152A1 (en) Method and server for presenting initialization degree of hardware in server
US20200310933A1 (en) Device fault processing method, apparatus, and system
CN101909366B (en) Wireless local area network WLAN device and WLAN adapter thereof
CN109388604B (en) Hot plug control method, device and storage medium based on PCIe
KR20060048103A (en) Electronic device, method for controlling the same, information processing apparatus, and computer program
EP2372491B1 (en) Power lock-up setting method and electronic apparatus using the same
US10042800B2 (en) Active USB device and switching method for operating mode thereof
CN102388371A (en) Detection method, apparatus and system for mainboard device
JP6024288B2 (en) Information processing system and external device
EP4220377A1 (en) Cloud desktop display method and system
US20180210783A1 (en) Information processing apparatus, control method of the same, and storage medium
EP3203379A1 (en) Hot swappable device and method
WO2021093734A1 (en) Usb communication implementing method and apparatus
CN103561089A (en) Virtual machine desktop log-in method, device and system
US20130217434A1 (en) Method and system for transmitting data and electronic apparatus using the method
JP2007334731A (en) Usb equipment, host device and usb connection system
CN105516429B (en) terminal offline processing method and system
WO2017049973A1 (en) Data transmission control method, host device, usb device and system
JP2013045354A (en) Printer device, communication system, and communication method
CN104065845B (en) Information processing unit and information processing method
CN115576730A (en) Storage server PCIE card fault repairing method, system and computer equipment
JP6586832B2 (en) Information processing device
CN112463446B (en) PCIe device recovery method and system, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant