WO2015176366A1 - Universal serial bus drive method, computer and composite device - Google Patents

Universal serial bus drive method, computer and composite device Download PDF

Info

Publication number
WO2015176366A1
WO2015176366A1 PCT/CN2014/082091 CN2014082091W WO2015176366A1 WO 2015176366 A1 WO2015176366 A1 WO 2015176366A1 CN 2014082091 W CN2014082091 W CN 2014082091W WO 2015176366 A1 WO2015176366 A1 WO 2015176366A1
Authority
WO
WIPO (PCT)
Prior art keywords
computer
composite device
descriptor
single interface
interface
Prior art date
Application number
PCT/CN2014/082091
Other languages
French (fr)
Chinese (zh)
Inventor
许金友
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2015176366A1 publication Critical patent/WO2015176366A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method, a computer, and a composite device for driving a universal serial bus.
  • a multi-interface universal serial bus (USB) device ie, a composite device
  • USB universal serial bus
  • a composite device is inserted into a computer (computer), and the computer obtains a descriptor of the composite device, and The descriptor is parsed, and the computer composite device driver loads the driver corresponding to each interface according to each interface of the composite device.
  • the composite device is driven in the kernel layer of the computer, and in the enumeration process of the composite device, it takes a lot of work.
  • the present invention provides a universal serial bus driving method, a computer, and a composite device, to at least solve the problem in the related art that a computer recognizes a composite device as a single interface device, and thus does not enable a composite device driver of the computer core to composite The problem with the device enumerating.
  • the universal serial bus driving method provided by the present invention is applied to a computer, and includes the following steps: after the computer establishes a connection with the composite device, the computer sends a descriptor command to the composite device; and the computer receives the composite device to send the The preset single interface descriptor; the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads a preset custom driver.
  • the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and after loading the preset custom driving step, the method includes: the computer acquiring the multi-interface descriptor from the composite device; The multi-interface descriptor constructs a plurality of functional interfaces.
  • the step of the computer parsing the obtained multi-interface descriptor to construct a plurality of functional interfaces comprises: the computer constructing a plurality of the functional interfaces by using the multi-interface descriptor obtained by the application layer parsing; The layer generates a plurality of sub-devices or a plurality of operation handles according to the plurality of the functional interfaces constructed.
  • the universal serial bus driving method further provided by the present invention is applied to a composite device, comprising the steps of: receiving, by a composite device, a acquiring descriptor command sent by a computer to a composite device; and the composite device responding to the acquiring descriptor command, and The single interface descriptor is sent to the computer, and the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads a preset custom driver.
  • the composite device responds to the acquiring descriptor command, and sends a preset single interface descriptor to a computer, and the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads
  • the step of the preset custom driver further includes: the composite device receiving a custom acquisition command sent by the computer; the composite device transmitting the multi-interface descriptor to the computer in response to the received custom acquisition command, for parsing by the computer Multiple interface descriptors and build multiple functional interfaces.
  • the computer further provided by the present invention, comprising: a command module, configured to send a get descriptor command to the composite device after establishing a connection with the composite device a descriptor module, configured to receive a preset single interface descriptor sent by the composite device; the driving module is configured to identify the composite device as a single interface device according to the obtained single interface descriptor, and load the preset self Define the driver.
  • the computer further includes: an obtaining module, configured to acquire a multi-interface descriptor from the composite device; a building module, configured to parse the obtained multi-interface descriptor, and construct a plurality of functional interfaces.
  • the building module includes: a building unit, configured to parse the multi-interface descriptor obtained by the application layer to construct a plurality of the function interfaces; and generating a unit, configured to be configured by the application layer according to the plurality of A functional interface that generates multiple child devices or multiple action handles.
  • the composite device further provided by the present invention, comprising: a first receiving module, configured to receive an acquisition descriptor command sent by a computer to a composite device; a first sending module, configured to respond to the acquiring descriptor command, and to preset a single The interface descriptor is sent to the computer, and the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads a preset custom driver.
  • the composite device further includes: a second receiving module, configured to receive a custom acquisition command sent by the computer; and a second sending module, configured to send the multi-interface descriptor in response to the received custom acquisition command
  • the computer parses the multi-interface descriptor and constructs multiple functional interfaces.
  • the computer After the computer establishes a connection with the composite device, the computer sends a get descriptor command to the composite device; the computer receives the preset single interface descriptor sent by the composite device; and the computer determines, according to the obtained single interface descriptor, the composite device Single interface device, and load preset custom drivers.
  • the computer of the present invention acquires complex After the single interface descriptor sent by the device, the composite device is identified as a single interface device, so the composite device driver is not enabled during the enumeration of the composite device, which simplifies the process of enumerating the composite device by the computer, and improves the enumeration process. The efficiency of the exercise.
  • FIG. 1 is a schematic flow chart of a first embodiment of a driving method of a universal serial bus according to the present invention
  • FIG. 2 is a schematic flowchart of a driving method of a universal serial bus according to a second embodiment of the present invention
  • FIG. 4 is a schematic diagram of functional modules of a first embodiment of a computer according to the present invention
  • FIG. 5 is a schematic diagram of functional modules of a second embodiment of a computer according to the present invention
  • FIG. 7 is a schematic diagram of functional modules of a first embodiment of a composite device according to the present invention
  • FIG. 8 is a schematic diagram of functional blocks of a preferred embodiment of a composite device according to the present invention.
  • FIG. 1 is a schematic flow chart of a first embodiment of a driving method of a universal serial bus according to the present invention.
  • the method comprises the following steps: Step S10, after the computer establishes a connection with the composite device, the computer sends a get descriptor command to the composite device; step S20, the computer receives the preset single interface descriptor sent by the composite device; step S30, the computer obtains the single interface according to the single interface
  • the descriptor determines that the composite device is a single interface device and loads the preset custom driver.
  • Single interface descriptors are pre-set and saved in the composite device.
  • the single interface descriptor does not reflect the real device information of the composite device.
  • the content of the single interface descriptor reflects the information of a single interface device, which is equivalent to a virtual descriptor.
  • Custom drivers are pre-configured based on a single interface descriptor and installed into the kernel layer of the computer.
  • the computer begins enumerating the composite device, that is, obtaining some information of the composite device, and according to the information, loading the appropriate device for the composite device. For example, the computer sends a get descriptor command to the composite device.
  • the composite device After receiving the get descriptor command sent by the computer, the composite device does not send the composite composite real descriptor to the computer, but sends the preset single interface descriptor. To the computer. The computer parses the obtained single interface descriptor.
  • the computer determines that the composite device is a single interface device and does not recognize the real information of the composite device. Since the computer determines that the composite device is a single interface device, the enumeration process does not require the use of a composite device driver, and can directly find a custom driver according to the single interface descriptor, and load a preset custom driver, such as loading with a bus driver. Define the driver.
  • the computer After the computer establishes a connection with the composite device, the computer sends a get descriptor command to the composite device; the computer receives the preset single interface descriptor sent by the composite device; and the computer determines the composite device according to the obtained single interface descriptor.
  • the computer in the embodiment determines that the composite device is a single interface device, so the composite device driver is not enabled in the process of enumerating the composite device, which simplifies enumeration of the composite device by the computer. The process improves the efficiency of the enumeration.
  • the computer of the present invention does not enable the enumeration of the composite device, and can reduce the error rate when developing and maintaining the device driver of the composite device, thereby solving the problems of high cost and low efficiency of the development and production of the composite device.
  • the computer determines the speed type of the composite device; the computer resets the composite device; and establishes an information channel of the computer and the composite device; The computer gets the maximum packet length for the default pipe.
  • the single interface descriptor includes a single interface device descriptor and a single interface configuration descriptor
  • the single interface configuration descriptor includes an interface descriptor of a preset one interface.
  • the computer can obtain information such as the manufacturer identification number, the product serial number, the device class number, the maximum packet length of the default endpoint, and the number of configuration descriptors.
  • the computer obtains the information such as the length of the configuration descriptor, the power supply mode, and the maximum power consumption by obtaining the single interface configuration descriptor.
  • the single interface configuration descriptor includes an interface descriptor of the interface, and the computer can obtain specific information of an interface.
  • the computer determines that the composite device is a single interface device according to the single interface descriptor.
  • the present invention does not limit the single interface descriptor to include a string descriptor, an endpoint descriptor, and the like.
  • the form of the single interface descriptor of the present invention is a USB standard descriptor, thus facilitating the computer to determine and read the single interface descriptor.
  • FIG. 2 is a schematic flowchart diagram of a second embodiment of a driving method of a universal serial bus according to the present invention.
  • the difference between this embodiment and the first embodiment is that, according to the first embodiment, the computer is described according to the obtained single interface.
  • the method includes: Step S40: The computer acquires the multi-interface descriptor from the composite device; Step S50, the computer parses the obtained multi-interface descriptor, constructs Multiple functional interfaces.
  • the computer obtains the multi-interface descriptor from the composite device, for example, the computer sends the acquisition instruction to the composite device, and the composite device sends the multi-interface descriptor to the computer in response to the acquisition instruction; or the computer can acquire the multi-interface from the composite device through some applications. Descriptor; or, other suitable ways to obtain a multi-interface descriptor.
  • the descriptor is parsed, and the computer can obtain the real device information of the composite device by parsing, for example, the device class number, the maximum packet length of the default endpoint, the interface information, and the port. Information, etc.
  • the computer generates a plurality of functional interfaces, such as a modem (Modem) interface, an control (AT) interface, and a USB flash drive interface, according to the real device information of the composite device obtained by the parsing, and generates a plurality of logical channel supply programs and a composite device. Interaction.
  • a modem Modem
  • AT control
  • USB flash drive interface USB flash drive interface
  • the step of the computer acquiring the multi-interface descriptor from the composite device comprises: the computer sending a custom acquisition command to the application layer of the composite device through the application layer; and the computer receiving the application layer of the composite device through the application layer A multi-interface descriptor sent in response to the custom get command.
  • the computer includes an application layer and a kernel layer
  • the composite device includes an application layer and a kernel layer.
  • the user-side technician can set the custom acquisition command, and set the corresponding protocol according to the custom acquisition command in the application layer of the computer and the application layer of the composite device, and the computer sends a custom acquisition command to the composite device through the application layer.
  • the composite device can immediately recognize and respond to the custom acquisition command through the application layer.
  • This embodiment preferably customizes the command to obtain the USB standard format under the USB protocol.
  • the step of the computer acquiring the multi-interface descriptor from the composite device is performed in the application layer of the computer. Since the kernel layer of the computer is not involved, the user-side technician can more conveniently and quickly debug the custom acquisition command and the multi-interface descriptor. Or set, and the cost is lower.
  • the step of the computer parsing the obtained multi-interface descriptor to generate a plurality of functional interfaces includes: the computer parsing the obtained multi-interface descriptor through an application layer, and constructing the plurality of Functional interface; the computer generates a plurality of sub-devices or multiple operation handles according to a plurality of the functional interfaces constructed by the application layer.
  • the computer parses the obtained multi-interface descriptors by the application layer, constructs a plurality of the functional interfaces, and generates a plurality of sub-devices according to the plurality of the functional interfaces that are constructed, and the application program opens the sub-devices and the composite device.
  • Data interaction is performed; or, multiple file operation handles are generated, and the application program directly calls the file operation handle to perform data interaction with the composite device.
  • multiple sub-devices or multiple operation handles are generated, which facilitates data interaction between the application and the composite device through the sub-device or multiple operation handles.
  • complex operations such as generating multiple functional interfaces are performed at the application layer of the computer, and the kernel layer of the computer is not required to be executed. Therefore, the driving of the composite device is more controllable, and the debugging is more convenient, and the cost is lower.
  • FIG. 3 is a schematic flowchart diagram of an embodiment of a driving method of a universal serial bus according to the present invention.
  • the method includes the following steps: Step S01, the composite device receives an acquisition descriptor command sent by the computer to the composite device; Step S02, the composite device responds to the acquisition descriptor command And sending a preset single interface descriptor to the computer, and the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads the preset custom driver.
  • Single interface descriptors are pre-set and saved in the composite device.
  • the single interface descriptor does not reflect the real device information of the composite device.
  • the content of the single interface descriptor reflects the information of a single interface device, which is equivalent to a virtual descriptor.
  • Custom drivers are pre-configured based on a single interface descriptor and installed into the kernel layer of the computer. After the computer and the composite device establish a connection, the computer begins enumerating the composite device, that is, obtaining some information of the composite device, and according to the information, loading the appropriate device for the composite device. The computer sends a Get Descriptor command to the composite device.
  • the composite device responds to the acquiring descriptor command, and sends a preset single interface descriptor to the computer, and the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads the preset customization. drive. For example, the computer sends a get descriptor command to the composite device. After receiving the get descriptor command sent by the computer, the composite device does not send the composite composite real descriptor to the computer, but sends the preset single interface descriptor. To the computer. The computer parses the obtained single interface descriptor. Since the single interface descriptor contains only information about a single interface device, the computer determines that the composite device is a single interface device and does not recognize the real information of the composite device.
  • the enumeration process does not require the use of a composite device driver, and can directly find a custom driver according to the single interface descriptor, and load a preset custom driver, such as loading with a bus driver. Define the driver.
  • the composite device receives the acquisition descriptor command sent by the computer to the composite device; the composite device responds to the acquisition descriptor command, and sends the preset single interface descriptor to the computer for the computer to describe according to the obtained single interface. , determines that the composite device is a single interface device, and loads the preset custom driver.
  • the composite device sends a single interface descriptor to the computer, and the computer determines that the composite device is a single interface device according to the single interface descriptor, so the computer does not enable the composite device driver during the enumeration process of the composite device, simplifying the computer to composite
  • the process of enumerating devices increases the efficiency of enumerations.
  • the computer of the present invention does not enable the enumeration of the composite device, and can reduce the error rate when developing and maintaining the device driver of the composite device, thereby solving the problems of high cost and low efficiency of the development and production of the composite device.
  • the composite device responds to the acquiring descriptor command, and sends a preset single interface descriptor to a computer, where the computer determines, according to the obtained single interface descriptor, that the composite device is a single
  • the method further includes: the composite device receiving a custom acquisition command sent by the computer; and the composite device transmitting the multi-interface descriptor to the computer in response to the received custom acquisition command,
  • the computer parses the multi-interface descriptor and constructs a plurality of functional interfaces.
  • the user-side technician can set the custom acquisition command, and set the corresponding protocol according to the custom acquisition command in the computer and the composite device.
  • the composite device can immediately recognize and respond to the custom acquisition command through the application layer.
  • This embodiment preferably customizes the command to obtain the USB standard format under the USB protocol.
  • the computer obtains the multi-interface descriptor, the descriptor is parsed, and the computer can obtain the real device information of the composite device by parsing, for example, the device class number, the maximum packet length of the default endpoint, the interface information, and the port. Information, etc.
  • the computer generates a plurality of functional interfaces, such as a modem (Modem) interface, an control (AT) interface, and a USB flash drive interface, according to the real device information of the composite device obtained by the parsing, and generates a plurality of logical channel supply programs and a composite device. Interaction.
  • a modem Modem
  • AT control
  • USB flash drive interface USB flash drive interface
  • the single interface descriptor includes a single interface device descriptor and a single interface configuration descriptor
  • the single interface configuration descriptor includes an interface descriptor of a preset one interface.
  • the computer can obtain information such as the manufacturer identification number, the product serial number, the device class number, the maximum packet length of the default endpoint, and the number of configuration descriptors.
  • the computer obtains the information such as the length of the configuration descriptor, the power supply mode, and the maximum power consumption by obtaining the single interface configuration descriptor.
  • the single interface configuration descriptor includes an interface descriptor of the interface, and the computer can obtain specific information of an interface.
  • the computer determines that the composite device is a single interface device according to the single interface descriptor.
  • the present invention does not limit the single interface descriptor to include a string descriptor, an endpoint descriptor, and the like.
  • the form of the single interface descriptor of the present invention is a USB standard descriptor, thus facilitating the computer to determine and read the single interface descriptor.
  • the step of establishing a connection between the computer and the composite device further comprises: the composite device loading the customized device driver according to the multi-interface descriptor.
  • a custom device driver is a driver that is set by the user-side technician based on the multi-interface descriptor of the composite device.
  • FIG. 4 is a schematic diagram of functional modules of a first embodiment of a computer according to the present invention.
  • the computer includes: a command module 10 configured to send an acquire descriptor command to the after establishing a connection;
  • the descriptor module 20 is configured to receive a preset single interface descriptor sent by the composite device, and the driving module 30 is configured to determine, according to the obtained single interface descriptor, that the composite device is a single interface device, and load the preset Custom drive.
  • the single interface descriptor is pre-set by the composite device and stored in the composite device.
  • the single interface descriptor does not reflect the real device information of the composite device.
  • the content of the single interface descriptor reflects the information of a single interface device, which is equivalent to a virtual descriptor.
  • Custom drivers are pre-configured based on a single interface descriptor and installed into the kernel layer of the computer.
  • the computer After the computer and the composite device establish a connection, the computer begins enumerating the composite device, that is, obtaining some information of the composite device, and according to the information, loading the appropriate device for the composite device.
  • the command module 10 sends a get descriptor command to the composite device.
  • the composite device does not send the composite composite real descriptor to the descriptor module 20, but instead The set single interface descriptor is sent to the descriptor module 20.
  • the driving module 30 parses the obtained single interface descriptor. Since the single interface descriptor only contains information of a single interface device, the driving module 30 determines that the composite device is a single interface device, and does not recognize the real information of the composite device. . Since the driver module 30 determines that the composite device is a single interface device, the enumeration process does not require the use of a composite device driver, and can directly find a custom driver according to the single interface descriptor, and load a preset custom driver, such as a bus driver. Load a custom driver.
  • the command module 10 sends an acquisition descriptor command to the composite device; the descriptor module 20 receives the preset single interface descriptor sent by the composite device; and the driving module 30 obtains the single
  • the interface descriptor determines that the composite device is a single interface device and loads the preset custom driver.
  • the computer in the embodiment determines that the composite device is a single interface device, so the composite device driver is not enabled in the process of enumerating the composite device, which simplifies enumeration of the composite device by the computer. The process improves the efficiency of the enumeration.
  • the computer of the present invention does not enable the enumeration of the composite device, and can reduce the error rate when developing and maintaining the device driver of the composite device, thereby solving the problems of high cost and low efficiency of the development and production of the composite device.
  • the computer may further include the following steps: a judging module (not shown) configured to determine the speed type of the composite device by the computer; a reset module (not shown), set to reset Composite device; channel module (not shown), set to establish the information channel of the computer and composite device; default pipe module (not shown), set to get the maximum packet length of the default pipe.
  • a judging module configured to determine the speed type of the composite device by the computer
  • a reset module configured to reset Composite device
  • channel module not shown
  • default pipe module (not shown), set to get the maximum packet length of the default pipe.
  • the single interface descriptor includes a single interface device descriptor and a single interface configuration descriptor
  • the single interface configuration descriptor includes an interface descriptor of a preset one interface.
  • the driver module 30 obtains information such as the manufacturer identification number, the product serial number, the device class number, the maximum packet length of the default endpoint, and the number of configuration descriptors by acquiring the single interface device descriptor.
  • the driving module 30 obtains the information of the length of the composite device, the power supply mode, the maximum power consumption, and the like by acquiring the single interface configuration descriptor, and the single module interface descriptor includes an interface descriptor of the interface, and the driving module 30 can The specific information of one interface of the composite device is obtained.
  • the driving module 30 determines that the composite device is a single interface device according to the single interface descriptor.
  • the present invention does not limit the single interface descriptor to include a string descriptor, an endpoint descriptor, and the like.
  • the form of the single interface descriptor of the present invention is a USB standard descriptor, thus facilitating the drive module 30 to determine and read the single interface descriptor.
  • FIG. 5 is a schematic diagram of functional modules of a second embodiment of a computer according to the present invention.
  • the difference between the embodiment and the first embodiment is that, in addition to the first embodiment, the computer further includes: an acquiring module 40, configured to The composite device acquires a multi-interface descriptor; the building module 50 is configured to parse the obtained multi-interface descriptor to construct a plurality of functional interfaces.
  • the obtaining module 40 acquires a multi-interface descriptor from the composite device, for example, the computer sends a fetch instruction to the composite device, and the composite device sends the multi-interface descriptor to the obtaining module 40 in response to the fetching instruction; or the obtaining module 40 can pass some applications.
  • the building module 50 parses the descriptor, and by parsing, the building module 50 can obtain the real device information of the composite device, for example, the device class number and the maximum packet length of the default endpoint. , interface information, port information, etc.
  • the building module 50 generates a plurality of functional interfaces, such as a modem (Modem) interface, an control (AT) interface, and a U disk interface, according to the real device information of the synthesized composite device, and generates a plurality of logical channel supply programs and composites.
  • the device interacts.
  • the obtaining module 40 further includes: an obtaining unit (not shown) configured to send a custom obtaining command to the application layer of the composite device through the application layer; a receiving unit (not shown) configured to pass the application layer Receiving a multi-interface descriptor sent by an application layer of the composite device in response to the custom acquisition command.
  • the computer includes an application layer and a kernel layer
  • the composite device includes an application layer and a kernel layer.
  • the user-side technician can set the custom acquisition command, and set the corresponding protocol according to the custom acquisition command in the application layer of the computer and the application layer of the composite device, and the acquisition unit sends the custom acquisition command to the composite through the application layer.
  • the composite device When in the application layer of the device, the composite device can immediately recognize and respond to the custom acquisition command through the application layer. This embodiment preferably customizes the command to obtain the USB standard format under the USB protocol.
  • the step of the computer acquiring the multi-interface descriptor from the composite device is performed in the application layer of the computer. Since the kernel layer of the computer is not involved, the user-side technician can more conveniently and quickly debug the custom acquisition command and the multi-interface descriptor. Or set, and the cost is lower.
  • FIG. 6 is a schematic diagram of functional units of the building module 50 in the computer of FIG. 5.
  • the building module 50 includes: a building unit 51, configured to parse the multi-interface descriptor obtained by the application layer to construct a plurality of the function interfaces; and the generating unit 52 is configured to pass The application layer generates a plurality of child devices or a plurality of operation handles according to the plurality of the functional interfaces constructed.
  • the constructing unit 51 constructs a plurality of the functional interfaces by using the multi-interface descriptor obtained by the application layer parsing, and the generating unit 52 generates a plurality of sub-devices according to the plurality of the functional interfaces that are constructed, and the supplying program opens the sub-devices.
  • Data interaction with the composite device; or, generate multiple file operation handles the application directly calls the file operation handle to interact with the composite device for data interaction.
  • multiple sub-devices or multiple operation handles are generated, which facilitates data interaction between the application and the composite device through the sub-device or multiple operation handles.
  • complex operations such as generating multiple functional interfaces are performed at the application layer of the computer, and the kernel layer of the computer is not required to be executed. Therefore, the driving of the composite device is more controllable, and the debugging is more convenient, and the cost is lower.
  • FIG. 7 is a schematic diagram of functional modules of a first embodiment of a composite device according to the present invention.
  • the composite device includes: a first receiving module 01 configured to receive an acquisition descriptor command sent by the computer to the composite device; and a first sending module 02 configured to respond to the obtaining descriptor
  • the command sends the preset single interface descriptor to the computer, and the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads the preset custom driver.
  • Single interface descriptors are pre-set and saved in the composite device. The single interface descriptor does not reflect the real device information of the composite device.
  • the content of the single interface descriptor reflects the information of a single interface device, which is equivalent to a virtual descriptor.
  • Custom drivers are pre-configured based on a single interface descriptor and installed into the kernel layer of the computer.
  • the computer After the computer and the composite device establish a connection, the computer begins enumerating the composite device, that is, obtaining some information of the composite device, and according to the information, loading the appropriate device for the composite device.
  • the computer sends a Get Descriptor command to the composite device.
  • the first receiving module 01 receives the acquisition descriptor command sent by the computer, and the first sending module 02 responds to the acquiring descriptor command, and sends the preset single interface descriptor to the computer, and the computer describes the single interface according to the obtained , determines that the composite device is a single interface device, and loads the preset custom driver. For example, the computer sends a get descriptor command to the composite device. After the first receiving module 01 receives the get descriptor command sent by the computer, the first sending module 02 does not send the composite composite real descriptor to the computer, but instead A preset single interface descriptor is sent to the computer. The computer parses the obtained single interface descriptor.
  • the computer determines that the composite device is a single interface device and does not recognize the real information of the composite device. Since the computer determines that the composite device is a single interface device, the enumeration process does not require the use of a composite device driver, and can directly find a custom driver according to the single interface descriptor, and load a preset custom driver, such as loading with a bus driver. Define the driver.
  • the first receiving module 01 receives the acquisition descriptor command sent by the computer to the composite device; the first sending module 02 responds to the acquiring descriptor command, and sends the preset single interface descriptor to the computer for obtaining by the computer according to the acquisition.
  • the single interface descriptor determines that the composite device is a single interface device and loads a preset custom driver.
  • the first sending module 02 sends a single interface descriptor to the computer, and the computer determines that the composite device is a single interface device according to the single interface descriptor, so the computer does not enable the composite device driver during the enumeration of the composite device, which simplifies The process of enumerating a composite device by a computer improves the efficiency of enumeration.
  • the computer of the present invention does not enable the enumeration of the composite device, and can reduce the error rate when developing and maintaining the device driver of the composite device, thereby solving the problems of high cost and low efficiency of the development and production of the composite device.
  • FIG. 8 is a schematic diagram of a functional module of a preferred embodiment of the composite device according to the present invention.
  • the composite device further includes: a second receiving module 03, configured to receive a custom acquisition command sent by the computer.
  • the second sending module 04 is configured to send the multi-interface descriptor to the computer in response to the received custom acquisition command, for the computer to parse the multi-interface descriptor, and construct a plurality of functional interfaces.
  • the user-side technician can set the custom acquisition command, and set the corresponding protocol according to the custom acquisition command in the computer and the composite device.
  • the composite device can immediately recognize and respond to the custom acquisition command through the application layer.
  • This embodiment preferably customizes the command to obtain the USB standard format under the USB protocol.
  • the computer obtains the multi-interface descriptor, the descriptor is parsed, and the computer can obtain the real device information of the composite device by parsing, for example, the device class number, the maximum packet length of the default endpoint, the interface information, and the port. Information, etc.
  • the computer generates a plurality of functional interfaces, such as a modem (Modem) interface, an control (AT) interface, and a USB flash drive interface, according to the real device information of the composite device obtained by the parsing, and generates a plurality of logical channel supply programs and a composite device. Interaction.
  • a modem Modem
  • AT control
  • USB flash drive interface USB flash drive interface
  • the single interface descriptor includes a single interface device descriptor and a single interface configuration descriptor
  • the single interface configuration descriptor includes an interface descriptor of a preset one interface.
  • the computer can obtain information such as the manufacturer identification number, the product serial number, the device class number, the maximum packet length of the default endpoint, and the number of configuration descriptors.
  • the computer obtains the information such as the length of the configuration descriptor, the power supply mode, and the maximum power consumption by obtaining the single interface configuration descriptor.
  • the single interface configuration descriptor includes an interface descriptor of the interface, and the computer can obtain specific information of an interface.
  • the computer determines that the composite device is a single interface device according to the single interface descriptor.
  • the present invention does not limit the single interface descriptor to include a string descriptor, an endpoint descriptor, and the like.
  • the form of the single interface descriptor of the present invention is a USB standard descriptor, thus facilitating the computer to determine and read the single interface descriptor.
  • the composite device further includes: a load driving module (not shown) configured to load a custom device driver according to the multi-interface descriptor.
  • the custom device driver is a driver set by the user-side technician based on the multi-interface descriptor of the composite device.
  • the load driver module loads the custom device driver according to the multi-interface descriptor, and the composite device drives itself to perform data interaction with the computer.
  • a universal serial bus driving method, a computer, and a composite device provided by the embodiments of the present invention have the following beneficial effects:
  • the process of enumerating a composite device by a computer is simplified, and the efficiency of enumeration is improved.
  • the computer of the present invention does not enable the enumeration of the composite device, and can reduce the error rate when developing and maintaining the device driver of the composite device, thereby solving the problems of high cost and low efficiency of the development and production of the composite device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Systems (AREA)
  • Stored Programmes (AREA)

