WO2024093542A1 - Usb drive-free communication method and apparatus, and electronic device and storage medium - Google Patents

Usb drive-free communication method and apparatus, and electronic device and storage medium Download PDF

Info

Publication number
WO2024093542A1
WO2024093542A1 PCT/CN2023/118583 CN2023118583W WO2024093542A1 WO 2024093542 A1 WO2024093542 A1 WO 2024093542A1 CN 2023118583 W CN2023118583 W CN 2023118583W WO 2024093542 A1 WO2024093542 A1 WO 2024093542A1
Authority
WO
WIPO (PCT)
Prior art keywords
usb
driver
usbfs
usb device
character
Prior art date
Application number
PCT/CN2023/118583
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 WO2024093542A1 publication Critical patent/WO2024093542A1/en

Links

Classifications

    • 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/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • 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/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present invention relates to the technical field of USB device data transmission, and in particular to a USB driver-free communication method, device, electronic equipment and storage medium.
  • Wireless communication modules are widely used in PCs, tablets, industrial gateways and other products with the help of operators' cellular communication networks, providing a wireless bridge for the interconnection of all things for consumer, industrial and other electronic terminal products.
  • wireless communication modules want to achieve LOG capture or upgrade functions in an embedded Linux host environment through a USB port
  • existing chip solution providers generally provide manufacturers' unique drivers that need to be installed.
  • embedded Linux systems cannot complete the integration of drivers from various manufacturers, resulting in limited module applications.
  • the embodiments of the present application provide a USB driver-free communication method, device, electronic device and storage medium, which can enable USB devices to directly use the universal usbfs driver in the kernel for data communication without relying on the manufacturer's specific driver.
  • an embodiment of the present application provides a USB driver-free communication method, the method specifically comprising:
  • the major device number and minor device number of the USB device created in the host device determine the major device number and minor device number of the USB device created in the host device
  • enumerating the inserted USB device to obtain enumeration information of the USB device includes:
  • a match is performed in the preset path directory to obtain the enumeration information of the USB device.
  • creating a character device according to a major device number and a minor device number includes:
  • the method before binding the USB device to the usbfs driver through the character device, the method further includes:
  • communicating with a USB device through a usbfs driver includes:
  • the read thread is bound to the endpoint of the input direction, so as to obtain the data in the USB device by reading the endpoint of the input direction in a blocking manner through the read thread.
  • communicating with a USB device through a usbfs driver also includes:
  • the write thread is bound to the endpoint in the output direction, so as to write data to the endpoint in the output direction through the write thread and write data to the USB device.
  • writing data to an endpoint in an output direction through a write thread includes:
  • an embodiment of the present application provides a USB driver-free communication device, which specifically includes:
  • the enumeration module is used to enumerate the inserted USB devices and obtain the enumeration information of the USB devices;
  • the analysis module is used to determine the major device number and the minor device number created by the USB device in the host device according to the enumeration information;
  • the communication module is used to create a character device according to the major device number and the minor device number, and bind the USB device to the usbfs driver through the character device, wherein the usbfs driver is pre-configured in the kernel of the host device, and communicates with the USB device through the usbfs driver.
  • an embodiment of the present application provides an electronic device, comprising: a processor, the processor is connected to a memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs the method of the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program enables a computer to execute the method of the first aspect.
  • an embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and is computer-operable to cause the computer to execute the method of the first aspect.
  • the enumeration information of the USB device is used to determine the primary and secondary device numbers created by the USB device in the system, and then the corresponding character device is created according to the primary and secondary device numbers. Then, the IOCTL command is executed through the character device to bind the USB device to the usbfs driver that comes with the kernel. Then, the USB device can directly use the universal usbfs driver in the kernel for data communication without relying on the manufacturer's unique driver.
  • FIG1 is a schematic diagram of the hardware structure of a USB driver-free communication device provided in an embodiment of the present application.
  • FIG2 is a flow chart of a USB driver-free communication method provided in an embodiment of the present application.
  • FIG3 is a block diagram of the functional modules of a USB driver-free communication device provided in an embodiment of the present application.
  • FIG. 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
  • FIG1 is a hardware structure diagram of a USB driver-free communication device provided in an embodiment of the present application.
  • the USB driver-free communication device 100 includes at least one processor 101 , a communication line 102 , a memory 103 and at least one communication interface 104 .
  • the processor 101 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
  • CPU central processing unit
  • ASIC application-specific integrated circuit
  • the communication link 102 may include a path to transmit information between the above components.
  • the communication interface 104 can be any transceiver-like device (such as an antenna, etc.) used to communicate with other devices or communication networks, such as Ethernet, RAN, wireless local area networks (WLAN), etc.
  • transceiver-like device such as an antenna, etc.
  • WLAN wireless local area networks
  • the memory 103 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
  • ROM read-only memory
  • RAM random access memory
  • EEPROM electrically erasable programmable read-only memory
  • CD-ROM compact disc read-only memory
  • optical disc storage including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.
  • magnetic disk storage medium or other magnetic storage device or any other
  • the memory 103 can exist independently and be connected to the processor 101 via the communication line 102.
  • the memory 103 can also be integrated with the processor 101.
  • the memory 103 provided in the embodiment of the present application can generally be non-volatile.
  • the memory 103 is used to store computer-executable instructions for executing the scheme of the present application, and the execution is controlled by the processor 101.
  • the processor 101 is used to execute the computer-executable instructions stored in the memory 103, thereby realizing the method provided in the following embodiment of the present application.
  • the computer-executable instructions may also be referred to as application code, which is not specifically limited in this application.
  • the processor 101 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 1 .
  • the USB driver-free communication device 100 may include multiple processors, such as the processor 101 and the processor 107 in FIG. 1 .
  • Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
  • the processor here may refer to one or more devices, circuits, and/or A processing core that processes data (such as computer program instructions).
  • the USB driver-free communication device 100 is a server, for example, it can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
  • the USB driver-free communication device 100 can also include an output device 105 and an input device 106.
  • the output device 105 communicates with the processor 101 and can display information in a variety of ways.
  • the output device 105 can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector.
  • the input device 106 communicates with the processor 101 and can receive user input in a variety of ways.
  • the input device 106 can be a mouse, a keyboard, a touch screen device, or a sensor device.
  • the USB driver-free communication device 100 can be a general device or a dedicated device.
  • the embodiment of the present application does not limit the type of the USB driver-free communication device 100.
  • FIG. 2 is a flow chart of a USB driver-free communication method provided in an embodiment of the present application, which may specifically include the following steps:
  • the so-called enumeration is to let the host controller recognize the USB device, prepare resources for it, and establish a data transfer mechanism between the host and the device.
  • the work in this stage is stipulated by the USB communication protocol, so it belongs to the ISO standard process.
  • the device enumeration stage also corresponds to the five states of the USB device.
  • the USB host controller will power the USB device, and it is in the Powered state at this time; in step 2 of the device enumeration stage, after the reset operation, the device is in the Default state; in step 3 of the device enumeration stage, after the address setting operation, the device is in the Addressed state; after the device enumeration is completed, the device is in the Configured state.
  • the device enumeration phase can be divided into the following 8 steps: 1. Get device descriptor; 2. Reset; 3. Set address; 4. Get device descriptor again; 5. Get configuration descriptor; 6. Get interface, endpoint descriptor; 7. Get string descriptor; 8. Select and set configuration.
  • steps 1 and 4 are to get device descriptors.
  • step 1 only the fixed-length field of the device descriptor is obtained, while step 4 is to get all the fields of the device descriptor.
  • the host controller obtains all the detailed information of the USB device (5 major descriptors), and then allocates resources to it (sets the address).
  • the inserted USB device can be enumerated through the inserted interface, the device descriptor of the USB device can be read, and then the vendor identification number (VID) and product identification number (PID) of the USB device can be determined according to the field division in the device descriptor. Then, according to the VID and PID of the USB device, a match is performed in the preset path directory, for example, the sys/bus/usb directory, to obtain the enumeration information of the USB device.
  • VID vendor identification number
  • PID product identification number
  • the device management of Linux is closely integrated with the file system.
  • Various devices are stored in the /dev directory in the form of files, which are called device files.
  • Applications can open, close, read and write these device files to complete operations on the devices, just like operating ordinary data files.
  • the system numbers the devices, and each device number is divided into a major device number and a minor device number. Among them, the major device number is used to distinguish different types of devices, and the minor device number is used to distinguish multiple devices of the same type.
  • the device file can be found by enumerating information, obtaining bNumInterfaces information, obtaining the number of ports enumerated by the current module, and then determining the main device created by the USB device in the host according to uevent.
  • the backup and secondary device numbers can be found by enumerating information, obtaining bNumInterfaces information, obtaining the number of ports enumerated by the current module, and then determining the main device created by the USB device in the host according to uevent.
  • the backup and secondary device numbers can be found by enumerating information, obtaining bNumInterfaces information, obtaining the number of ports enumerated by the current module, and then determining the main device created by the USB device in the host according to uevent.
  • the backup and secondary device numbers can be found by enumerating information, obtaining bNumInterfaces information, obtaining the number of ports enumerated by the current module, and then determining the main device created by
  • a character device is a custom device structure in Linux that can provide a continuous data stream and an input/output (I/O) device that can be read sequentially by an application. It usually supports reading and writing data by byte/character, but does not support random access. Specifically, in this implementation, a character device can be dynamically created through the mknod interface based on the major device number and the minor device number.
  • the usbfs driver is pre-configured in the kernel of the host device, that is, it is a universal driver that comes with the kernel. Specifically, before binding, it is also necessary to determine the driver loading status of the USB device, that is, whether some drivers are automatically loaded.
  • the created character device can open the USB device through the system call open, and then run the IOCTL USBDEVFS_GETDRIVER command to query whether the USB device has loaded other drivers.
  • the query result shows that the USB device automatically loads the usbfs driver, you can proceed directly to the next step. If other drivers are loaded, release the binding relationship between the USB device and other drivers, and then use the IOCTL USBDEVFS_CLAIMINTERFACE command to bind the USB device to the usbfs driver.
  • the data port of the USB device used for communication is determined by the PID, and the endpoint (Endpoint, EP) of the input direction and the EP of the output direction of the USB device are set based on the data port.
  • the usbfs driver can create a read thread through the data port, and construct a usbdevfs_bulktransfer BULK read request through the read thread to request to bind the EP in the input direction. Then, after the binding is completed, the EP in the input direction is read in a blocking manner through the USBDEVFS_BULK IOCTL to obtain the data in the USB device to the user buffer, and complete the reading of the USB device.
  • the usbfs driver can create a write thread through the data port, and construct a usbdevfs_urb URB write request through the write thread to request to bind the EP in the output direction. Then, after the binding is completed, the data in the user buffer is assembled into a URB BULK packet, and the URB BULK packet is written to the EP in the output direction through USBDEVFS_SUBMITURB IOCTL, and the data in the user buffer is sent to the controller of the USB device to complete the writing of the USB device.
  • the primary and secondary device numbers created by the USB device in the system are determined through the enumeration information of the USB device, and then the corresponding character device is created according to the primary and secondary device numbers. Then, the IOCTL command is executed through the character device to bind the USB device to the usbfs driver that comes with the kernel. Then, the USB device can directly use the universal usbfs driver in the kernel for data communication without relying on the manufacturer's unique driver.
  • the USB driver-free communication device 300 includes:
  • the enumeration module 301 is used to enumerate the inserted USB devices and obtain the enumeration information of the USB devices;
  • the analysis module 302 is used to determine the major device number and minor device number created by the USB device in the host device according to the enumeration information;
  • the communication module 303 is used to create a character device according to the major device number and the minor device number, bind the USB device to the usbfs driver through the character device, wherein the usbfs driver is pre-configured in the kernel of the host device, and communicate with the USB device through the usbfs driver.
  • the enumeration module 301 in enumerating the inserted USB device to obtain the enumeration information of the USB device, is specifically used to:
  • a match is performed in the preset path directory to obtain the enumeration information of the USB device.
  • the communication module 303 is specifically used to:
  • the communication module 303 before binding the USB device to the usbfs driver through the character device, the communication module 303 is further used to:
  • the communication module 303 in terms of communicating with a USB device through a usbfs driver, is specifically used to:
  • the read thread is bound to the endpoint of the input direction, so as to obtain the data in the USB device by reading the endpoint of the input direction in a blocking manner through the read thread.
  • the communication module 303 in terms of communicating with a USB device through a usbfs driver, is further used to:
  • the write thread is bound to the endpoint in the output direction, so as to write data to the endpoint in the output direction through the write thread and write data to the USB device.
  • the communication module 303 in terms of writing data to an endpoint in an output direction through a write thread, is specifically used to:
  • FIG. 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
  • the electronic device 400 includes a transceiver 401, a processor 402, and a memory 403. They are connected via a bus 404.
  • the memory 403 is used to store computer programs and data, and can transmit the data stored in the memory 403 to the processor 402.
  • the processor 402 is used to read the computer program in the memory 403 and perform the following operations:
  • the major device number and minor device number of the USB device created in the host device determine the major device number and minor device number of the USB device created in the host device
  • the processor 402 in enumerating the inserted USB device and obtaining the enumeration information of the USB device, is specifically configured to perform the following operations:
  • a match is performed in the preset path directory to obtain the enumeration information of the USB device.
  • the processor 402 in terms of creating a character device according to the major device number and the minor device number, is specifically configured to perform the following operations:
  • the processor 402 before binding the USB device to the usbfs driver through the character device, the processor 402 is further configured to perform the following operations:
  • the processor 402 in terms of communicating with a USB device through a usbfs driver, is specifically configured to perform the following operations:
  • the read thread is bound to the endpoint of the input direction, so as to obtain the data in the USB device by reading the endpoint of the input direction in a blocking manner through the read thread.
  • the processor 402 in terms of communicating with a USB device through a usbfs driver, is further configured to perform the following operations:
  • the write thread is bound to the endpoint in the output direction, so as to write data to the endpoint in the output direction through the write thread and write data to the USB device.
  • the processor 402 in terms of writing data to an endpoint in an output direction through a write thread, is specifically configured to perform the following operations:
  • the USB driver-free communication device in the present application may include a smart phone (such as an Android phone, an iOS phone, a Windows Phone phone, etc.), a tablet computer, a PDA, a laptop computer, a mobile Internet device MID (Mobile Internet Devices, referred to as: MID), a robot or a wearable device, etc.
  • a smart phone such as an Android phone, an iOS phone, a Windows Phone phone, etc.
  • a tablet computer such as an Android phone, an iOS phone, a Windows Phone phone, etc.
  • PDA Portable Digital Internet Devices, referred to as: MID
  • MID Mobile Internet Devices
  • robot or a wearable device etc.
  • the above-mentioned USB driver-free communication device is only an example, not an exhaustive list, including but not limited to the above-mentioned USB driver-free communication device.
  • the above-mentioned USB driver-free communication device may also include: a smart vehicle terminal, a computer device, etc.
  • the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement some or all of the steps of any USB driver-free communication method described in the above method implementation.
  • the storage medium may include a hard disk, a floppy disk, an optical disk, a tape, a disk, a USB flash drive, a flash memory, etc.
  • the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any one of the USB driver-free communication methods described in the above method implementation.
  • the disclosed device can be implemented in other ways.
  • the device implementation described above is only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
  • Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present implementation scheme.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or in the form of a software program module.
  • the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory.
  • the computer software product is stored in a memory, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Information Transfer Systems (AREA)

