Patent ID: 8700820

Claim:
A method for accessing, by a plurality of terminals, a Universal Serial Bus (USB) device attached to a home gateway, comprising: receiving by the home gateway a USB message of the USB device attached to the home gateway, wherein the USB message comprises a first USB data frame, and receiving a real plug-in event message of the USB device or a real removal event message of the USB device; and generating, by the home gateway, a virtual plug-in event message of the USB device according to a generated virtual plug-in event of the USB device, or generating, by the home gateway, a virtual removal event message of the USB device according to a generated virtual removal event of the USB device, while the USB device remains connected to the home gateway, thereby when one of the plurality of terminals is to disconnect from the USB device, an influence on sharing of the USB device by other connected terminals is avoided, wherein the generated virtual plug-in event message or the generated virtual removal event message are adapted to a first network packet for transmission to a terminal, and wherein the method further comprises one or more operations of: adapting the USB message to a second network packet and sending the second network packet to a virtual USB device interface for the terminal to be read by an application program of the terminal, or parsing a third network packet sent by a terminal through a virtual USB device interface for the terminal into a second USB data frame and writing the second USB data frame into the USB device.