Abstract

Disclosed are a universal serial bus (USB) drive method, computer and composite device. After a computer and a composite device establish a connection, the computer transmits a descriptor acquisition command to the composite device; the computer receives a preset single-interface descriptor transmitted by the composite device; according to the obtained single-interface descriptor, the computer determines that the composite device is a single-interface device, and loads a preset user-defined drive. The computer of the present invention by not starting the composite device drive in a composite device enumeration process simplifies the composite device enumeration process performed by the computer, and improves enumeration efficiency. On the other hand, the computer of the present invention by not starting the composite device for enumeration, can also reduce the error rate in the development and maintenance of the device drive of the composite device, thus solving the problems of high costs and low efficiency of the development and production of the composite device.

Description

通用串行总线的驱动方法、 计算机及复合设备 技术领域 本发明涉及计算机技术领域, 尤其涉及通用串行总线的驱动方法、 计算机及复合 设备。 背景技术 对于多接口的通用串行总线(Universal Serial Bus, 简称为 USB)设备(即复合设 备) 的枚举方法大致为: 复合设备插入计算机(计算机), 计算机获取复合设备的描述 符, 并对该描述符进行解析, 计算机复合设备驱动根据复合设备的各个接口分别加载 各个接口对应的驱动程序。 其中, 复合设备驱动在计算机的内核层, 且在复合设备的 枚举过程中, 承担了非常多的工作。 开发者在复合设备的研发、 检测、 生产、 售后等 多个环节都需要计算机对复合设备进行驱动, 而一些计算机的操作系统 (例如: Windows系统) 的内核代码不开源, 因此, 开发者只能对复合设备内的设备驱动进行 开发和维护。 复合设备驱动由于承担了非常多的工作, 因此容易出错, 造成设备驱动 开发和维护出错, 而若要寻求操作系统开发商的支持, 则需要支付高额的费用及经历 繁琐的程序, 这样造成了复合设备研发和生产的成本高、 效率低等问题。 发明内容 本发明提供了一种通用串行总线的驱动方法、 计算机及复合设备, 以至少解决相 关技术中的计算机将复合设备识别为单接口设备, 因而不会启用计算机内核的复合设 备驱动对复合设备进行枚举的问题。 为实现上述目的, 本发明提供的通用串行总线的驱动方法, 应用于计算机, 包括 以下步骤: 在计算机与复合设备建立连接后, 计算机发送获取描述符命令至复合设备; 计算机接收复合设备发送的预设的单接口描述符; 计算机根据获取的所述单接口描述符, 确定复合设备为单接口设备, 并加载预设 的自定义驱动。 优选地,所述计算机根据获取的所述单接口描述符,确定复合设备为单接口设备, 并加载预设的自定义驱动步骤之后包括: 计算机从复合设备获取多接口描述符; 计算机解析获取的所述多接口描述符, 构建多个功能接口。 优选地, 所述计算机解析获取的所述多接口描述符, 构建多个功能接口的步骤包 括: 计算机通过应用层解析获取的所述多接口描述符, 构建多个所述功能接口; 计算机通过应用层根据构建的多个所述功能接口, 生成多个子设备或者多个操作 句柄。 The present invention relates to the field of computer technologies, and in particular, to a method, a computer, and a composite device for driving a universal serial bus. BACKGROUND The enumeration method for a multi-interface universal serial bus (USB) device (ie, a composite device) is roughly as follows: a composite device is inserted into a computer (computer), and the computer obtains a descriptor of the composite device, and The descriptor is parsed, and the computer composite device driver loads the driver corresponding to each interface according to each interface of the composite device. Among them, the composite device is driven in the kernel layer of the computer, and in the enumeration process of the composite device, it takes a lot of work. Developers need computers to drive composite devices in various aspects of R&D, testing, production, and after-sales of composite devices. The operating system code of some computer operating systems (for example, Windows systems) is not open source, so developers can only Develop and maintain device drivers within composite devices. Composite device drivers are prone to errors due to a lot of work, resulting in equipment driver development and maintenance errors. If you want to seek support from operating system developers, you will have to pay high fees and cumbersome procedures. The cost and efficiency of composite equipment development and production are high. SUMMARY OF THE INVENTION The present invention provides a universal serial bus driving method, a computer, and a composite device, to at least solve the problem in the related art that a computer recognizes a composite device as a single interface device, and thus does not enable a composite device driver of the computer core to composite The problem with the device enumerating. To achieve the above object, the universal serial bus driving method provided by the present invention is applied to a computer, and includes the following steps: after the computer establishes a connection with the composite device, the computer sends a descriptor command to the composite device; and the computer receives the composite device to send the The preset single interface descriptor; the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads a preset custom driver. Preferably, the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and after loading the preset custom driving step, the method includes: the computer acquiring the multi-interface descriptor from the composite device; The multi-interface descriptor constructs a plurality of functional interfaces. Preferably, the step of the computer parsing the obtained multi-interface descriptor to construct a plurality of functional interfaces comprises: the computer constructing a plurality of the functional interfaces by using the multi-interface descriptor obtained by the application layer parsing; The layer generates a plurality of sub-devices or a plurality of operation handles according to the plurality of the functional interfaces constructed.
本发明进一步提供的通用串行总线的驱动方法,应用于复合设备,包括以下步骤: 复合设备接收计算机发送的获取描述符命令至复合设备; 复合设备响应所述获取描述符命令, 并将预设的单接口描述符发送至计算机, 供 计算机根据获取的所述单接口描述符, 确定复合设备为单接口设备, 并加载预设的自 定义驱动。 优选地, 所述复合设备响应所述获取描述符命令, 并将预设的单接口描述符发送 至计算机, 供计算机根据获取的所述单接口描述符, 确定复合设备为单接口设备, 并 加载预设的自定义驱动的步骤之后还包括: 复合设备接收计算机发送的自定义获取命令; 复合设备响应接收的所述自定义获取命令, 发送所述多接口描述符至计算机, 供 计算机解析所述多接口描述符, 并构建多个功能接口。 The universal serial bus driving method further provided by the present invention is applied to a composite device, comprising the steps of: receiving, by a composite device, a acquiring descriptor command sent by a computer to a composite device; and the composite device responding to the acquiring descriptor command, and The single interface descriptor is sent to the computer, and the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads a preset custom driver. Preferably, the composite device responds to the acquiring descriptor command, and sends a preset single interface descriptor to a computer, and the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads The step of the preset custom driver further includes: the composite device receiving a custom acquisition command sent by the computer; the composite device transmitting the multi-interface descriptor to the computer in response to the received custom acquisition command, for parsing by the computer Multiple interface descriptors and build multiple functional interfaces.
本发明进一步提供的计算机, 包括: 命令模块, 设置为在与复合设备建立连接后, 发送获取描述符命令至所述复合设 描述符模块, 设置为接收复合设备发送的预设的单接口描述符; 驱动模块, 设置为根据获取的所述单接口描述符, 识别所述复合设备为单接口设 备, 并加载预设的自定义驱动。 优选地, 所述计算机还包括: 获取模块, 设置为从所述复合设备获取多接口描述符; 构建模块, 设置为解析获取的所述多接口描述符, 构建多个功能接口。 优选地, 所述构建模块包括: 构建单元, 设置为通过应用层解析获取的所述多接口描述符, 构建多个所述功能 接口; 生成单元, 设置为通过应用层根据构建的多个所述功能接口, 生成多个子设备或 者多个操作句柄。 The computer further provided by the present invention, comprising: a command module, configured to send a get descriptor command to the composite device after establishing a connection with the composite device a descriptor module, configured to receive a preset single interface descriptor sent by the composite device; the driving module is configured to identify the composite device as a single interface device according to the obtained single interface descriptor, and load the preset self Define the driver. Preferably, the computer further includes: an obtaining module, configured to acquire a multi-interface descriptor from the composite device; a building module, configured to parse the obtained multi-interface descriptor, and construct a plurality of functional interfaces. Preferably, the building module includes: a building unit, configured to parse the multi-interface descriptor obtained by the application layer to construct a plurality of the function interfaces; and generating a unit, configured to be configured by the application layer according to the plurality of A functional interface that generates multiple child devices or multiple action handles.
本发明进一步提供的复合设备, 包括: 第一接收模块, 设置为接收计算机发送的获取描述符命令至复合设备; 第一发送模块, 设置为响应所述获取描述符命令, 并将预设的单接口描述符发送 至计算机, 供计算机根据获取的所述单接口描述符, 确定复合设备为单接口设备, 并 加载预设的自定义驱动。 优选地, 所述复合设备还包括: 第二接收模块, 设置为接收计算机发送的自定义获取命令; 第二发送模块, 设置为响应接收的所述自定义获取命令, 发送所述多接口描述符 至计算机, 供计算机解析所述多接口描述符, 并构建多个功能接口。 The composite device further provided by the present invention, comprising: a first receiving module, configured to receive an acquisition descriptor command sent by a computer to a composite device; a first sending module, configured to respond to the acquiring descriptor command, and to preset a single The interface descriptor is sent to the computer, and the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads a preset custom driver. Preferably, the composite device further includes: a second receiving module, configured to receive a custom acquisition command sent by the computer; and a second sending module, configured to send the multi-interface descriptor in response to the received custom acquisition command To the computer, the computer parses the multi-interface descriptor and constructs multiple functional interfaces.
本发明在计算机与复合设备建立连接后,计算机发送获取描述符命令至复合设备; 计算机接收复合设备发送的预设的单接口描述符; 计算机根据获取的所述单接口描述 符, 确定复合设备为单接口设备, 并加载预设的自定义驱动。 本发明计算机在获取复 合设备发送的单接口描述符后, 识别复合设备为单接口设备, 因此在对复合设备进行 枚举的过程中不启用复合设备驱动, 简化了计算机对复合设备进行枚举的过程, 提高 了枚举的效率。 另一方面, 本发明计算机不启用复合设备进行枚举, 在对复合设备的 设备驱动进行开发和维护时, 能降低出错率, 从而可解决复合设备研发和生产的成本 高、 效率低等问题。 附图说明 图 1为本发明通用串行总线的驱动方法第一实施例的流程示意图; 图 2为本发明通用串行总线的驱动方法第二实施例的流程示意图; 图 3为本发明通用串行总线的驱动方法一实施例的流程示意图; 图 4为本发明计算机第一实施例的功能模块示意图; 图 5为本发明计算机第二实施例的功能模块示意图; 图 6为图 5计算机中构建模块的功能单元示意图; 图 7为本发明复合设备第一实施例的功能模块示意图; 图 8为本发明复合设备一优选实施例的功能模块示意图。 After the computer establishes a connection with the composite device, the computer sends a get descriptor command to the composite device; the computer receives the preset single interface descriptor sent by the composite device; and the computer determines, according to the obtained single interface descriptor, the composite device Single interface device, and load preset custom drivers. The computer of the present invention acquires complex After the single interface descriptor sent by the device, the composite device is identified as a single interface device, so the composite device driver is not enabled during the enumeration of the composite device, which simplifies the process of enumerating the composite device by the computer, and improves the enumeration process. The efficiency of the exercise. On the other hand, the computer of the present invention does not enable the enumeration of the composite device, and can reduce the error rate when developing and maintaining the device driver of the composite device, thereby solving the problems of high cost and low efficiency of the development and production of the composite device. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a schematic flow chart of a first embodiment of a driving method of a universal serial bus according to the present invention; FIG. 2 is a schematic flowchart of a driving method of a universal serial bus according to a second embodiment of the present invention; FIG. 4 is a schematic diagram of functional modules of a first embodiment of a computer according to the present invention; FIG. 5 is a schematic diagram of functional modules of a second embodiment of a computer according to the present invention; FIG. 7 is a schematic diagram of functional modules of a first embodiment of a composite device according to the present invention; FIG. 8 is a schematic diagram of functional blocks of a preferred embodiment of a composite device according to the present invention.
本发明目的的实现、 功能特点及优点将结合实施例, 参照附图做进一步说明。 具体实施方式 应当理解,此处所描述的具体实施例仅仅用以解释本发明, 并不用于限定本发明。 本领域技术人员可以理解的, 本发明通用串行总线的驱动方法及系统的下述实施 例中, 复合设备是指一种能完成两个或多个不同设备的功能的 USB设备。 本发明提供一种通用串行总线的驱动方法, 应用于计算机。 参照图 1, 图 1为本发明通用串行总线的驱动方法第一实施例的流程示意图。 在通用串行总线的驱动方法第一实施例中, 该方法包括以下步骤: 步骤 S10, 在计算机与复合设备建立连接后, 计算机发送获取描述符命令至复合 设备; 步骤 S20, 计算机接收复合设备发送的预设的单接口描述符; 步骤 S30, 计算机根据获取的所述单接口描述符, 确定复合设备为单接口设备, 并加载预设的自定义驱动。 单接口描述符是预先设置并保存在复合设备中的。 单接口描述符并不体现复合设 备的真实设备信息, 单接口描述符的内容体现的是一个单一接口的设备的信息, 相当 于一个虚拟的描述符。 自定义驱动是根据单接口描述符预先设置的, 并安装到计算机的内核层中。 计算机和复合设备建立连接后, 计算机开始对复合设备进行枚举, 即获取复合设 备的一些信息, 根据这些信息, 为复合设备加载适合的驱动。 例如, 计算机发送获取 描述符命令至复合设备, 复合设备接收到计算机发送的获取描述符命令后, 并不将复 合设备真实的复合描述符发送给计算机, 而是将预设的单接口描述符发送至计算机。 计算机对获取的单接口描述符进行解析, 由于单接口描述符只包含一个单一接口 的设备的信息, 因此, 计算机确定复合设备为单接口设备, 而并不能识别复合设备的 真实信息。 由于计算机确定复合设备为单接口设备, 因此, 枚举的过程不需要使用复合设备 驱动, 可以直接根据单接口描述符找到自定义驱动, 并加载预设的自定义驱动, 如用 总线驱动加载自定义驱动。 本实施例在计算机与复合设备建立连接后, 计算机发送获取描述符命令至复合设 备; 计算机接收复合设备发送的预设的单接口描述符; 计算机根据获取的所述单接口 描述符, 确定复合设备为单接口设备, 并加载预设的自定义驱动。 本实施例计算机在 获取复合设备发送的单接口描述符后, 确定复合设备为单接口设备, 因此在对复合设 备进行枚举的过程中不启用复合设备驱动,简化了计算机对复合设备进行枚举的过程, 提高了枚举的效率。 另一方面, 本发明计算机不启用复合设备进行枚举, 在对复合设 备的设备驱动进行开发和维护时, 能降低出错率, 从而可解决复合设备研发和生产的 成本高、 效率低等问题。 本领域技术人员可以理解的, 在计算机发送获取描述符命令至复合设备的步骤之 前, 还可以包括以下步骤: 计算机判断复合设备的速度类型; 计算机复位复合设备; 建立计算机和复合设备的信息通道; 计算机获取默认管道的最大包长度。 这些步骤因 为较为常规, 并不受本发明限制, 本领域技术人员可根据需要执行这些步骤中的一个 或者多个。 The implementation, functional features, and advantages of the present invention will be further described with reference to the accompanying drawings. The specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. It will be understood by those skilled in the art that in the following embodiments of the driving method and system of the universal serial bus of the present invention, the composite device refers to a USB device capable of performing the functions of two or more different devices. The invention provides a universal serial bus driving method applied to a computer. Referring to FIG. 1, FIG. 1 is a schematic flow chart of a first embodiment of a driving method of a universal serial bus according to the present invention. In a first embodiment of the driving method of the universal serial bus, the method comprises the following steps: Step S10, after the computer establishes a connection with the composite device, the computer sends a get descriptor command to the composite device; step S20, the computer receives the preset single interface descriptor sent by the composite device; step S30, the computer obtains the single interface according to the single interface The descriptor determines that the composite device is a single interface device and loads the preset custom driver. Single interface descriptors are pre-set and saved in the composite device. The single interface descriptor does not reflect the real device information of the composite device. The content of the single interface descriptor reflects the information of a single interface device, which is equivalent to a virtual descriptor. Custom drivers are pre-configured based on a single interface descriptor and installed into the kernel layer of the computer. After the computer and the composite device establish a connection, the computer begins enumerating the composite device, that is, obtaining some information of the composite device, and according to the information, loading the appropriate device for the composite device. For example, the computer sends a get descriptor command to the composite device. After receiving the get descriptor command sent by the computer, the composite device does not send the composite composite real descriptor to the computer, but sends the preset single interface descriptor. To the computer. The computer parses the obtained single interface descriptor. Since the single interface descriptor contains only information about a single interface device, the computer determines that the composite device is a single interface device and does not recognize the real information of the composite device. Since the computer determines that the composite device is a single interface device, the enumeration process does not require the use of a composite device driver, and can directly find a custom driver according to the single interface descriptor, and load a preset custom driver, such as loading with a bus driver. Define the driver. In this embodiment, after the computer establishes a connection with the composite device, the computer sends a get descriptor command to the composite device; the computer receives the preset single interface descriptor sent by the composite device; and the computer determines the composite device according to the obtained single interface descriptor. As a single interface device, and load a preset custom driver. After obtaining the single interface descriptor sent by the composite device, the computer in the embodiment determines that the composite device is a single interface device, so the composite device driver is not enabled in the process of enumerating the composite device, which simplifies enumeration of the composite device by the computer. The process improves the efficiency of the enumeration. On the other hand, the computer of the present invention does not enable the enumeration of the composite device, and can reduce the error rate when developing and maintaining the device driver of the composite device, thereby solving the problems of high cost and low efficiency of the development and production of the composite device. It can be understood by those skilled in the art that before the step of sending a descriptor command to the composite device by the computer, the following steps may be further included: the computer determines the speed type of the composite device; the computer resets the composite device; and establishes an information channel of the computer and the composite device; The computer gets the maximum packet length for the default pipe. These steps are more conventional and are not limited by the present invention, and one skilled in the art can perform one or more of these steps as needed.
本发明一优选实施例中, 所述单接口描述符包括单接口设备描述符、 单接口配置 描述符, 所述单接口配置描述符包括预设的一个接口的接口描述符。 计算机通过获取单接口设备描述符, 可得到如制造商标识号、 产品序列号、 所述 设备类号、 默认端点的最大包长度和配置描述符的个数等信息。 计算机通过获取单接 口配置描述符可得到如配置描述符的长度、 供电方式、 最大耗电量等信息, 又由于单 接口配置描述符包括一个接口的接口描述符, 计算机可得到一个接口的具体信息, 因 此, 计算机根据该单接口描述符确定复合设备为单接口设备。 当然, 本发明并不限定单接口描述符包括字符串描述符、 端点描述符等。 本发明单接口描述符的形式为 USB标准描述符, 因此, 有利于计算机确定并读取 该单接口描述符。 In a preferred embodiment of the present invention, the single interface descriptor includes a single interface device descriptor and a single interface configuration descriptor, and the single interface configuration descriptor includes an interface descriptor of a preset one interface. By obtaining the single interface device descriptor, the computer can obtain information such as the manufacturer identification number, the product serial number, the device class number, the maximum packet length of the default endpoint, and the number of configuration descriptors. The computer obtains the information such as the length of the configuration descriptor, the power supply mode, and the maximum power consumption by obtaining the single interface configuration descriptor. The single interface configuration descriptor includes an interface descriptor of the interface, and the computer can obtain specific information of an interface. Therefore, the computer determines that the composite device is a single interface device according to the single interface descriptor. Of course, the present invention does not limit the single interface descriptor to include a string descriptor, an endpoint descriptor, and the like. The form of the single interface descriptor of the present invention is a USB standard descriptor, thus facilitating the computer to determine and read the single interface descriptor.
参照图 2, 图 2为本发明通用串行总线的驱动方法第二实施例的流程示意图。 本发明通用串行总线的驱动方法第二实施例中, 本实施例与第一实施例的区别在 于, 本实施例在第一实施例的基础上, 所述计算机根据获取的所述单接口描述符, 确 定复合设备为单接口设备, 并加载预设的自定义驱动步骤之后包括: 步骤 S40, 计算机从复合设备获取多接口描述符; 步骤 S50, 计算机解析获取的所述多接口描述符, 构建多个功能接口。 计算机从复合设备获取多接口描述符, 例如, 计算机发送获取指令至复合设备, 复合设备响应该获取指令, 将多接口描述符发送至计算机; 或者, 计算机可以通过一 些应用程序从复合设备获取多接口描述符; 或者,其他适合的方式获取多接口描述符。 计算机获取多接口描述符之后, 对该描述符进行解析, 通过解析, 计算机就能获 得复合设备真实的设备信息, 例如, 所述设备类号、 默认端点的最大包长度、 接口的 信息、 端口的信息等。 计算机根据解析得到的复合设备的真实的设备信息, 生成多个功能接口, 如调制 解调器 (Modem)接口、 控制 (AT)接口、 U盘接口等, 生成了多个逻辑通道供应用程序 与复合设备进行交互。 Referring to FIG. 2, FIG. 2 is a schematic flowchart diagram of a second embodiment of a driving method of a universal serial bus according to the present invention. In the second embodiment of the driving method of the universal serial bus of the present invention, the difference between this embodiment and the first embodiment is that, according to the first embodiment, the computer is described according to the obtained single interface. After determining that the composite device is a single interface device, and loading the preset custom driving step, the method includes: Step S40: The computer acquires the multi-interface descriptor from the composite device; Step S50, the computer parses the obtained multi-interface descriptor, constructs Multiple functional interfaces. The computer obtains the multi-interface descriptor from the composite device, for example, the computer sends the acquisition instruction to the composite device, and the composite device sends the multi-interface descriptor to the computer in response to the acquisition instruction; or the computer can acquire the multi-interface from the composite device through some applications. Descriptor; or, other suitable ways to obtain a multi-interface descriptor. After the computer obtains the multi-interface descriptor, the descriptor is parsed, and the computer can obtain the real device information of the composite device by parsing, for example, the device class number, the maximum packet length of the default endpoint, the interface information, and the port. Information, etc. The computer generates a plurality of functional interfaces, such as a modem (Modem) interface, an control (AT) interface, and a USB flash drive interface, according to the real device information of the composite device obtained by the parsing, and generates a plurality of logical channel supply programs and a composite device. Interaction.
在本发明一优选实施例中,所述计算机从复合设备获取多接口描述符的步骤包括: 计算机通过应用层发送自定义获取命令至复合设备的应用层; 计算机通过应用层接收复合设备的应用层响应所述自定义获取命令而发送的多接 口描述符。 计算机包括应用层和内核层, 复合设备包括应用层和内核层。 用户侧的技术人员可以对自定义获取命令进行设定, 且在计算机的应用层和复合 设备的应用层中根据自定义获取命令设置相应的协议, 计算机通过应用层发送自定义 获取命令至复合设备的应用层中时, 复合设备通过应用层能立即识别且响应该自定义 获取命令。 本实施例优选自定义获取命令为 USB协议下的 USB标准格式的命令。 计算机从复合设备获取多接口描述符的步骤在计算机的应用层中进行, 因不需涉 及计算机的内核层, 用户侧的技术人员可更方便快捷的对自定义获取命令、 多接口描 述符进行调试或者设置, 且成本较低。 In a preferred embodiment of the present invention, the step of the computer acquiring the multi-interface descriptor from the composite device comprises: the computer sending a custom acquisition command to the application layer of the composite device through the application layer; and the computer receiving the application layer of the composite device through the application layer A multi-interface descriptor sent in response to the custom get command. The computer includes an application layer and a kernel layer, and the composite device includes an application layer and a kernel layer. The user-side technician can set the custom acquisition command, and set the corresponding protocol according to the custom acquisition command in the application layer of the computer and the application layer of the composite device, and the computer sends a custom acquisition command to the composite device through the application layer. In the application layer, the composite device can immediately recognize and respond to the custom acquisition command through the application layer. This embodiment preferably customizes the command to obtain the USB standard format under the USB protocol. The step of the computer acquiring the multi-interface descriptor from the composite device is performed in the application layer of the computer. Since the kernel layer of the computer is not involved, the user-side technician can more conveniently and quickly debug the custom acquisition command and the multi-interface descriptor. Or set, and the cost is lower.
在本发明一优选实施例中, 所述计算机解析获取的所述多接口描述符, 生成多个 功能接口的步骤包括: 计算机通过应用层解析获取的所述多接口描述符, 构建多个所述功能接口; 计算机通过应用层根据构建的多个所述功能接口, 生成多个子设备或者多个操作 句柄。 计算机通过应用层解析获取的所述多接口描述符, 构建多个所述功能接口, 且根 据构建的多个所述功能接口, 生成多个子设备, 供应用程序通过打开子设备与复合设 备进行数据交互; 或者, 生成多个文件操作句柄, 供应用程序直接调用文件操作句柄 与复合设备进行数据交互。 本实施例生成多个子设备或者多个操作句柄, 方便了应用程序通过子设备或者多 个操作句柄与复合设备进行数据交互。 本实施例将生成多个功能接口等复杂操作在计算机的应用层执行, 而不需要计算 机的内核层执行, 因此, 使得计算机对复合设备的驱动更加可控, 且更方便调试, 成 本更低。 In a preferred embodiment of the present invention, the step of the computer parsing the obtained multi-interface descriptor to generate a plurality of functional interfaces includes: the computer parsing the obtained multi-interface descriptor through an application layer, and constructing the plurality of Functional interface; the computer generates a plurality of sub-devices or multiple operation handles according to a plurality of the functional interfaces constructed by the application layer. The computer parses the obtained multi-interface descriptors by the application layer, constructs a plurality of the functional interfaces, and generates a plurality of sub-devices according to the plurality of the functional interfaces that are constructed, and the application program opens the sub-devices and the composite device. Data interaction is performed; or, multiple file operation handles are generated, and the application program directly calls the file operation handle to perform data interaction with the composite device. In this embodiment, multiple sub-devices or multiple operation handles are generated, which facilitates data interaction between the application and the composite device through the sub-device or multiple operation handles. In this embodiment, complex operations such as generating multiple functional interfaces are performed at the application layer of the computer, and the kernel layer of the computer is not required to be executed. Therefore, the driving of the composite device is more controllable, and the debugging is more convenient, and the cost is lower.
本发明进一步提供一种通用串行总线的驱动方法, 应用于复合设备。 参照图 3, 图 3为本发明通用串行总线的驱动方法一实施例的流程示意图。 在本发明通用串行总线的驱动方法一实施例中, 该方法包括以下步骤: 步骤 S01, 复合设备接收计算机发送的获取描述符命令至复合设备; 步骤 S02, 复合设备响应所述获取描述符命令, 并将预设的单接口描述符发送至 计算机, 供计算机根据获取的所述单接口描述符, 确定复合设备为单接口设备, 并加 载预设的自定义驱动。 单接口描述符是预先设置并保存在复合设备中的。 单接口描述符并不体现复合设 备的真实设备信息, 单接口描述符的内容体现的是一个单一接口的设备的信息, 相当 于一个虚拟的描述符。 自定义驱动是根据单接口描述符预先设置的, 并安装到计算机的内核层中。 计算机和复合设备建立连接后, 计算机开始对复合设备进行枚举, 即获取复合设 备的一些信息, 根据这些信息, 为复合设备加载适合的驱动。 计算机发送获取描述符 命令至复合设备。 复合设备响应所述获取描述符命令, 并将预设的单接口描述符发送 至计算机, 供计算机根据获取的所述单接口描述符, 确定复合设备为单接口设备, 并 加载预设的自定义驱动。 例如, 计算机发送获取描述符命令至复合设备, 复合设备接收到计算机发送的获 取描述符命令后, 并不将复合设备真实的复合描述符发送给计算机, 而是将预设的单 接口描述符发送至计算机。 计算机对获取的单接口描述符进行解析, 由于单接口描述符只包含一个单一接口 的设备的信息, 因此, 计算机确定复合设备为单接口设备, 而并不能识别复合设备的 真实信息。 由于计算机确定复合设备为单接口设备, 因此, 枚举的过程不需要使用复合设备 驱动, 可以直接根据单接口描述符找到自定义驱动, 并加载预设的自定义驱动, 如用 总线驱动加载自定义驱动。 本实施例复合设备接收计算机发送的获取描述符命令至复合设备; 复合设备响应 所述获取描述符命令, 并将预设的单接口描述符发送至计算机, 供计算机根据获取的 所述单接口描述符, 确定复合设备为单接口设备, 并加载预设的自定义驱动。 本实施 例复合设备发送单接口描述符至计算机, 计算机根据单接口描述符确定复合设备为单 接口设备, 因此计算机在对复合设备进行枚举的过程中不启用复合设备驱动, 简化了 计算机对复合设备进行枚举的过程, 提高了枚举的效率。 另一方面, 本发明计算机不 启用复合设备进行枚举,在对复合设备的设备驱动进行开发和维护时, 能降低出错率, 从而可解决复合设备研发和生产的成本高、 效率低等问题。 The invention further provides a universal serial bus driving method for a composite device. Referring to FIG. 3, FIG. 3 is a schematic flowchart diagram of an embodiment of a driving method of a universal serial bus according to the present invention. In an embodiment of the driving method of the universal serial bus of the present invention, the method includes the following steps: Step S01, the composite device receives an acquisition descriptor command sent by the computer to the composite device; Step S02, the composite device responds to the acquisition descriptor command And sending a preset single interface descriptor to the computer, and the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads the preset custom driver. Single interface descriptors are pre-set and saved in the composite device. The single interface descriptor does not reflect the real device information of the composite device. The content of the single interface descriptor reflects the information of a single interface device, which is equivalent to a virtual descriptor. Custom drivers are pre-configured based on a single interface descriptor and installed into the kernel layer of the computer. After the computer and the composite device establish a connection, the computer begins enumerating the composite device, that is, obtaining some information of the composite device, and according to the information, loading the appropriate device for the composite device. The computer sends a Get Descriptor command to the composite device. The composite device responds to the acquiring descriptor command, and sends a preset single interface descriptor to the computer, and the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads the preset customization. drive. For example, the computer sends a get descriptor command to the composite device. After receiving the get descriptor command sent by the computer, the composite device does not send the composite composite real descriptor to the computer, but sends the preset single interface descriptor. To the computer. The computer parses the obtained single interface descriptor. Since the single interface descriptor contains only information about a single interface device, the computer determines that the composite device is a single interface device and does not recognize the real information of the composite device. Since the computer determines that the composite device is a single interface device, the enumeration process does not require the use of a composite device driver, and can directly find a custom driver according to the single interface descriptor, and load a preset custom driver, such as loading with a bus driver. Define the driver. In this embodiment, the composite device receives the acquisition descriptor command sent by the computer to the composite device; the composite device responds to the acquisition descriptor command, and sends the preset single interface descriptor to the computer for the computer to describe according to the obtained single interface. , determines that the composite device is a single interface device, and loads the preset custom driver. In this embodiment, the composite device sends a single interface descriptor to the computer, and the computer determines that the composite device is a single interface device according to the single interface descriptor, so the computer does not enable the composite device driver during the enumeration process of the composite device, simplifying the computer to composite The process of enumerating devices increases the efficiency of enumerations. On the other hand, the computer of the present invention does not enable the enumeration of the composite device, and can reduce the error rate when developing and maintaining the device driver of the composite device, thereby solving the problems of high cost and low efficiency of the development and production of the composite device.
本发明一优选实施例中, 所述复合设备响应所述获取描述符命令, 并将预设的单 接口描述符发送至计算机, 供计算机根据获取的所述单接口描述符, 确定复合设备为 单接口设备, 并加载预设的自定义驱动的步骤之后还包括: 复合设备接收计算机发送的自定义获取命令; 复合设备响应接收的所述自定义获取命令, 发送所述多接口描述符至计算机, 供 计算机解析所述多接口描述符, 并构建多个功能接口。 用户侧的技术人员可以对自定义获取命令进行设定, 且在计算机和复合设备中根 据自定义获取命令设置相应的协议, 计算机通过应用层发送自定义获取命令至复合设 备的应用层中时, 复合设备通过应用层能立即识别且响应该自定义获取命令。 本实施 例优选自定义获取命令为 USB协议下的 USB标准格式的命令。 计算机获取多接口描述符之后, 对该描述符进行解析, 通过解析, 计算机就能获 得复合设备真实的设备信息, 例如, 所述设备类号、 默认端点的最大包长度、 接口的 信息、 端口的信息等。 计算机根据解析得到的复合设备的真实的设备信息, 生成多个功能接口, 如调制 解调器 (Modem)接口、 控制 (AT)接口、 U盘接口等, 生成了多个逻辑通道供应用程序 与复合设备进行交互。 In a preferred embodiment of the present invention, the composite device responds to the acquiring descriptor command, and sends a preset single interface descriptor to a computer, where the computer determines, according to the obtained single interface descriptor, that the composite device is a single After the step of loading the preset custom driver, the method further includes: the composite device receiving a custom acquisition command sent by the computer; and the composite device transmitting the multi-interface descriptor to the computer in response to the received custom acquisition command, The computer parses the multi-interface descriptor and constructs a plurality of functional interfaces. The user-side technician can set the custom acquisition command, and set the corresponding protocol according to the custom acquisition command in the computer and the composite device. When the computer sends the custom acquisition command to the application layer of the composite device through the application layer, The composite device can immediately recognize and respond to the custom acquisition command through the application layer. This embodiment preferably customizes the command to obtain the USB standard format under the USB protocol. After the computer obtains the multi-interface descriptor, the descriptor is parsed, and the computer can obtain the real device information of the composite device by parsing, for example, the device class number, the maximum packet length of the default endpoint, the interface information, and the port. Information, etc. The computer generates a plurality of functional interfaces, such as a modem (Modem) interface, an control (AT) interface, and a USB flash drive interface, according to the real device information of the composite device obtained by the parsing, and generates a plurality of logical channel supply programs and a composite device. Interaction.
本发明一优选实施例中, 所述单接口描述符包括单接口设备描述符、 单接口配置 描述符, 所述单接口配置描述符包括预设的一个接口的接口描述符。 计算机通过获取单接口设备描述符, 可得到如制造商标识号、 产品序列号、 所述 设备类号、 默认端点的最大包长度和配置描述符的个数等信息。 计算机通过获取单接 口配置描述符可得到如配置描述符的长度、 供电方式、 最大耗电量等信息, 又由于单 接口配置描述符包括一个接口的接口描述符, 计算机可得到一个接口的具体信息, 因 此, 计算机根据该单接口描述符确定复合设备为单接口设备。 当然, 本发明并不限定单接口描述符包括字符串描述符、 端点描述符等。 本发明单接口描述符的形式为 USB标准描述符, 因此, 有利于计算机确定并读取 该单接口描述符。 In a preferred embodiment of the present invention, the single interface descriptor includes a single interface device descriptor and a single interface configuration descriptor, and the single interface configuration descriptor includes an interface descriptor of a preset one interface. By obtaining the single interface device descriptor, the computer can obtain information such as the manufacturer identification number, the product serial number, the device class number, the maximum packet length of the default endpoint, and the number of configuration descriptors. The computer obtains the information such as the length of the configuration descriptor, the power supply mode, and the maximum power consumption by obtaining the single interface configuration descriptor. The single interface configuration descriptor includes an interface descriptor of the interface, and the computer can obtain specific information of an interface. Therefore, the computer determines that the composite device is a single interface device according to the single interface descriptor. Of course, the present invention does not limit the single interface descriptor to include a string descriptor, an endpoint descriptor, and the like. The form of the single interface descriptor of the present invention is a USB standard descriptor, thus facilitating the computer to determine and read the single interface descriptor.
本发明一优选实施例中, 所述在计算机与复合设备建立连接后的步骤还包括: 复合设备根据所述多接口描述符加载自定义设备驱动。 自定义设备驱动是用户侧技术人员根据复合设备的多接口描述符设置的驱动程 序。 在计算机与复合设备建立连接后, 且复合设备上电之后, 复合设备根据多接口描 述符加载自定义设备驱动, 复合设备对自身进行驱动, 以供与计算机进行数据交互。 In a preferred embodiment of the present invention, the step of establishing a connection between the computer and the composite device further comprises: the composite device loading the customized device driver according to the multi-interface descriptor. A custom device driver is a driver that is set by the user-side technician based on the multi-interface descriptor of the composite device. After the computer establishes a connection with the composite device, and after the composite device is powered on, the composite device loads the custom device driver according to the multi-interface descriptor, and the composite device drives itself to perform data interaction with the computer.
本发明进一步提供一种计算机。 参照图 4, 图 4为本发明计算机第一实施例的功能模块示意图。 在计算机第一实施例中, 该计算机包括: 命令模块 10, 设置为在与建立连接后, 发送获取描述符命令至所述; 描述符模块 20, 设置为接收复合设备发送的预设的单接口描述符; 驱动模块 30, 设置为根据获取的所述单接口描述符, 确定所述复合设备为单接口 设备, 并加载预设的自定义驱动。 单接口描述符是复合设备预先设置并保存在复合设备中的。 单接口描述符并不体 现复合设备的真实设备信息, 单接口描述符的内容体现的是一个单一接口的设备的信 息, 相当于一个虚拟的描述符。 自定义驱动是根据单接口描述符预先设置的, 并安装到计算机的内核层中。 计算机和复合设备建立连接后, 计算机开始对复合设备进行枚举, 即获取复合设 备的一些信息, 根据这些信息, 为复合设备加载适合的驱动。 例如, 命令模块 10发送 获取描述符命令至复合设备, 复合设备接收到命令模块 10发送的获取描述符命令后, 并不将复合设备真实的复合描述符发送给描述符模块 20, 而是将预设的单接口描述符 发送至描述符模块 20。 驱动模块 30对获取的单接口描述符进行解析,由于单接口描述符只包含一个单一 接口的设备的信息, 因此, 驱动模块 30确定复合设备为单接口设备, 而并不能识别复 合设备的真实信息。 由于驱动模块 30确定复合设备为单接口设备, 因此,枚举的过程不需要使用复合 设备驱动, 可以直接根据单接口描述符找到自定义驱动, 并加载预设的自定义驱动, 如用总线驱动加载自定义驱动。 本实施例在计算机与复合设备建立连接后,命令模块 10发送获取描述符命令至复 合设备; 描述符模块 20接收复合设备发送的预设的单接口描述符; 驱动模块 30根据 获取的所述单接口描述符, 确定复合设备为单接口设备, 并加载预设的自定义驱动。 本实施例计算机在获取复合设备发送的单接口描述符后,确定复合设备为单接口设备, 因此在对复合设备进行枚举的过程中不启用复合设备驱动, 简化了计算机对复合设备 进行枚举的过程, 提高了枚举的效率。 另一方面, 本发明计算机不启用复合设备进行 枚举, 在对复合设备的设备驱动进行开发和维护时, 能降低出错率, 从而可解决复合 设备研发和生产的成本高、 效率低等问题。 The invention further provides a computer. Referring to FIG. 4, FIG. 4 is a schematic diagram of functional modules of a first embodiment of a computer according to the present invention. In a first embodiment of the computer, the computer includes: a command module 10 configured to send an acquire descriptor command to the after establishing a connection; The descriptor module 20 is configured to receive a preset single interface descriptor sent by the composite device, and the driving module 30 is configured to determine, according to the obtained single interface descriptor, that the composite device is a single interface device, and load the preset Custom drive. The single interface descriptor is pre-set by the composite device and stored in the composite device. The single interface descriptor does not reflect the real device information of the composite device. The content of the single interface descriptor reflects the information of a single interface device, which is equivalent to a virtual descriptor. Custom drivers are pre-configured based on a single interface descriptor and installed into the kernel layer of the computer. After the computer and the composite device establish a connection, the computer begins enumerating the composite device, that is, obtaining some information of the composite device, and according to the information, loading the appropriate device for the composite device. For example, the command module 10 sends a get descriptor command to the composite device. After receiving the get descriptor command sent by the command module 10, the composite device does not send the composite composite real descriptor to the descriptor module 20, but instead The set single interface descriptor is sent to the descriptor module 20. The driving module 30 parses the obtained single interface descriptor. Since the single interface descriptor only contains information of a single interface device, the driving module 30 determines that the composite device is a single interface device, and does not recognize the real information of the composite device. . Since the driver module 30 determines that the composite device is a single interface device, the enumeration process does not require the use of a composite device driver, and can directly find a custom driver according to the single interface descriptor, and load a preset custom driver, such as a bus driver. Load a custom driver. In this embodiment, after the computer establishes a connection with the composite device, the command module 10 sends an acquisition descriptor command to the composite device; the descriptor module 20 receives the preset single interface descriptor sent by the composite device; and the driving module 30 obtains the single The interface descriptor determines that the composite device is a single interface device and loads the preset custom driver. After obtaining the single interface descriptor sent by the composite device, the computer in the embodiment determines that the composite device is a single interface device, so the composite device driver is not enabled in the process of enumerating the composite device, which simplifies enumeration of the composite device by the computer. The process improves the efficiency of the enumeration. On the other hand, the computer of the present invention does not enable the enumeration of the composite device, and can reduce the error rate when developing and maintaining the device driver of the composite device, thereby solving the problems of high cost and low efficiency of the development and production of the composite device.
本领域技术人员可以理解的, 计算机还可以包括以下步骤: 判断模块 (图中未示 出), 设置为计算机判断复合设备的速度类型; 复位模块 (图中未示出), 设置为复位 复合设备; 通道模块(图中未示出), 设置为建立计算机和复合设备的信息通道; 默认 管道模块(图中未示出),设置为获取默认管道的最大包长度。这些步骤因为较为常规, 并不受本发明限制, 本领域技术人员可根据需要执行这些步骤中的一个或者多个。 As can be understood by those skilled in the art, the computer may further include the following steps: a judging module (not shown) configured to determine the speed type of the composite device by the computer; a reset module (not shown), set to reset Composite device; channel module (not shown), set to establish the information channel of the computer and composite device; default pipe module (not shown), set to get the maximum packet length of the default pipe. These steps are more conventional and are not limited by the present invention, and one skilled in the art can perform one or more of these steps as needed.
本发明一优选实施例中, 所述单接口描述符包括单接口设备描述符、 单接口配置 描述符, 所述单接口配置描述符包括预设的一个接口的接口描述符。 驱动模块 30通过获取单接口设备描述符,可得到复合设备如制造商标识号、产品 序列号、 所述设备类号、 默认端点的最大包长度和配置描述符的个数等信息。 驱动模 块 30通过获取单接口配置描述符可得到复合设备如配置描述符的长度、供电方式、最 大耗电量等信息, 又由于单接口配置描述符包括一个接口的接口描述符, 驱动模块 30 可得到复合设备一个接口的具体信息, 因此,驱动模块 30根据该单接口描述符确定复 合设备为单接口设备。 当然, 本发明并不限定单接口描述符包括字符串描述符、 端点描述符等。 本发明单接口描述符的形式为 USB标准描述符, 因此, 有利于驱动模块 30确定 并读取该单接口描述符。 In a preferred embodiment of the present invention, the single interface descriptor includes a single interface device descriptor and a single interface configuration descriptor, and the single interface configuration descriptor includes an interface descriptor of a preset one interface. The driver module 30 obtains information such as the manufacturer identification number, the product serial number, the device class number, the maximum packet length of the default endpoint, and the number of configuration descriptors by acquiring the single interface device descriptor. The driving module 30 obtains the information of the length of the composite device, the power supply mode, the maximum power consumption, and the like by acquiring the single interface configuration descriptor, and the single module interface descriptor includes an interface descriptor of the interface, and the driving module 30 can The specific information of one interface of the composite device is obtained. Therefore, the driving module 30 determines that the composite device is a single interface device according to the single interface descriptor. Of course, the present invention does not limit the single interface descriptor to include a string descriptor, an endpoint descriptor, and the like. The form of the single interface descriptor of the present invention is a USB standard descriptor, thus facilitating the drive module 30 to determine and read the single interface descriptor.
参照图 5, 图 5为本发明计算机第二实施例的功能模块示意图。 本发明计算机第二实施例中, 本实施例相较于第一实施例的区别在于, 本实施例 在第一实施例的基础上, 所述计算机还包括: 获取模块 40, 设置为从所述复合设备获取多接口描述符; 构建模块 50, 设置为解析获取的所述多接口描述符, 构建多个功能接口。 获取模块 40从复合设备获取多接口描述符,例如,计算机发送获取指令至复合设 备, 复合设备响应该获取指令, 将多接口描述符发送至获取模块 40; 或者, 获取模块 40可以通过一些应用程序从复合设备获取多接口描述符; 或者, 其他适合的方式获取 多接口描述符。 获取模块 40获取多接口描述符之后, 构建模块 50对该描述符进行解析, 通过解 析, 构建模块 50就能获得复合设备真实的设备信息, 例如, 所述设备类号、 默认端点 的最大包长度、 接口的信息、 端口的信息等。 构建模块 50根据解析得到的复合设备的真实的设备信息, 生成多个功能接口,如 调制解调器 (Modem)接口、 控制 (AT)接口、 U盘接口等, 生成了多个逻辑通道供应用 程序与复合设备进行交互。 Referring to FIG. 5, FIG. 5 is a schematic diagram of functional modules of a second embodiment of a computer according to the present invention. In the second embodiment of the computer of the present invention, the difference between the embodiment and the first embodiment is that, in addition to the first embodiment, the computer further includes: an acquiring module 40, configured to The composite device acquires a multi-interface descriptor; the building module 50 is configured to parse the obtained multi-interface descriptor to construct a plurality of functional interfaces. The obtaining module 40 acquires a multi-interface descriptor from the composite device, for example, the computer sends a fetch instruction to the composite device, and the composite device sends the multi-interface descriptor to the obtaining module 40 in response to the fetching instruction; or the obtaining module 40 can pass some applications. Obtain a multi-interface descriptor from a composite device; or, in other suitable ways, obtain a multi-interface descriptor. After the obtaining module 40 obtains the multi-interface descriptor, the building module 50 parses the descriptor, and by parsing, the building module 50 can obtain the real device information of the composite device, for example, the device class number and the maximum packet length of the default endpoint. , interface information, port information, etc. The building module 50 generates a plurality of functional interfaces, such as a modem (Modem) interface, an control (AT) interface, and a U disk interface, according to the real device information of the synthesized composite device, and generates a plurality of logical channel supply programs and composites. The device interacts.
在本发明一优选实施例中。 所述获取模块 40还包括: 获取单元(图中未示出),设置为通过应用层发送自定义获取命令至复合设备的应 用层; 接收单元(图中未示出),设置为通过应用层接收所述复合设备的应用层响应所述 自定义获取命令而发送的多接口描述符。 计算机包括应用层和内核层, 复合设备包括应用层和内核层。 用户侧的技术人员可以对自定义获取命令进行设定, 且在计算机的应用层和复合 设备的应用层中根据自定义获取命令设置相应的协议, 获取单元通过应用层发送自定 义获取命令至复合设备的应用层中时, 复合设备通过应用层能立即识别且响应该自定 义获取命令。 本实施例优选自定义获取命令为 USB协议下的 USB标准格式的命令。 计算机从复合设备获取多接口描述符的步骤在计算机的应用层中进行, 因不需涉 及计算机的内核层, 用户侧的技术人员可更方便快捷的对自定义获取命令、 多接口描 述符进行调试或者设置, 且成本较低。 In a preferred embodiment of the invention. The obtaining module 40 further includes: an obtaining unit (not shown) configured to send a custom obtaining command to the application layer of the composite device through the application layer; a receiving unit (not shown) configured to pass the application layer Receiving a multi-interface descriptor sent by an application layer of the composite device in response to the custom acquisition command. The computer includes an application layer and a kernel layer, and the composite device includes an application layer and a kernel layer. The user-side technician can set the custom acquisition command, and set the corresponding protocol according to the custom acquisition command in the application layer of the computer and the application layer of the composite device, and the acquisition unit sends the custom acquisition command to the composite through the application layer. When in the application layer of the device, the composite device can immediately recognize and respond to the custom acquisition command through the application layer. This embodiment preferably customizes the command to obtain the USB standard format under the USB protocol. The step of the computer acquiring the multi-interface descriptor from the composite device is performed in the application layer of the computer. Since the kernel layer of the computer is not involved, the user-side technician can more conveniently and quickly debug the custom acquisition command and the multi-interface descriptor. Or set, and the cost is lower.
参照图 6, 图 6为图 5计算机中构建模块 50的功能单元示意图。 在本发明一优选实施例中, 所述构建模块 50包括: 构建单元 51, 设置为通过应用层解析获取的所述多接口描述符, 构建多个所述功 能接口; 生成单元 52, 设置为通过应用层根据构建的多个所述功能接口, 生成多个子设备 或者多个操作句柄。 构建单元 51通过应用层解析获取的所述多接口描述符, 构建多个所述功能接口, 且生成单元 52根据构建的多个所述功能接口, 生成多个子设备,供应用程序通过打开 子设备与复合设备进行数据交互; 或者, 生成多个文件操作句柄, 供应用程序直接调 用文件操作句柄与复合设备进行数据交互。 本实施例生成多个子设备或者多个操作句柄, 方便了应用程序通过子设备或者多 个操作句柄与复合设备进行数据交互。 本实施例将生成多个功能接口等复杂操作在计算机的应用层执行, 而不需要计算 机的内核层执行, 因此, 使得计算机对复合设备的驱动更加可控, 且更方便调试, 成 本更低。 Referring to FIG. 6, FIG. 6 is a schematic diagram of functional units of the building module 50 in the computer of FIG. 5. In a preferred embodiment of the present invention, the building module 50 includes: a building unit 51, configured to parse the multi-interface descriptor obtained by the application layer to construct a plurality of the function interfaces; and the generating unit 52 is configured to pass The application layer generates a plurality of child devices or a plurality of operation handles according to the plurality of the functional interfaces constructed. The constructing unit 51 constructs a plurality of the functional interfaces by using the multi-interface descriptor obtained by the application layer parsing, and the generating unit 52 generates a plurality of sub-devices according to the plurality of the functional interfaces that are constructed, and the supplying program opens the sub-devices. Data interaction with the composite device; or, generate multiple file operation handles, the application directly calls the file operation handle to interact with the composite device for data interaction. In this embodiment, multiple sub-devices or multiple operation handles are generated, which facilitates data interaction between the application and the composite device through the sub-device or multiple operation handles. In this embodiment, complex operations such as generating multiple functional interfaces are performed at the application layer of the computer, and the kernel layer of the computer is not required to be executed. Therefore, the driving of the composite device is more controllable, and the debugging is more convenient, and the cost is lower.
本发明进一步提供一种复合设备。 参照图 7, 图 7为本发明复合设备第一实施例的功能模块示意图。 在本发明复合设备第一实施例中, 该复合设备包括: 第一接收模块 01, 设置为接收计算机发送的获取描述符命令至复合设备; 第一发送模块 02, 设置为响应所述获取描述符命令, 并将预设的单接口描述符发 送至计算机, 供计算机根据获取的所述单接口描述符, 确定复合设备为单接口设备, 并加载预设的自定义驱动。 单接口描述符是预先设置并保存在复合设备中的。 单接口描述符并不体现复合设 备的真实设备信息, 单接口描述符的内容体现的是一个单一接口的设备的信息, 相当 于一个虚拟的描述符。 自定义驱动是根据单接口描述符预先设置的, 并安装到计算机的内核层中。 计算机和复合设备建立连接后, 计算机开始对复合设备进行枚举, 即获取复合设 备的一些信息, 根据这些信息, 为复合设备加载适合的驱动。 计算机发送获取描述符 命令至复合设备。第一接收模块 01接收计算机发送的获取描述符命令,第一发送模块 02响应所述获取描述符命令, 并将预设的单接口描述符发送至计算机, 供计算机根据 获取的所述单接口描述符, 确定复合设备为单接口设备, 并加载预设的自定义驱动。 例如, 计算机发送获取描述符命令至复合设备,第一接收模块 01接收到计算机发 送的获取描述符命令后,第一发送模块 02并不将复合设备真实的复合描述符发送给计 算机, 而是将预设的单接口描述符发送至计算机。 计算机对获取的单接口描述符进行解析, 由于单接口描述符只包含一个单一接口 的设备的信息, 因此, 计算机确定复合设备为单接口设备, 而并不能识别复合设备的 真实信息。 由于计算机确定复合设备为单接口设备, 因此, 枚举的过程不需要使用复合设备 驱动, 可以直接根据单接口描述符找到自定义驱动, 并加载预设的自定义驱动, 如用 总线驱动加载自定义驱动。 本实施例第一接收模块 01接收计算机发送的获取描述符命令至复合设备;第一发 送模块 02响应所述获取描述符命令, 并将预设的单接口描述符发送至计算机,供计算 机根据获取的所述单接口描述符, 确定复合设备为单接口设备, 并加载预设的自定义 驱动。本实施例第一发送模块 02发送单接口描述符至计算机,计算机根据单接口描述 符确定复合设备为单接口设备, 因此计算机在对复合设备进行枚举的过程中不启用复 合设备驱动, 简化了计算机对复合设备进行枚举的过程, 提高了枚举的效率。 另一方 面, 本发明计算机不启用复合设备进行枚举, 在对复合设备的设备驱动进行开发和维 护时, 能降低出错率, 从而可解决复合设备研发和生产的成本高、 效率低等问题。 The invention further provides a composite device. Referring to FIG. 7, FIG. 7 is a schematic diagram of functional modules of a first embodiment of a composite device according to the present invention. In the first embodiment of the composite device of the present invention, the composite device includes: a first receiving module 01 configured to receive an acquisition descriptor command sent by the computer to the composite device; and a first sending module 02 configured to respond to the obtaining descriptor The command sends the preset single interface descriptor to the computer, and the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads the preset custom driver. Single interface descriptors are pre-set and saved in the composite device. The single interface descriptor does not reflect the real device information of the composite device. The content of the single interface descriptor reflects the information of a single interface device, which is equivalent to a virtual descriptor. Custom drivers are pre-configured based on a single interface descriptor and installed into the kernel layer of the computer. After the computer and the composite device establish a connection, the computer begins enumerating the composite device, that is, obtaining some information of the composite device, and according to the information, loading the appropriate device for the composite device. The computer sends a Get Descriptor command to the composite device. The first receiving module 01 receives the acquisition descriptor command sent by the computer, and the first sending module 02 responds to the acquiring descriptor command, and sends the preset single interface descriptor to the computer, and the computer describes the single interface according to the obtained , determines that the composite device is a single interface device, and loads the preset custom driver. For example, the computer sends a get descriptor command to the composite device. After the first receiving module 01 receives the get descriptor command sent by the computer, the first sending module 02 does not send the composite composite real descriptor to the computer, but instead A preset single interface descriptor is sent to the computer. The computer parses the obtained single interface descriptor. Since the single interface descriptor contains only information about a single interface device, the computer determines that the composite device is a single interface device and does not recognize the real information of the composite device. Since the computer determines that the composite device is a single interface device, the enumeration process does not require the use of a composite device driver, and can directly find a custom driver according to the single interface descriptor, and load a preset custom driver, such as loading with a bus driver. Define the driver. In this embodiment, the first receiving module 01 receives the acquisition descriptor command sent by the computer to the composite device; the first sending module 02 responds to the acquiring descriptor command, and sends the preset single interface descriptor to the computer for obtaining by the computer according to the acquisition. The single interface descriptor determines that the composite device is a single interface device and loads a preset custom driver. In this embodiment, the first sending module 02 sends a single interface descriptor to the computer, and the computer determines that the composite device is a single interface device according to the single interface descriptor, so the computer does not enable the composite device driver during the enumeration of the composite device, which simplifies The process of enumerating a composite device by a computer improves the efficiency of enumeration. On the other hand, the computer of the present invention does not enable the enumeration of the composite device, and can reduce the error rate when developing and maintaining the device driver of the composite device, thereby solving the problems of high cost and low efficiency of the development and production of the composite device.
参照图 8, 图 8为本发明复合设备一优选实施例的功能模块示意图 本发明一优选实施例中, 所述复合设备还包括: 第二接收模块 03, 设置为接收计算机发送的自定义获取命令; 第二发送模块 04, 设置为响应接收的所述自定义获取命令, 发送所述多接口描述 符至计算机, 供计算机解析所述多接口描述符, 并构建多个功能接口。 用户侧的技术人员可以对自定义获取命令进行设定, 且在计算机和复合设备中根 据自定义获取命令设置相应的协议, 计算机通过应用层发送自定义获取命令至复合设 备的应用层中时, 复合设备通过应用层能立即识别且响应该自定义获取命令。 本实施 例优选自定义获取命令为 USB协议下的 USB标准格式的命令。 计算机获取多接口描述符之后, 对该描述符进行解析, 通过解析, 计算机就能获 得复合设备真实的设备信息, 例如, 所述设备类号、 默认端点的最大包长度、 接口的 信息、 端口的信息等。 计算机根据解析得到的复合设备的真实的设备信息, 生成多个功能接口, 如调制 解调器 (Modem)接口、 控制 (AT)接口、 U盘接口等, 生成了多个逻辑通道供应用程序 与复合设备进行交互。 Referring to FIG. 8, FIG. 8 is a schematic diagram of a functional module of a preferred embodiment of the composite device according to the present invention. In a preferred embodiment of the present invention, the composite device further includes: a second receiving module 03, configured to receive a custom acquisition command sent by the computer. The second sending module 04 is configured to send the multi-interface descriptor to the computer in response to the received custom acquisition command, for the computer to parse the multi-interface descriptor, and construct a plurality of functional interfaces. The user-side technician can set the custom acquisition command, and set the corresponding protocol according to the custom acquisition command in the computer and the composite device. When the computer sends the custom acquisition command to the application layer of the composite device through the application layer, The composite device can immediately recognize and respond to the custom acquisition command through the application layer. This embodiment preferably customizes the command to obtain the USB standard format under the USB protocol. After the computer obtains the multi-interface descriptor, the descriptor is parsed, and the computer can obtain the real device information of the composite device by parsing, for example, the device class number, the maximum packet length of the default endpoint, the interface information, and the port. Information, etc. The computer generates a plurality of functional interfaces, such as a modem (Modem) interface, an control (AT) interface, and a USB flash drive interface, according to the real device information of the composite device obtained by the parsing, and generates a plurality of logical channel supply programs and a composite device. Interaction.
本发明一优选实施例中, 所述单接口描述符包括单接口设备描述符、 单接口配置 描述符, 所述单接口配置描述符包括预设的一个接口的接口描述符。 计算机通过获取单接口设备描述符, 可得到如制造商标识号、 产品序列号、 所述 设备类号、 默认端点的最大包长度和配置描述符的个数等信息。 计算机通过获取单接 口配置描述符可得到如配置描述符的长度、 供电方式、 最大耗电量等信息, 又由于单 接口配置描述符包括一个接口的接口描述符, 计算机可得到一个接口的具体信息, 因 此, 计算机根据该单接口描述符确定复合设备为单接口设备。 当然, 本发明并不限定单接口描述符包括字符串描述符、 端点描述符等。 本发明单接口描述符的形式为 USB标准描述符, 因此, 有利于计算机确定并读取 该单接口描述符。 In a preferred embodiment of the present invention, the single interface descriptor includes a single interface device descriptor and a single interface configuration descriptor, and the single interface configuration descriptor includes an interface descriptor of a preset one interface. By obtaining the single interface device descriptor, the computer can obtain information such as the manufacturer identification number, the product serial number, the device class number, the maximum packet length of the default endpoint, and the number of configuration descriptors. The computer obtains the information such as the length of the configuration descriptor, the power supply mode, and the maximum power consumption by obtaining the single interface configuration descriptor. The single interface configuration descriptor includes an interface descriptor of the interface, and the computer can obtain specific information of an interface. Therefore, the computer determines that the composite device is a single interface device according to the single interface descriptor. Of course, the present invention does not limit the single interface descriptor to include a string descriptor, an endpoint descriptor, and the like. The form of the single interface descriptor of the present invention is a USB standard descriptor, thus facilitating the computer to determine and read the single interface descriptor.
本发明一优选实施例中, 所述复合设备还包括: 加载驱动模块(图中未示出),设置为根据所述多接口描述符加载自定义设备驱动。 自定义设备驱动是用户侧技术人员根据复合设备的多接口描述符设置的驱动程 序。 在计算机与复合设备建立连接后, 且复合设备上电之后, 加载驱动模块根据多接 口描述符加载自定义设备驱动, 复合设备对自身进行驱动, 以供与计算机进行数据交 互。 以上仅为本发明的优选实施例, 并非因此限制本发明的专利范围, 凡是利用本发 明说明书及附图内容所作的等效结构或等效流程变换, 或直接或间接运用在其他相关 的技术领域, 均同理包括在本发明的专利保护范围内。 工业实用性 如上所述, 本发明实施例提供的一种通用串行总线的驱动方法、 计算机及复合设 备具有以下有益效果: 简化了计算机对复合设备进行枚举的过程,提高了枚举的效率。 另一方面, 本发明计算机不启用复合设备进行枚举, 在对复合设备的设备驱动进行开 发和维护时, 能降低出错率, 从而可解决复合设备研发和生产的成本高、 效率低等问 题。 In a preferred embodiment of the present invention, the composite device further includes: a load driving module (not shown) configured to load a custom device driver according to the multi-interface descriptor. The custom device driver is a driver set by the user-side technician based on the multi-interface descriptor of the composite device. After the computer establishes a connection with the composite device, and after the composite device is powered on, the load driver module loads the custom device driver according to the multi-interface descriptor, and the composite device drives itself to perform data interaction with the computer. The above are only the preferred embodiments of the present invention, and are not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the description of the present invention and the drawings are used directly or indirectly in other related technical fields. The same is included in the scope of patent protection of the present invention. INDUSTRIAL APPLICABILITY As described above, a universal serial bus driving method, a computer, and a composite device provided by the embodiments of the present invention have the following beneficial effects: The process of enumerating a composite device by a computer is simplified, and the efficiency of enumeration is improved. . On the other hand, the computer of the present invention does not enable the enumeration of the composite device, and can reduce the error rate when developing and maintaining the device driver of the composite device, thereby solving the problems of high cost and low efficiency of the development and production of the composite device.