Abstract

A USB drive-free communication method and apparatus, and an electronic device and a storage medium. The method comprises: enumerating an inserted USB device to obtain enumeration information of the USB device (201); according to the enumeration information, determining a primary device number and a secondary device number, which is created by the USB device in a host device (202); creating a character device according to the primary device number and the secondary device number (203); binding the USB device with a usbfs driver by means of the character device (204); and communicating with the USB device by means of the usbfs driver (205). Therefore, a primary device number and a secondary device number, which are created by a USB device in a system, are determined by means of enumeration information, a corresponding character device is created, and an IOCTL command is then executed by means of the character device, so as to bind the USB device with a usbfs driver, which is built in a kernel. Thus, the USB device can directly use the universal usbfs driver in the kernel to perform data communication, without relying on a specific driver of a manufacturer.

Description

USB免驱通信方法、装置、电子设备及存储介质USB driver-free communication method, device, electronic device and storage medium
本申请要求于2022年10月31日提交中国专利局、申请号为202211352609.6、申请名称为“USB免驱通信方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on October 31, 2022, with application number 202211352609.6 and application name “USB driver-free communication method, device, electronic device and storage medium”, the entire contents of which are incorporated by reference in this application.
技术领域Technical Field
本发明涉及USB设备数据传输技术领域,具体涉及一种USB免驱通信方法、装置、电子设备及存储介质。The present invention relates to the technical field of USB device data transmission, and in particular to a USB driver-free communication method, device, electronic equipment and storage medium.
背景技术Background technique
无线通信模块借助运营商的蜂窝通信网络被广泛应用于PC、平板、工业网关等产品上,为消费、工业等电子终端产品提供了万物互联的无线桥梁。目前,无线通信模块如果要通过USB端口在嵌入式linux主机环境实现LOG捕获或者升级等功能,现有的芯片方案商一般提供的都是要安装厂商的特有驱动才能完成。但是,嵌入式linux系统由于客户裁剪、高度客制化以及成本原因,无法完成各厂商的驱动集成,导致模块应用受限。Wireless communication modules are widely used in PCs, tablets, industrial gateways and other products with the help of operators' cellular communication networks, providing a wireless bridge for the interconnection of all things for consumer, industrial and other electronic terminal products. At present, if wireless communication modules want to achieve LOG capture or upgrade functions in an embedded Linux host environment through a USB port, existing chip solution providers generally provide manufacturers' unique drivers that need to be installed. However, due to customer tailoring, high customization and cost reasons, embedded Linux systems cannot complete the integration of drivers from various manufacturers, resulting in limited module applications.
发明内容Summary of the invention
为了解决现有技术中存在的上述问题,本申请实施方式提供了一种USB免驱通信方法、装置、电子设备及存储介质,可以使USB设备可以直接使用内核中通用的usbfs驱动进行数据通信,而无需依赖厂商的特有驱动。In order to solve the above-mentioned problems existing in the prior art, the embodiments of the present application provide a USB driver-free communication method, device, electronic device and storage medium, which can enable USB devices to directly use the universal usbfs driver in the kernel for data communication without relying on the manufacturer's specific driver.
第一方面,本申请的实施方式提供了一种USB免驱通信方法,该方法具体包括:In a first aspect, an embodiment of the present application provides a USB driver-free communication method, the method specifically comprising:
对插入的USB设备进行枚举,得到USB设备的枚举信息;Enumerate the inserted USB devices and obtain the enumeration information of the USB devices;
根据枚举信息,确定USB设备在主机设备中创建的主设备号和次设备号;According to the enumeration information, determine the major device number and minor device number of the USB device created in the host device;
根据主设备号和次设备号,创建字符设备;Create a character device based on the major device number and minor device number;
通过字符设备将USB设备与usbfs驱动进行绑定,其中,usbfs驱动预先配置在主机设备的内核中;Bind the USB device to the usbfs driver through a character device, wherein the usbfs driver is pre-configured in the kernel of the host device;
通过usbfs驱动与USB设备进行通信。Communicate with USB devices through the usbfs driver.
在本发明的一个实施方式中,对插入的USB设备进行枚举,得到USB设备的枚举信息,包括:In one embodiment of the present invention, enumerating the inserted USB device to obtain enumeration information of the USB device includes:
通过被插入的接口读取USB设备的供应商身份标识和产品识别码;Read the vendor identification and product identification code of the USB device through the inserted interface;
根据供应商身份标识和产品识别码,在预设路径目录中进行匹配,得到USB设备的枚举信息。According to the supplier identification and product identification code, a match is performed in the preset path directory to obtain the enumeration information of the USB device.
在本发明的一个实施方式中,根据主设备号和次设备号,创建字符设备,包括:In one embodiment of the present invention, creating a character device according to a major device number and a minor device number includes:
根据主设备号和次设备号,通过mknod接口,动态创建字符设备。Dynamically create character devices based on the major and minor device numbers through the mknod interface.
在本发明的一个实施方式中,在通过字符设备将USB设备与usbfs驱动进行绑定之前,方法还包括:In one embodiment of the present invention, before binding the USB device to the usbfs driver through the character device, the method further includes:
通过字符设备运行IOCTL命令,确定USB设备是否已加载驱动;Run IOCTL commands through character devices to determine whether the USB device has been loaded with a driver;
当USB设备已加载驱动时,解除USB设备与驱动之间的绑定关系。When the USB device has been loaded with a driver, the binding relationship between the USB device and the driver is released.
在本发明的一个实施方式中,通过usbfs驱动与USB设备进行通信,包括: In one embodiment of the present invention, communicating with a USB device through a usbfs driver includes:
通过usbfs驱动创建读线程;Create a read thread through the usbfs driver;
将读线程与输入方向的端点绑定,以通过读线程阻塞式的读取输入方向的端点,获取USB设备中的数据。The read thread is bound to the endpoint of the input direction, so as to obtain the data in the USB device by reading the endpoint of the input direction in a blocking manner through the read thread.
在本发明的一个实施方式中,通过usbfs驱动与USB设备进行通信,还包括:In one embodiment of the present invention, communicating with a USB device through a usbfs driver also includes:
通过usbfs驱动创建写线程;Create a write thread through the usbfs driver;
将写线程与输出方向的端点绑定,以通过写线程将数据写入输出方向的端点,向USB设备写入数据。The write thread is bound to the endpoint in the output direction, so as to write data to the endpoint in the output direction through the write thread and write data to the USB device.
在本发明的一个实施方式中,通过写线程将数据写入输出方向的端点,包括:In one embodiment of the present invention, writing data to an endpoint in an output direction through a write thread includes:
通过写线程将数据组装成URB BULK包;Assemble data into URB BULK packages through the write thread;
将URB BULK包写入输出方向的端点。Writes a URB BULK packet to an endpoint in the output direction.
第二方面,本申请的实施方式提供了一种USB免驱通信装置,该装置具体包括:In a second aspect, an embodiment of the present application provides a USB driver-free communication device, which specifically includes:
枚举模块,用于对插入的USB设备进行枚举,得到USB设备的枚举信息;The enumeration module is used to enumerate the inserted USB devices and obtain the enumeration information of the USB devices;
分析模块,用于根据枚举信息,确定USB设备在主机设备中创建的主设备号和次设备号;The analysis module is used to determine the major device number and the minor device number created by the USB device in the host device according to the enumeration information;
通信模块,用于根据主设备号和次设备号,创建字符设备,通过字符设备将USB设备与usbfs驱动进行绑定,其中,usbfs驱动预先配置在主机设备的内核中,并通过usbfs驱动与USB设备进行通信。The communication module is used to create a character device according to the major device number and the minor device number, and bind the USB device to the usbfs driver through the character device, wherein the usbfs driver is pre-configured in the kernel of the host device, and communicates with the USB device through the usbfs driver.
第三方面,本申请实施方式提供一种电子设备,包括:处理器,处理器与存储器相连,存储器用于存储计算机程序,处理器用于执行存储器中存储的计算机程序,以使得电子设备执行如第一方面的方法。In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, the processor is connected to a memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs the method of the first aspect.
第四方面,本申请实施方式提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序使得计算机执行如第一方面的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program enables a computer to execute the method of the first aspect.
第五方面,本申请实施方式提供一种计算机程序产品,计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,计算机可操作来使计算机执行如第一方面的方法。In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and is computer-operable to cause the computer to execute the method of the first aspect.
实施本申请实施方式,具有如下有益效果:The implementation of the present application has the following beneficial effects:
在本申请实施方式中,通过USB设备的枚举信息确定该USB设备在系统中创建的主、次设备号,继而根据主、次设备号创建相应的字符设备。再通过该字符设备执行IOCTL命令,将USB设备与内核自带的usbfs驱动进行绑定。继而使USB设备可以直接使用内核中通用的usbfs驱动进行数据通信,而无需依赖厂商的特有驱动。In the implementation mode of the present application, the enumeration information of the USB device is used to determine the primary and secondary device numbers created by the USB device in the system, and then the corresponding character device is created according to the primary and secondary device numbers. Then, the IOCTL command is executed through the character device to bind the USB device to the usbfs driver that comes with the kernel. Then, the USB device can directly use the universal usbfs driver in the kernel for data communication without relying on the manufacturer's unique driver.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施方式中的技术方案,下面将对实施方式描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the implementation modes of the present application, the drawings required for use in the description of the implementation modes will be briefly introduced below. Obviously, the drawings described below are some implementation modes of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
图1为本申请实施方式提供的一种USB免驱通信装置的硬件结构示意图;FIG1 is a schematic diagram of the hardware structure of a USB driver-free communication device provided in an embodiment of the present application;
图2为本申请实施方式提供的一种USB免驱通信方法的流程示意图;FIG2 is a flow chart of a USB driver-free communication method provided in an embodiment of the present application;
图3为本申请实施方式提供的一种USB免驱通信装置的功能模块组成框图;FIG3 is a block diagram of the functional modules of a USB driver-free communication device provided in an embodiment of the present application;
图4为本申请实施方式提供的一种电子设备的结构示意图。FIG. 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施方式中的附图,对本申请实施方式中的技术方案进行清楚、完整 地描述,显然,所描述的实施方式是本申请一部分实施方式,而不是全部的实施方式。基于本申请中的实施方式,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施方式,都属于本申请保护的范围。The following will combine the drawings in the embodiments of the present application to clearly and completely explain the technical solutions in the embodiments of the present application. It is obvious that the described implementation is a part of the implementation of the present application, not all the implementations. Based on the implementation in the present application, all other implementations obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
在本文中提及“实施方式”意味着,结合实施方式描述的特定特征、结果或特性可以包含在本申请的至少一个实施方式中。在说明书中的各个位置出现该短语并不一定均是指相同的实施方式,也不是与其它实施方式互斥的独立的或备选的实施方式。本领域技术人员显式地和隐式地理解的是,本文所描述的实施方式可以与其它实施方式相结合。Reference to "embodiment" herein means that a particular feature, result, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
首先,参阅图1,图1为本申请实施方式提供的一种USB免驱通信装置的硬件结构示意图。该USB免驱通信装置100包括至少一个处理器101,通信线路102,存储器103以及至少一个通信接口104。First, refer to FIG1 , which is a hardware structure diagram of a USB driver-free communication device provided in an embodiment of the present application. The USB driver-free communication device 100 includes at least one processor 101 , a communication line 102 , a memory 103 and at least one communication interface 104 .
在本实施方式中,处理器101,可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。In this embodiment, the processor 101 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
通信线路102,可以包括一通路,在上述组件之间传送信息。The communication link 102 may include a path to transmit information between the above components.
通信接口104,可以是任何收发器一类的装置(如天线等),用于与其他设备或通信网络通信,例如以太网,RAN,无线局域网(wireless local area networks,WLAN)等。The communication interface 104 can be any transceiver-like device (such as an antenna, etc.) used to communicate with other devices or communication networks, such as Ethernet, RAN, wireless local area networks (WLAN), etc.
存储器103,可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。The memory 103 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
在本实施方式中,存储器103可以独立存在,通过通信线路102与处理器101相连接。存储器103也可以和处理器101集成在一起。本申请实施方式提供的存储器103通常可以具有非易失性。其中,存储器103用于存储执行本申请方案的计算机执行指令,并由处理器101来控制执行。处理器101用于执行存储器103中存储的计算机执行指令,从而实现本申请下述实施方式中提供的方法。In this embodiment, the memory 103 can exist independently and be connected to the processor 101 via the communication line 102. The memory 103 can also be integrated with the processor 101. The memory 103 provided in the embodiment of the present application can generally be non-volatile. Among them, the memory 103 is used to store computer-executable instructions for executing the scheme of the present application, and the execution is controlled by the processor 101. The processor 101 is used to execute the computer-executable instructions stored in the memory 103, thereby realizing the method provided in the following embodiment of the present application.
在可选的实施方式中,计算机执行指令也可以称之为应用程序代码,本申请对此不作具体限定。In an optional implementation, the computer-executable instructions may also be referred to as application code, which is not specifically limited in this application.
在可选的实施方式中,处理器101可以包括一个或多个CPU,例如图1中的CPU0和CPU1。In an optional implementation, the processor 101 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 1 .
在可选的实施方式中,该USB免驱通信装置100可以包括多个处理器,例如图1中的处理器101和处理器107。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用 于处理数据(例如计算机程序指令)的处理核。In an optional embodiment, the USB driver-free communication device 100 may include multiple processors, such as the processor 101 and the processor 107 in FIG. 1 . Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor here may refer to one or more devices, circuits, and/or A processing core that processes data (such as computer program instructions).
在可选的实施方式中,若USB免驱通信装置100为服务器,例如,可以是独立的服务器,也可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。则USB免驱通信装置100还可以包括输出设备105和输入设备106。输出设备105和处理器101通信,可以以多种方式来显示信息。例如,输出设备105可以是液晶显示器(liquid crystal display,LCD),发光二级管(light emitting diode,LED)显示设备,阴极射线管(cathode ray tube,CRT)显示设备,或投影仪(projector)等。输入设备106和处理器101通信,可以以多种方式接收用户的输入。例如,输入设备106可以是鼠标、键盘、触摸屏设备或传感设备等。In an optional embodiment, if the USB driver-free communication device 100 is a server, for example, it can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. Then the USB driver-free communication device 100 can also include an output device 105 and an input device 106. The output device 105 communicates with the processor 101 and can display information in a variety of ways. For example, the output device 105 can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 106 communicates with the processor 101 and can receive user input in a variety of ways. For example, the input device 106 can be a mouse, a keyboard, a touch screen device, or a sensor device.
上述的USB免驱通信装置100可以是一个通用设备或者是一个专用设备。本申请实施方式不限定USB免驱通信装置100的类型。The USB driver-free communication device 100 can be a general device or a dedicated device. The embodiment of the present application does not limit the type of the USB driver-free communication device 100.
以下,将对本申请所公开的USB免驱通信方法进行说明:The following is an explanation of the USB driver-free communication method disclosed in this application:
参阅图2,图2为本申请实施方式提供的一种USB免驱通信方法的流程示意图,具体可以包括以下步骤:Refer to FIG. 2 , which is a flow chart of a USB driver-free communication method provided in an embodiment of the present application, which may specifically include the following steps:
201:对插入的USB设备进行枚举,得到USB设备的枚举信息。201: Enumerate the inserted USB device to obtain enumeration information of the USB device.
所谓枚举,就是让host控制器认识USB设备,并为其准备资源,建立好主机与设备间的数据传递机制。该阶段的工作,是USB通信协议规定的,所以属于ISO标准流程。设备枚举阶段也对应了USB设备的五种状态。即:USB设备插入接口之后,处于Attached状态;USB主控制器会给USB设备供电,此时处于Powered状态;设备枚举阶段的步骤2,复位操作之后,设备处于Default状态;设备枚举阶段的步骤3,设置地址操作之后,设备处于Addressed状态;设备枚举结束之后,设备处于Configured状态。The so-called enumeration is to let the host controller recognize the USB device, prepare resources for it, and establish a data transfer mechanism between the host and the device. The work in this stage is stipulated by the USB communication protocol, so it belongs to the ISO standard process. The device enumeration stage also corresponds to the five states of the USB device. That is: after the USB device is inserted into the interface, it is in the Attached state; the USB host controller will power the USB device, and it is in the Powered state at this time; in step 2 of the device enumeration stage, after the reset operation, the device is in the Default state; in step 3 of the device enumeration stage, after the address setting operation, the device is in the Addressed state; after the device enumeration is completed, the device is in the Configured state.
具体而言,设备枚举阶段可以分为如下8个步骤:1、获取设备描述符;2、复位;3、设置地址;4、再次获取设备描述符;5、获取配置描述符;6、获取接口,端点描述符;7、获取字符串描述符;8、选择设置配置。其中,步骤1与4都是获取设备描述符。但是,在步骤1中只取得设备描述符的固定长度字段,而步骤4是获取设备描述符的全部字段。通过上述的8个步骤,在设备枚举阶段,主机控制器获取了USB设备的所有详细信息(5大描述符),然后为其分配了资源(设置地址)。Specifically, the device enumeration phase can be divided into the following 8 steps: 1. Get device descriptor; 2. Reset; 3. Set address; 4. Get device descriptor again; 5. Get configuration descriptor; 6. Get interface, endpoint descriptor; 7. Get string descriptor; 8. Select and set configuration. Among them, steps 1 and 4 are to get device descriptors. However, in step 1, only the fixed-length field of the device descriptor is obtained, while step 4 is to get all the fields of the device descriptor. Through the above 8 steps, in the device enumeration phase, the host controller obtains all the detailed information of the USB device (5 major descriptors), and then allocates resources to it (sets the address).
基于此,在本实施方式中,可以通过被插入的接口对插入的USB设备进行枚举,读取USB设备的设备描述符,继而根据设备描述符中的字段划分,确定该USB设备的供应商身份标识(Vender Identification Number,VID)和产品识别码(Product Identification Number,PID)。继而根据该USB设备的VID和PID,在预设路径目录,例如:sys/bus/usb目录中进行匹配,得到该USB设备的枚举信息。Based on this, in this embodiment, the inserted USB device can be enumerated through the inserted interface, the device descriptor of the USB device can be read, and then the vendor identification number (VID) and product identification number (PID) of the USB device can be determined according to the field division in the device descriptor. Then, according to the VID and PID of the USB device, a match is performed in the preset path directory, for example, the sys/bus/usb directory, to obtain the enumeration information of the USB device.
202:根据枚举信息,确定USB设备在主机设备中创建的主设备号和次设备号。202: Determine the major device number and minor device number of the USB device created in the host device according to the enumeration information.
Linux的设备管理是和文件系统紧密结合的,各种设备都以文件的形式存放在/dev目录下,称为设备文件。应用程序可以打开、关闭和读写这些设备文件,完成对设备的操作,就像操作普通的数据文件一样。为了管理这些设备,系统为设备编了号,每个设备号又分为主设备号和次设备号。其中,主设备号用来区分不同种类的设备,而次设备号用来区分同一类型的多个设备。在本实施方式中,可以通过枚举信息查找设备文件,获取bNumInterfaces信息,获取当前模块枚举的端口数量,继而根据uevent确定出该USB设备在主机中创建的主设 备号和次设备号。The device management of Linux is closely integrated with the file system. Various devices are stored in the /dev directory in the form of files, which are called device files. Applications can open, close, read and write these device files to complete operations on the devices, just like operating ordinary data files. In order to manage these devices, the system numbers the devices, and each device number is divided into a major device number and a minor device number. Among them, the major device number is used to distinguish different types of devices, and the minor device number is used to distinguish multiple devices of the same type. In this embodiment, the device file can be found by enumerating information, obtaining bNumInterfaces information, obtaining the number of ports enumerated by the current module, and then determining the main device created by the USB device in the host according to uevent. The backup and secondary device numbers.
203:根据主设备号和次设备号,创建字符设备。203: Create a character device based on the major device number and minor device number.
字符设备是Linux中的一种自定义设备结构,可以提供连续的数据流,应用程序可以顺序读取的输入输出(Input/Output,I/O)设备。通常支持按字节自/字符来读写数据,不支持随机存取。具体而言,在本实施方式中,可以根据主设备号和次设备号,通过mknod接口,动态创建字符设备。A character device is a custom device structure in Linux that can provide a continuous data stream and an input/output (I/O) device that can be read sequentially by an application. It usually supports reading and writing data by byte/character, but does not support random access. Specifically, in this implementation, a character device can be dynamically created through the mknod interface based on the major device number and the minor device number.
204:通过字符设备将USB设备与usbfs驱动进行绑定。204: Bind the USB device to the usbfs driver through the character device.
在本实施方式中,usbfs驱动预先配置在主机设备的内核中,即是一种内核自带的通用驱动。具体而言,再绑定前,还需要确定该USB设备的驱动加载情况,即是否自动加载了一些驱动。在本实施方式中,可以由创建好的字符设备通过系统调用open打开该USB设备,然后,运行IOCTL USBDEVFS_GETDRIVER命令,查询该USB设备是否已加载其他驱动。In this embodiment, the usbfs driver is pre-configured in the kernel of the host device, that is, it is a universal driver that comes with the kernel. Specifically, before binding, it is also necessary to determine the driver loading status of the USB device, that is, whether some drivers are automatically loaded. In this embodiment, the created character device can open the USB device through the system call open, and then run the IOCTL USBDEVFS_GETDRIVER command to query whether the USB device has loaded other drivers.
此时,若查询结果表明,该USB设备自动加载了usbfs驱动,则可以直接进行下一步。若加载了其他驱动,则解除USB设备与其他驱动之间的绑定关系,再通过IOCTL USBDEVFS_CLAIMINTERFACE命令,将USB设备与usbfs驱动进行绑定。At this point, if the query result shows that the USB device automatically loads the usbfs driver, you can proceed directly to the next step. If other drivers are loaded, release the binding relationship between the USB device and other drivers, and then use the IOCTL USBDEVFS_CLAIMINTERFACE command to bind the USB device to the usbfs driver.
205:通过usbfs驱动与USB设备进行通信。205: Communicate with USB devices through the usbfs driver.
在本实施方式中,首先,通过PID判定该USB设备用于通信的数据端口,并基于该数据端口设置该USB设备的输入方向的端点(Endpoint,EP)和输出方向的EP。In this embodiment, first, the data port of the USB device used for communication is determined by the PID, and the endpoint (Endpoint, EP) of the input direction and the EP of the output direction of the USB device are set based on the data port.
然后,在本实施方式中,usbfs驱动可以通过该数据端口创建读线程,并通过该读线程构造一个usbdevfs_bulktransfer BULK读请求,请求绑定输入方向的EP。继而在绑定完成后,通过USBDEVFS_BULK IOCTL阻塞式的读取输入方向的EP,获取USB设备中的数据到用户缓冲区,完成对该USB设备的读取。Then, in this embodiment, the usbfs driver can create a read thread through the data port, and construct a usbdevfs_bulktransfer BULK read request through the read thread to request to bind the EP in the input direction. Then, after the binding is completed, the EP in the input direction is read in a blocking manner through the USBDEVFS_BULK IOCTL to obtain the data in the USB device to the user buffer, and complete the reading of the USB device.
最后,在本实施方式中,usbfs驱动可以通过该数据端口创建写线程,并通过该写线程构造一个usbdevfs_urb URB写请求,请求绑定输出方向的EP。继而在绑定完成后,将用户缓冲区的数据组装成URB BULK包,通过USBDEVFS_SUBMITURB IOCTL将URB BULK包写入输出方向的EP,将用户缓冲区的数据发送USB设备的控制器,完成对该USB设备的写入。Finally, in this embodiment, the usbfs driver can create a write thread through the data port, and construct a usbdevfs_urb URB write request through the write thread to request to bind the EP in the output direction. Then, after the binding is completed, the data in the user buffer is assembled into a URB BULK packet, and the URB BULK packet is written to the EP in the output direction through USBDEVFS_SUBMITURB IOCTL, and the data in the user buffer is sent to the controller of the USB device to complete the writing of the USB device.
综上所述,本发明所提供的USB免驱通信方法中,通过USB设备的枚举信息确定该USB设备在系统中创建的主、次设备号,继而根据主、次设备号创建相应的字符设备。再通过该字符设备执行IOCTL命令,将USB设备与内核自带的usbfs驱动进行绑定。继而使USB设备可以直接使用内核中通用的usbfs驱动进行数据通信,而无需依赖厂商的特有驱动。In summary, in the USB driver-free communication method provided by the present invention, the primary and secondary device numbers created by the USB device in the system are determined through the enumeration information of the USB device, and then the corresponding character device is created according to the primary and secondary device numbers. Then, the IOCTL command is executed through the character device to bind the USB device to the usbfs driver that comes with the kernel. Then, the USB device can directly use the universal usbfs driver in the kernel for data communication without relying on the manufacturer's unique driver.
参阅图3,图3为本申请实施方式提供的一种USB免驱通信装置的功能模块组成框图,具体而言,如图3所示,该USB免驱通信装置300包括:Refer to FIG. 3 , which is a block diagram of functional modules of a USB driver-free communication device provided in an embodiment of the present application. Specifically, as shown in FIG. 3 , the USB driver-free communication device 300 includes:
枚举模块301,用于对插入的USB设备进行枚举,得到USB设备的枚举信息;The enumeration module 301 is used to enumerate the inserted USB devices and obtain the enumeration information of the USB devices;
分析模块302,用于根据枚举信息,确定USB设备在主机设备中创建的主设备号和次设备号;The analysis module 302 is used to determine the major device number and minor device number created by the USB device in the host device according to the enumeration information;
通信模块303,用于根据主设备号和次设备号,创建字符设备,通过字符设备将USB设备与usbfs驱动进行绑定,其中,usbfs驱动预先配置在主机设备的内核中,并通过usbfs驱动与USB设备进行通信。The communication module 303 is used to create a character device according to the major device number and the minor device number, bind the USB device to the usbfs driver through the character device, wherein the usbfs driver is pre-configured in the kernel of the host device, and communicate with the USB device through the usbfs driver.
在本发明的实施方式中,在对插入的USB设备进行枚举,得到USB设备的枚举信息方面,枚举模块301,具体用于:In an embodiment of the present invention, in enumerating the inserted USB device to obtain the enumeration information of the USB device, the enumeration module 301 is specifically used to:
通过被插入的接口读取USB设备的供应商身份标识和产品识别码; Read the vendor identification and product identification code of the USB device through the inserted interface;
根据供应商身份标识和产品识别码,在预设路径目录中进行匹配,得到USB设备的枚举信息。According to the supplier identification and product identification code, a match is performed in the preset path directory to obtain the enumeration information of the USB device.
在本发明的实施方式中,在根据主设备号和次设备号,创建字符设备方面,通信模块303,具体用于:In the embodiment of the present invention, in terms of creating a character device according to the major device number and the minor device number, the communication module 303 is specifically used to:
根据主设备号和次设备号,通过mknod接口,动态创建字符设备。Dynamically create character devices based on the major and minor device numbers through the mknod interface.
在本发明的实施方式中,在通过字符设备将USB设备与usbfs驱动进行绑定之前,通信模块303,还用于:In an embodiment of the present invention, before binding the USB device to the usbfs driver through the character device, the communication module 303 is further used to:
通过字符设备运行IOCTL命令,确定USB设备是否已加载驱动;Run IOCTL commands through character devices to determine whether the USB device has been loaded with a driver;
当USB设备已加载驱动时,解除USB设备与驱动之间的绑定关系。When the USB device has been loaded with a driver, the binding relationship between the USB device and the driver is released.
在本发明的实施方式中,在通过usbfs驱动与USB设备进行通信方面,通信模块303,具体用于:In an embodiment of the present invention, in terms of communicating with a USB device through a usbfs driver, the communication module 303 is specifically used to:
通过usbfs驱动创建读线程;Create a read thread through the usbfs driver;
将读线程与输入方向的端点绑定,以通过读线程阻塞式的读取输入方向的端点,获取USB设备中的数据。The read thread is bound to the endpoint of the input direction, so as to obtain the data in the USB device by reading the endpoint of the input direction in a blocking manner through the read thread.
在本发明的实施方式中,在通过usbfs驱动与USB设备进行通信方面,通信模块303,还用于:In an embodiment of the present invention, in terms of communicating with a USB device through a usbfs driver, the communication module 303 is further used to:
通过usbfs驱动创建写线程;Create a write thread through the usbfs driver;
将写线程与输出方向的端点绑定,以通过写线程将数据写入输出方向的端点,向USB设备写入数据。The write thread is bound to the endpoint in the output direction, so as to write data to the endpoint in the output direction through the write thread and write data to the USB device.
在本发明的实施方式中,在通过写线程将数据写入输出方向的端点方面,通信模块303,具体用于:In the embodiment of the present invention, in terms of writing data to an endpoint in an output direction through a write thread, the communication module 303 is specifically used to:
通过写线程将数据组装成URB BULK包;Assemble data into URB BULK packages through the write thread;
将URB BULK包写入输出方向的端点。Writes a URB BULK packet to an endpoint in the output direction.
参阅图4,图4为本申请实施方式提供的一种电子设备的结构示意图。如图4所示,电子设备400包括收发器401、处理器402和存储器403。它们之间通过总线404连接。存储器403用于存储计算机程序和数据,并可以将存储器403存储的数据传输给处理器402。Referring to FIG. 4 , FIG. 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. As shown in FIG. 4 , the electronic device 400 includes a transceiver 401, a processor 402, and a memory 403. They are connected via a bus 404. The memory 403 is used to store computer programs and data, and can transmit the data stored in the memory 403 to the processor 402.
其中,处理器402用于读取存储器403中的计算机程序执行以下操作:The processor 402 is used to read the computer program in the memory 403 and perform the following operations:
对插入的USB设备进行枚举,得到USB设备的枚举信息;Enumerate the inserted USB devices and obtain the enumeration information of the USB devices;
根据枚举信息,确定USB设备在主机设备中创建的主设备号和次设备号;According to the enumeration information, determine the major device number and minor device number of the USB device created in the host device;
根据主设备号和次设备号,创建字符设备;Create a character device based on the major device number and minor device number;
通过字符设备将USB设备与usbfs驱动进行绑定,其中,usbfs驱动预先配置在主机设备的内核中;Bind the USB device to the usbfs driver through a character device, wherein the usbfs driver is pre-configured in the kernel of the host device;
通过usbfs驱动与USB设备进行通信。Communicate with USB devices through the usbfs driver.
在本发明的实施方式中,在对插入的USB设备进行枚举,得到USB设备的枚举信息方面,处理器402,具体用于执行以下操作:In an embodiment of the present invention, in enumerating the inserted USB device and obtaining the enumeration information of the USB device, the processor 402 is specifically configured to perform the following operations:
通过被插入的接口读取USB设备的供应商身份标识和产品识别码;Read the vendor identification and product identification code of the USB device through the inserted interface;
根据供应商身份标识和产品识别码,在预设路径目录中进行匹配,得到USB设备的枚举信息。According to the supplier identification and product identification code, a match is performed in the preset path directory to obtain the enumeration information of the USB device.
在本发明的实施方式中,在根据主设备号和次设备号,创建字符设备方面,处理器402,具体用于执行以下操作: In the embodiment of the present invention, in terms of creating a character device according to the major device number and the minor device number, the processor 402 is specifically configured to perform the following operations:
根据主设备号和次设备号,通过mknod接口,动态创建字符设备。Dynamically create character devices based on the major and minor device numbers through the mknod interface.
在本发明的实施方式中,在通过字符设备将USB设备与usbfs驱动进行绑定之前,处理器402,还用于执行以下操作:In an embodiment of the present invention, before binding the USB device to the usbfs driver through the character device, the processor 402 is further configured to perform the following operations:
通过字符设备运行IOCTL命令,确定USB设备是否已加载驱动;Run IOCTL commands through character devices to determine whether the USB device has been loaded with a driver;
当USB设备已加载驱动时,解除USB设备与驱动之间的绑定关系。When the USB device has been loaded with a driver, the binding relationship between the USB device and the driver is released.
在本发明的实施方式中,在通过usbfs驱动与USB设备进行通信方面,处理器402,具体用于执行以下操作:In an embodiment of the present invention, in terms of communicating with a USB device through a usbfs driver, the processor 402 is specifically configured to perform the following operations:
通过usbfs驱动创建读线程;Create a read thread through the usbfs driver;
将读线程与输入方向的端点绑定,以通过读线程阻塞式的读取输入方向的端点,获取USB设备中的数据。The read thread is bound to the endpoint of the input direction, so as to obtain the data in the USB device by reading the endpoint of the input direction in a blocking manner through the read thread.
在本发明的实施方式中,在通过usbfs驱动与USB设备进行通信方面,处理器402,还用于执行以下操作:In an embodiment of the present invention, in terms of communicating with a USB device through a usbfs driver, the processor 402 is further configured to perform the following operations:
通过usbfs驱动创建写线程;Create a write thread through the usbfs driver;
将写线程与输出方向的端点绑定,以通过写线程将数据写入输出方向的端点,向USB设备写入数据。The write thread is bound to the endpoint in the output direction, so as to write data to the endpoint in the output direction through the write thread and write data to the USB device.
在本发明的实施方式中,在通过写线程将数据写入输出方向的端点方面,处理器402,具体用于执行以下操作:In the embodiment of the present invention, in terms of writing data to an endpoint in an output direction through a write thread, the processor 402 is specifically configured to perform the following operations:
通过写线程将数据组装成URB BULK包;Assemble data into URB BULK packages through the write thread;
将URB BULK包写入输出方向的端点。Writes a URB BULK packet to an endpoint in the output direction.
应理解,本申请中的USB免驱通信装置可以包括智能手机(如Android手机、iOS手机、Windows Phone手机等)、平板电脑、掌上电脑、笔记本电脑、移动互联网设备MID(Mobile Internet Devices,简称:MID)、机器人或穿戴式设备等。上述USB免驱通信装置仅是举例,而非穷举,包含但不限于上述USB免驱通信装置。在实际应用中,上述USB免驱通信装置还可以包括:智能车载终端、计算机设备等等。It should be understood that the USB driver-free communication device in the present application may include a smart phone (such as an Android phone, an iOS phone, a Windows Phone phone, etc.), a tablet computer, a PDA, a laptop computer, a mobile Internet device MID (Mobile Internet Devices, referred to as: MID), a robot or a wearable device, etc. The above-mentioned USB driver-free communication device is only an example, not an exhaustive list, including but not limited to the above-mentioned USB driver-free communication device. In practical applications, the above-mentioned USB driver-free communication device may also include: a smart vehicle terminal, a computer device, etc.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本发明可借助软件结合硬件平台的方式来实现。基于这样的理解,本发明的技术方案对背景技术做出贡献的全部或者部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施方式或者实施方式的某些部分所述的方法。Through the description of the above implementation modes, those skilled in the art can clearly understand that the present invention can be implemented by combining software with a hardware platform. Based on such an understanding, all or part of the contribution of the technical solution of the present invention to the background technology can be embodied in the form of a software product, which can be stored in a storage medium such as ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various implementation modes of the present invention or some parts of the implementation modes.
因此,本申请实施方式还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现如上述方法实施方式中记载的任何一种USB免驱通信方法的部分或全部步骤。例如,所述存储介质可以包括硬盘、软盘、光盘、磁带、磁盘、优盘、闪存等。Therefore, the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement some or all of the steps of any USB driver-free communication method described in the above method implementation. For example, the storage medium may include a hard disk, a floppy disk, an optical disk, a tape, a disk, a USB flash drive, a flash memory, etc.
本申请实施方式还提供一种计算机程序产品,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序可操作来使计算机执行如上述方法实施方式中记载的任何一种USB免驱通信方法的部分或全部步骤。The present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any one of the USB driver-free communication methods described in the above method implementation.
需要说明的是,对于前述的各方法实施方式,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施方式均属于可选的实施方式,所涉及的动作和模块并不一定是本申请 所必须的。It should be noted that, for the sake of simplicity, the aforementioned method implementations are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the implementations described in the specification are all optional implementations, and the actions and modules involved are not necessarily the implementations of the present application. Necessary.
在上述实施方式中,对各个实施方式的描述都各有侧重,某个实施方式中没有详述的部分,可以参见其他实施方式的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
在本申请所提供的几个实施方式中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施方式仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device implementation described above is only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施方式方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present implementation scheme.
另外,在本申请各个实施方式中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件程序模块的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software program module.
所述集成的单元如果以软件程序模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施方式所述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
本领域普通技术人员可以理解上述实施方式的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取器(英文:Random Access Memory,简称:RAM)、磁盘或光盘等。A person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above-mentioned embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable memory, and the memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
以上对本申请实施方式进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施方式的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。 The above is a detailed introduction to the implementation methods of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above implementation methods is only used to help understand the method and core idea of the present application. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims (10)

  1. 一种USB免驱通信方法,其特征在于,所述方法包括:A USB driver-free communication method, characterized in that the method comprises:
    对插入的USB设备进行枚举,得到所述USB设备的枚举信息;Enumerate the inserted USB devices to obtain enumeration information of the USB devices;
    根据所述枚举信息,确定所述USB设备在主机设备中创建的主设备号和次设备号;Determine the major device number and minor device number of the USB device created in the host device according to the enumeration information;
    根据所述主设备号和所述次设备号,创建字符设备;Creating a character device according to the major device number and the minor device number;
    通过所述字符设备将所述USB设备与usbfs驱动进行绑定,其中,所述usbfs驱动预先配置在所述主机设备的内核中;Binding the USB device to a usbfs driver through the character device, wherein the usbfs driver is pre-configured in the kernel of the host device;
    通过所述usbfs驱动与所述USB设备进行通信。Communicate with the USB device via the usbfs driver.
  2. 根据权利要求1所述的方法,其特征在于,所述对插入的USB设备进行枚举,得到所述USB设备的枚举信息,包括:The method according to claim 1, characterized in that the step of enumerating the inserted USB device to obtain the enumeration information of the USB device comprises:
    通过被插入的接口读取所述USB设备的供应商身份标识和产品识别码;Reading the vendor identification and product identification code of the USB device through the inserted interface;
    根据所述供应商身份标识和所述产品识别码,在预设路径目录中进行匹配,以得到所述USB设备的枚举信息。According to the supplier identification and the product identification code, a match is performed in a preset path directory to obtain enumeration information of the USB device.
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述主设备号和所述次设备号,创建字符设备,包括:The method according to claim 1, characterized in that the step of creating a character device according to the major device number and the minor device number comprises:
    根据所述主设备号和所述次设备号,通过mknod接口,动态创建所述字符设备。The character device is dynamically created according to the major device number and the minor device number through the mknod interface.
  4. 根据权利要求1所述的方法,其特征在于,在所述通过所述字符设备将所述USB设备与usbfs驱动进行绑定之前,所述方法还包括:The method according to claim 1, characterized in that before binding the USB device to the usbfs driver through the character device, the method further comprises:
    通过所述字符设备运行IOCTL命令,确定所述USB设备是否已加载驱动;Run an IOCTL command through the character device to determine whether the USB device has been loaded with a driver;
    当所述USB设备已加载驱动时,解除所述USB设备与所述驱动之间的绑定关系。When the driver has been loaded to the USB device, the binding relationship between the USB device and the driver is released.
  5. 根据权利要求1-4中任意一项所述的方法,其特征在于,所述通过所述usbfs驱动与所述USB设备进行通信,包括:The method according to any one of claims 1 to 4, characterized in that communicating with the USB device through the usbfs driver comprises:
    通过所述usbfs驱动创建读线程;Create a read thread through the usbfs driver;
    将所述读线程与输入方向的端点绑定,以通过所述读线程阻塞式的读取所述输入方向的端点,获取所述USB设备中的数据。The read thread is bound to an endpoint in an input direction, so as to obtain data in the USB device by reading the endpoint in the input direction in a blocking manner through the read thread.
  6. 根据权利要求1-4中任意一项所述的方法,其特征在于,所述通过所述usbfs驱动与所述USB设备进行通信,还包括:The method according to any one of claims 1 to 4, characterized in that the communicating with the USB device through the usbfs driver further comprises:
    通过所述usbfs驱动创建写线程;Create a write thread through the usbfs driver;
    将所述写线程与输出方向的端点绑定,以通过所述写线程将数据写入所述输出方向的端点,向所述USB设备写入数据。The write thread is bound to an endpoint in an output direction, so that data is written to the endpoint in the output direction through the write thread, thereby writing data to the USB device.
  7. 根据权利要求6所述的方法,其特征在于,所述通过所述写线程将数据写入所述输出方向的端点,包括:The method according to claim 6, wherein writing data to the endpoint in the output direction through the write thread comprises:
    通过所述写线程将数据组装成URB BULK包;Assemble the data into URB BULK packets through the write thread;
    将所述URB BULK包写入所述输出方向的端点。 Write the URB BULK packet to the endpoint in the output direction.
  8. 一种USB免驱通信装置,其特征在于,所述装置包括:A USB driver-free communication device, characterized in that the device comprises:
    枚举模块,用于对插入的USB设备进行枚举,得到所述USB设备的枚举信息;An enumeration module is used to enumerate the inserted USB devices and obtain the enumeration information of the USB devices;
    分析模块,用于根据所述枚举信息,确定所述USB设备在主机设备中创建的主设备号和次设备号;An analysis module, used to determine the major device number and the minor device number created by the USB device in the host device according to the enumeration information;
    通信模块,用于根据所述主设备号和所述次设备号,创建字符设备,通过所述字符设备将所述USB设备与usbfs驱动进行绑定,其中,所述usbfs驱动预先配置在所述主机设备的内核中,并通过所述usbfs驱动与所述USB设备进行通信。A communication module is used to create a character device according to the major device number and the minor device number, and bind the USB device to a usbfs driver through the character device, wherein the usbfs driver is pre-configured in the kernel of the host device, and communicate with the USB device through the usbfs driver.
  9. 一种电子设备,其特征在于,包括处理器、存储器、通信接口以及一个或多个程序,其中,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述一个或多个程序包括用于执行权利要求1-7任一项方法中所述的步骤的指令。An electronic device, characterized in that it includes a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the processor, and the one or more programs include instructions for executing the steps described in any one of the methods of claims 1-7.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现如权利要求1-7任一项所述的方法。 A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 7.