Claims

权 利 要 求 书 、 一种通用串行总线的驱动方法, 应用于计算机, 包括以下步骤: 在计算机与复合设备建立连接后,计算机发送获取描述符命令至复合设备; 计算机接收复合设备发送的预设的单接口描述符; The invention relates to a method for driving a universal serial bus, which is applied to a computer, comprising the following steps: after a connection is established between a computer and a composite device, the computer sends a descriptor command to the composite device; and the computer receives the preset sent by the composite device. Single interface descriptor
计算机根据获取的所述单接口描述符, 确定复合设备为单接口设备, 并加 载预设的自定义驱动。 、 如权利要求 1所述的通用串行总线的驱动方法, 其中, 所述计算机根据获取的 所述单接口描述符, 确定复合设备为单接口设备, 并加载预设的自定义驱动步 骤之后包括: 计算机从复合设备获取多接口描述符;  The computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads a preset custom driver. The universal serial bus driving method according to claim 1, wherein the computer determines that the composite device is a single interface device according to the obtained single interface descriptor, and loads the preset custom driving step, and then includes : The computer obtains a multi-interface descriptor from the composite device;
计算机解析获取的所述多接口描述符, 构建多个功能接口。 、 如权利要求 2所述的通用串行总线的驱动方法, 其中, 所述计算机解析获取的 所述多接口描述符, 构建多个功能接口的步骤包括:  The computer parses the obtained multi-interface descriptor to construct a plurality of functional interfaces. The method of driving a universal serial bus according to claim 2, wherein the step of the computer parsing the acquired multi-interface descriptor to construct a plurality of functional interfaces comprises:
计算机通过应用层解析获取的所述多接口描述符,构建多个所述功能接口; 计算机通过应用层根据构建的多个所述功能接口, 生成多个子设备或者多 个操作句柄。 、 一种通用串行总线的驱动方法, 应用于复合设备, 包括以下步骤:  The computer constructs a plurality of the functional interfaces by parsing the obtained multi-interface descriptors by the application layer; the computer generates a plurality of sub-devices or a plurality of operation handles according to the plurality of the functional interfaces that are built by the application layer. A universal serial bus driving method for a composite device includes the following steps:
复合设备接收计算机发送的获取描述符命令至复合设备; 复合设备响应所述获取描述符命令, 并将预设的单接口描述符发送至计算 机, 供计算机根据获取的所述单接口描述符, 确定复合设备为单接口设备, 并 加载预设的自定义驱动。 、 如权利要求 4所述的通用串行总线的驱动方法, 其中, 所述复合设备响应所述 获取描述符命令, 并将预设的单接口描述符发送至计算机, 供计算机根据获取 的所述单接口描述符, 确定复合设备为单接口设备, 并加载预设的自定义驱动 的步骤之后还包括:  The composite device receives the acquisition descriptor command sent by the computer to the composite device; the composite device responds to the acquisition descriptor command, and sends the preset single interface descriptor to the computer, and the computer determines, according to the obtained single interface descriptor, The composite device is a single interface device and loads a preset custom drive. The method of driving a universal serial bus according to claim 4, wherein the composite device responds to the acquisition descriptor command and sends a preset single interface descriptor to a computer for the computer to obtain according to the acquired The single interface descriptor, after determining that the composite device is a single interface device, and loading the preset custom driver, further includes:
复合设备接收计算机发送的自定义获取命令; 复合设备响应接收的所述自定义获取命令, 发送所述多接口描述符至计算 机, 供计算机解析所述多接口描述符, 并构建多个功能接口。 、 一种计算机, 包括: The composite device receives a custom acquisition command sent by the computer; The composite device sends the multi-interface descriptor to the computer in response to the received custom acquisition command, for the computer to parse the multi-interface descriptor, and construct a plurality of functional interfaces. , a computer, comprising:
命令模块, 设置为在与复合设备建立连接后, 发送获取描述符命令至所述 复合设备;  a command module, configured to send a get descriptor command to the composite device after establishing a connection with the composite device;
描述符模块, 设置为接收复合设备发送的预设的单接口描述符; 驱动模块, 设置为根据获取的所述单接口描述符, 确定所述复合设备为单 接口设备, 并加载预设的自定义驱动。 、 如权利要求 6所述的计算机, 其中, 所述计算机还包括: 获取模块, 设置为从所述复合设备获取多接口描述符;  a descriptor module, configured to receive a preset single interface descriptor sent by the composite device; the driving module is configured to determine, according to the obtained single interface descriptor, that the composite device is a single interface device, and load the preset self Define the driver. The computer according to claim 6, wherein the computer further comprises: an obtaining module, configured to acquire a multi-interface descriptor from the composite device;
构建模块, 设置为解析获取的所述多接口描述符, 构建多个功能接口。 、 如权利要求 7所述的计算机, 其中, 所述构建模块包括:  The building module is configured to parse the obtained multi-interface descriptor and construct a plurality of functional interfaces. The computer of claim 7, wherein the building module comprises:
构建单元, 设置为通过应用层解析获取的所述多接口描述符, 构建多个所 述功能接口;  a building unit, configured to construct a plurality of the functional interfaces by using the multi-interface descriptor obtained by the application layer parsing;
生成单元, 设置为通过应用层根据构建的多个所述功能接口, 生成多个子 设备或者多个操作句柄。 、 一种复合设备, 包括: 第一接收模块, 设置为接收计算机发送的获取描述符命令至复合设备; 第一发送模块, 设置为响应所述获取描述符命令, 并将预设的单接口描述 符发送至计算机, 供计算机根据获取的所述单接口描述符, 确定复合设备为单 接口设备, 并加载预设的自定义驱动。 0、 如权利要求 9所述的复合设备, 其中, 所述复合设备还包括: 第二接收模块, 设置为接收计算机发送的自定义获取命令;  And generating a unit, configured to generate, by the application layer, a plurality of sub-devices or a plurality of operation handles according to the plurality of the functional interfaces constructed. a composite device, comprising: a first receiving module, configured to receive an acquisition descriptor command sent by a computer to a composite device; a first sending module, configured to respond to the acquiring descriptor command, and to describe a preset single interface The symbol is sent to the computer, and the computer determines, according to the obtained single interface descriptor, that the composite device is a single interface device, and loads the preset custom driver. The composite device of claim 9, wherein the composite device further comprises: a second receiving module, configured to receive a custom acquisition command sent by the computer;
第二发送模块, 设置为响应接收的所述自定义获取命令, 发送所述多接口 描述符至计算机, 供计算机解析所述多接口描述符, 并构建多个功能接口。  And a second sending module, configured to send the multi-interface descriptor to the computer in response to the received custom acquisition command, for the computer to parse the multi-interface descriptor, and construct a plurality of functional interfaces.
PCT/CN2014/082091 2014-05-23 2014-07-11 Universal serial bus drive method, computer and composite device WO2015176366A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410222394.5 2014-05-23
CN201410222394.5A CN105094880A (en) 2014-05-23 2014-05-23 USB driving method, computer and compound equipment