PCT/CN2023/118583 2022-10-31 2023-09-13 Usb drive-free communication method and apparatus, and electronic device and storage medium WO2024093542A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211352609.6 2022-10-31
CN202211352609.6A CN115905095A (en) 2022-10-31 2022-10-31 USB drive-free communication method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2024093542A1 true WO2024093542A1 (en) 2024-05-10

Family

ID=86494170

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/118583 WO2024093542A1 (en) 2022-10-31 2023-09-13 Usb drive-free communication method and apparatus, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN115905095A (en)
WO (1) WO2024093542A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115905095A (en) * 2022-10-31 2023-04-04 深圳市广和通无线股份有限公司 USB drive-free communication method, device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488000A (en) * 2015-12-23 2016-04-13 广东数字证书认证中心有限公司 Method and system for achieving rapid accessing of USB devices
CN109144586A (en) * 2018-08-03 2019-01-04 彩讯科技股份有限公司 A kind of driving adaptation method, device, computer equipment and storage medium
CN109947482A (en) * 2017-12-21 2019-06-28 深圳Tcl新技术有限公司 A kind of loading method of USB device, storage medium and smart television
US20190303321A1 (en) * 2019-06-18 2019-10-03 Intel Corporation Persistent universal serial bus (usb) device enumeration
CN111104075A (en) * 2019-12-18 2020-05-05 北京数衍科技有限公司 USB equipment simulation device and method
CN115905095A (en) * 2022-10-31 2023-04-04 深圳市广和通无线股份有限公司 USB drive-free communication method, device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488000A (en) * 2015-12-23 2016-04-13 广东数字证书认证中心有限公司 Method and system for achieving rapid accessing of USB devices
CN109947482A (en) * 2017-12-21 2019-06-28 深圳Tcl新技术有限公司 A kind of loading method of USB device, storage medium and smart television
CN109144586A (en) * 2018-08-03 2019-01-04 彩讯科技股份有限公司 A kind of driving adaptation method, device, computer equipment and storage medium
US20190303321A1 (en) * 2019-06-18 2019-10-03 Intel Corporation Persistent universal serial bus (usb) device enumeration
CN111104075A (en) * 2019-12-18 2020-05-05 北京数衍科技有限公司 USB equipment simulation device and method
CN115905095A (en) * 2022-10-31 2023-04-04 深圳市广和通无线股份有限公司 USB drive-free communication method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115905095A (en) 2023-04-04