Publications (1)

Publication Number Publication Date
WO2015176366A1 true WO2015176366A1 (en) 2015-11-26

Family

ID=54553282

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/082091 WO2015176366A1 (en) 2014-05-23 2014-07-11 Universal serial bus drive method, computer and composite device

Country Status (2)

Country Link
CN (1) CN105094880A (en)
WO (1) WO2015176366A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294237A (en) * 2015-05-12 2017-01-04 中兴通讯股份有限公司 A kind of multiplexing functions method and device of communication interface
CN105868132B (en) * 2016-04-29 2019-01-11 优利德科技(中国)股份有限公司 A kind of Digital Oscillograph Module functions expanding method and system based on usb communication
CN108337209B (en) * 2017-01-19 2021-05-04 深圳兆日科技股份有限公司 Security authentication method and device and corresponding mobile terminal
CN108366131B (en) * 2018-03-13 2020-10-02 广州视源电子科技股份有限公司 Data transmission method, device, terminal and storage medium
CN109144795A (en) * 2018-07-23 2019-01-04 索尔思光电(成都)有限公司 A kind of optical module evaluation board and its recognition methods

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101071402A (en) * 2007-06-21 2007-11-14 北京中星微电子有限公司 Method and system for realizing normal working of compound device
CN101853142A (en) * 2010-05-05 2010-10-06 四川九洲电器集团有限责任公司 Identification method of USB device with virtual drive
US20140143459A1 (en) * 2012-11-21 2014-05-22 Samsung Electronics Co., Ltd. Mobile device and usb hub

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398792B (en) * 2007-09-28 2011-08-24 联想(北京)有限公司 Method and device for implementing application of interface functional equipment
EP2348404A1 (en) * 2009-12-29 2011-07-27 Gemalto SA Naming of peripheral devices connected to a computer system bus
CN101872334A (en) * 2010-05-26 2010-10-27 北京飞天诚信科技有限公司 Compound type usb equipment and implementation method thereof
CN102339265B (en) * 2011-10-17 2017-08-11 中兴通讯股份有限公司 A kind of wireless communication terminal and its driving method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101071402A (en) * 2007-06-21 2007-11-14 北京中星微电子有限公司 Method and system for realizing normal working of compound device
CN101853142A (en) * 2010-05-05 2010-10-06 四川九洲电器集团有限责任公司 Identification method of USB device with virtual drive
US20140143459A1 (en) * 2012-11-21 2014-05-22 Samsung Electronics Co., Ltd. Mobile device and usb hub