Similar Documents

Publication Publication Date Title
US10282192B1 (en) Updating device code through a bus
US7840736B2 (en) Bus communication enumeration
US20090222809A1 (en) Portable device upgrade via a content transfer protocol
US8073674B2 (en) SCSI device emulation in user space facilitating storage virtualization
JPH0836539A (en) Pcmcia interface and method for communication between user application and pc card
US20040268359A1 (en) Computer-readable medium, method and computer system for processing input/output requests
WO2024093542A1 (en) Usb drive-free communication method and apparatus, and electronic device and storage medium
US20090043921A1 (en) Method and System for Virtualization and Re-Direction of I/O Connections to Peripheral Devices
US8681788B2 (en) Accelerating NDMP based virtual tape library operations
US20220300448A1 (en) Peripheral component interconnect express device and method of operating the same
CN112463662A (en) Method and terminal for controlling I2C equipment by user mode
CN113010470A (en) Edge node remote control system, method, device and storage medium
CN113448756A (en) Inter-process communication system and method and computing device
CN105556461A (en) Techniques for pre-OS image rewriting to provide cross-architecture support, security introspection, and performance optimization
JPH10116187A (en) Microcomputer
JP2001290665A (en) Processor system
CN110175139B (en) Universal debugging method for USB (Universal Serial bus) equipment and USB equipment
US11934289B2 (en) Graph-based data multi-operation system
WO2022242665A1 (en) Data storage method and related device
CN116486868A (en) Computing high speed nonvolatile memory (NVMe) over high speed link (CXL)
US7680909B2 (en) Method for configuration of a processing unit
US20110055432A1 (en) Electronic systems with peripheral devices
JP6965943B2 (en) Configuration management device, configuration management system, configuration management method, and configuration management program
US8671215B2 (en) Portable communications framework
US20230236742A1 (en) NONVOLATILE MEMORY EXPRESS (NVMe) OVER COMPUTE EXPRESS LINK (CXL)