Also Published As

Publication number Publication date
CN105094880A (en) 2015-11-25

Similar Documents

Publication Publication Date Title
WO2015176366A1 (en) Universal serial bus drive method, computer and composite device
JP3138119U (en) Remote start control device
KR101906823B1 (en) Multi-module compilation system, multi-module compilation method, and non-transitory computer-readable storage medium
US8898349B1 (en) IPMI over USB data transfer between host computer and baseboard management controller (BMC)
TWI381310B (en) Method and system for enabling a mini program on a computing device to access an auxiliary system
WO2012027983A1 (en) Software operation recording and playback method oriented toward android and derivative system thereof
US9256569B2 (en) Monitoring and managing storage drives and performing backplane controller firmware using a USB interface
US9201833B2 (en) Backplane controller capable of transferring and receiving data through USB interface
KR20110098974A (en) System, apparatus, and method for fast startup of usb devices
CN107943722A (en) It is a kind of that the method and system for passing screen are realized based on USB device
US20110276625A1 (en) Method and system for host independent keyboard, video, and mouse (kvm) redirection
KR20170104306A (en) Module system, module based robot system, and update method for module system
JP2016024811A (en) Out-of-band acquisition of network interface controller information
WO2016058427A1 (en) Usb wireless network card configuration method, host, usb wireless network card and communication system
CN105094877A (en) Method for firmware upgrading, and host side device and system
CN103488513A (en) Universal driving method for plug and play of device
KR20150128256A (en) Server system having virtual android apparatus for interworking between application and real smart device
JP6195465B2 (en) Remote card content management using synchronous server-side scripting
CN107526681B (en) Robot test system and test method
WO2012079401A1 (en) Virtual serial port system and communication method therefor
WO2012100518A1 (en) Method and device for initiating wireless communication terminal
CN114217990A (en) Distributed hardware remote communication system based on UDP protocol and control method thereof
WO2014000299A1 (en) Serial port redirection processing method, device, and system
WO2015131553A1 (en) Data transmission method and system
CN114691223B (en) Method and device for transmitting BIOS logs through network

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14892468

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14892468

Country of ref document: EP

Kind code of ref document: A1