CN112699071A - Linux system based USB port binding structure and method - Google Patents

Linux system based USB port binding structure and method Download PDF

Info

Publication number
CN112699071A
CN112699071A CN202011470148.3A CN202011470148A CN112699071A CN 112699071 A CN112699071 A CN 112699071A CN 202011470148 A CN202011470148 A CN 202011470148A CN 112699071 A CN112699071 A CN 112699071A
Authority
CN
China
Prior art keywords
usb
equipment
module
binding
port
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011470148.3A
Other languages
Chinese (zh)
Inventor
焦祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing WatchSmart Technologies Co Ltd
Original Assignee
Beijing WatchSmart Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing WatchSmart Technologies Co Ltd filed Critical Beijing WatchSmart Technologies Co Ltd
Priority to CN202011470148.3A priority Critical patent/CN112699071A/en
Publication of CN112699071A publication Critical patent/CN112699071A/en
Pending legal-status Critical Current

Links

Images

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
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • 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
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0002Serial port, e.g. RS232C
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

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 port binding structure and method based on Linux system includes USB device management module for filtering and identifying USB device on system bus and providing management service of USB device and USB device to upper layer software; the USB port binding module calls the service provided by the USB equipment management module and establishes the mapping relation between the USB physical port and the binding serial number; the USB batch production module reads the binding information configuration file written by the USB port binding module and provides a device method for managing and operating the USB physical port through the binding serial number ID; and the USB device management tool module calls the enumeration, opening and closing interfaces provided by the USB device management module to operate the device. The invention realizes the binding function of the USB port on the premise of not changing the processing mechanism of the USB equipment recognized by the system, and realizes the batch production operation of the USB equipment by the binding relationship between the USB equipment and the USB physical port and the method for operating the corresponding equipment according to the binding serial number.

Description

Linux system based USB port binding structure and method
Technical Field
The invention relates to the technical field of information security, in particular to a USB port binding structure and a USB port binding method based on a Linux system.
Background
The domestic system and the Linux system access and operate the equipment through the equipment files. When the system identifies a new device, the kernel creates a corresponding device file for the device according to the device insertion order. When a plurality of devices of the same type exist at the same time, the insertion sequence of the devices on the same USB port is different, and the file names of the created devices are also different. It is not possible to operate a device on a certain USB port by a fixed device name. This will be unfavorable for the batch production related operations of USB devices such as batch production, initialization, prefabrication, etc. on domestic systems and Linux systems.
In order to solve the above problem, the prior patent CN201510109538.0 discloses a method for binding a drive letter in a Linux system, which determines a drive letter of a user mode device for a newly added disk device through a UDEV, and sends a renaming message to a kernel, and the kernel modifies the drive letter in a link pointing to the kernel device and the kernel device to be consistent with the drive letter of the user mode device according to the renaming message, thereby realizing slot position and drive letter binding.
However, the simple rule USB device filtering and port name fixing functions can only be realized by configuring the UDEV filtering rule, and the complex device filtering rule cannot be processed, and additional device information cannot be added.
Disclosure of Invention
The present invention is to solve the above problems, and provide a technique capable of implementing a USB port binding function without changing a system identification USB device processing mechanism.
The invention provides a system for binding USB ports based on a domestic system and a Linux system, which is characterized by comprising a USB equipment management module 1, a USB equipment 6 and an upper layer software, wherein the USB equipment management module 1 is arranged on an application layer of a computer, filters and identifies USB equipment 6 on a system bus 5, and provides management services of a USB physical port and the USB equipment 6 to the upper layer software; the upper layer software comprises a USB port binding module 2, a USB batch production module 3 and a USB equipment management module 4 which are all arranged on an application layer; the USB port binding module 2 establishes a mapping relation between a USB physical port and a binding serial number by calling the service provided by the USB equipment management module 1, and writes port binding information into a binding index configuration file for the USB batch production module 3 to inquire and use; the USB batch production module 3 reads the binding information configuration file written by the USB port binding module 2, obtains the mapping relation between the binding serial number ID and the physical port, and provides a device method for managing and operating the USB physical port through the binding serial number ID; the USB device management tool module 4 operates the device by calling device enumeration, opening and closing device interfaces provided by the USB device management module 1.
According to an embodiment of the present invention, the USB device management module 1 is provided with a monitoring device module 11, an enumeration device module 12, an open device module 13, and a close device module 14, where the monitoring device module 11 and the USB device 6 on the cycle check system bus 5 compare the change conditions of the USB device list recorded at two time intervals before and after, and send the plugging and unplugging message of the USB device 6 to the upper layer; the enumeration device module 12 enumerates the currently filtered and recognized USB device 6, constructs device Reader Name identification information according to the USB device information and the USB physical port information, records the Reader Name identification information of all devices into a device list, and returns the Reader Name identification information to a caller; the equipment opening module 13 searches and opens the specified USB equipment 6 according to the Reader Name, constructs an equipment handle according to the physical port identifier in the Reader Name identifier, establishes the incidence relation between the equipment handle and the physical port, and returns the equipment handle and the physical port to the interface caller for accessing the equipment; the device closing module 14 receives a device closing request, determines validity of the handle, and releases the resource occupied by the handle.
According to an embodiment of the present invention, a USB port binding method is provided, and step S101: the enumeration device module 12 enumerates the USB devices on the system bus 5, identifies the USB devices 6 according to the filtering rule, constructs device Reader Name identification information according to the USB device information and the USB physical port information, and records all the device Reader Name information into a device list; step S102: the equipment opening module 13 opens the specified USB equipment 6 according to the Reader Name identification information of the USB equipment; step S103: comparing the monitoring equipment module 11 with the previous equipment Reader Name list, judging the change condition of the equipment in the list, jumping to the step S101, adding the USB equipment, entering the next step, removing the USB equipment 6, jumping to the step S105, canceling monitoring and ending the process, wherein the equipment does not change; step S104: the device management module 1 sends the message inserted by the USB device 6 to the upper application; step S105: the device management module 1 sends the USB device 6 pull-out message to the upper layer application.
According to an embodiment of the present invention, the step of processing by the USB port binding module 2 is as follows, in step S201, the USB port binding module 2 clears the USB port binding information list; step S202, the USB port binding module 2 calls the monitoring equipment module 11 to monitor the plugging and unplugging information of the USB equipment 6, when the insertion of the equipment is monitored, the next step is carried out, and when the monitoring canceling information is received, the step S206 is skipped; step S203, the USB port binding module 2 acquires physical port information from Reader Name information of the newly inserted USB device 6; step S204, the USB port binding module 2 judges whether the currently acquired USB physical port is bound, if the port is bound, the step S202 is skipped, and if the port is not bound, the next step is carried out; step S205, the USB port binding module 2 updates the USB physical port and the binding serial number to a binding information list, and jumps to step S202;
in step S206, the USB port binding module 2 completes the binding, and updates the binding information into the binding information configuration file.
According to an embodiment of the present invention, the USB mass production module 3 processes the following steps, in step S301, the USB mass production module 3 reads the binding information configuration file to obtain the number of the bound ports, the binding serial number ID, and the association relationship between the USB physical ports; step S302, the USB batch production module 3 creates worker threads for each bound USB physical port according to the binding serial number ID, and the number of the created worker threads is the number of the bound ports; step S303, the USB batch production module 3 calls the monitoring equipment module 11 to monitor the plugging and unplugging information of the USB equipment; step S304, when monitoring the device plugging message, the USB batch production module 3 firstly inquires a binding index table and judges whether a physical port where the device is located is bound; if not, returning to the step S303 to continue monitoring the equipment plugging and unplugging message; otherwise, continuing to execute the next step; step S305, the worker thread of the USB batch production module 3 responds to the event of plugging and unplugging the equipment, obtains the Reader Name information of the equipment, processes the production flow and displays the current thread progress. When the inserting equipment message is processed, the USB equipment 6 on the corresponding USB physical port is opened, the production flow of the USB equipment 6 is executed, and the processing progress and the execution result are displayed; when the message is pulled out for the device, the worker thread corresponding to the current port executes cleaning operation and waits to respond to the pull-out message of the USB device 6 which is produced next to the physical port corresponding to the thread.
According to an embodiment of the present invention, when the USB mass production module 3 finishes the mass production process of the USB device 6, the USB mass production module 3 first stops monitoring the device plugging/unplugging message, notifies the worker threads to finish the production process, and exits after all the worker threads finish executing.
The method of the invention realizes the binding function of the USB port on the premise of not changing the processing mechanism of the system for identifying the USB equipment. The method provides architectural support for the mass production of USB equipment such as mass production, initialization, prefabrication and the like of USB equipment on a domestic system and a Linux system, and enriches the application scene of the domestic system in the field of USB equipment production.
Drawings
FIG. 1 is a diagram of the overall architecture of a system associated with USB port binding in a Linux system;
FIG. 2 is a USB device management module process flow diagram;
FIG. 3 is a USB port binding module process flow diagram;
FIG. 4 is a USB Mass production Module processing flow diagram.
Detailed Description
In the following detailed description of the preferred embodiments of the invention, reference is made to the accompanying drawings that form a part hereof, and in which is shown by way of illustration, specific features of the invention, such that the advantages and features of the invention may be more readily understood and appreciated. The following description is an embodiment of the claimed invention, and other embodiments related to the claims not specifically described also fall within the scope of the claims.
The following description will be made by taking a computer equipped with a Linux system as an example.
The Linux system accesses and operates devices through device files. When the system identifies a new device, the kernel creates a corresponding device file for the device according to the device insertion order. For example, when the USB device 6 is inserted into the USB port of the computer, the kernel creates a corresponding device file for the USB device 6 according to the insertion order of the USB device.
The binding of USB ports in Linux systems associated with the present invention is described below.
FIG. 1 is a diagram of the overall architecture of the system associated with USB port binding in Linux. The hardware layer of the Linux system is provided with a system bus 5, the system bus 5 is connected with a USB device 6 downwards and is connected with the USB device management module 1 upwards, and the system bus 5 provides a channel for connecting the USB device 6 with the inside of the computer system. The USB device management module 1 is arranged on an application layer of a computer, filters and identifies USB devices 6 on a system bus 5, and provides management services of USB physical ports and the USB devices 6 for upper-layer software. The upper layer software comprises a USB port binding module 2, a USB batch production module 3 and a USB equipment management module 4 which are all arranged on an application layer.
The USB port binding module 2 establishes a mapping relation between the USB physical port and the binding serial number by calling the service provided by the USB device management module 1, and writes the port binding information into the binding index configuration file for the USB batch production module 3 to inquire and use.
The USB batch production module 3 reads the binding information configuration file written by the USB port binding module 2, obtains the mapping relation between the binding serial number ID and the physical port, and provides a device method for managing and operating the USB physical port through the binding serial number ID.
The USB device management tool module 4 operates the device by calling device enumeration, opening and closing device interfaces provided by the USB device management module 1.
The upper layer software of the USB port binding module 2, the USB batch production module 3 and the USB device management module 4 directly performs data interaction with the USB device management module 1 to access devices on an operating system bus 5. The USB device 6 includes three parts, a USB bus interface, a USB logic device, and a functional device. In the figure, there are N USB devices 6, and the specific number is set as required. The connection of the operating system to the USB device requires interaction between layers and entities, with the USB bus interface layer providing the underlying transport of data over the USB data lines.
According to the specifications of the USB specification, all USB devices 6 have a Vendor Id (VID) and a product identification number (PID), and the host (operating system) distinguishes the different devices by different VIDs and PIDs.
For example, when the USB device 6 is inserted into the system bus 5, the system bus 5 acquires a port number of the USB device and transmits the port number to the USB device management module 1, the USB device management module 1 filters and identifies the USB device on the system bus 5 according to information such as a device vendor ID, a product identification code, a device descriptor, and a communication protocol, and constructs a USB device Reader Name identifier, the USB device management module 1 includes a snooping device module 11, an enumerating device module 12, an opening device module 13, and a closing device module 14, and interfaces for snooping device plugging events, enumerating devices, opening devices, and closing devices are provided to the application layer through the snooping device module 11, the enumerating device module 12, the opening device module 13, and the closing device module 14.
The monitoring equipment module 11 circularly checks the USB equipment 6 on the system bus 5, compares the change conditions of the USB equipment list recorded at the previous and next time intervals, and sends the plugging and unplugging message of the USB equipment 6 to the upper layer. For example, the monitoring device module 11 reads the device list once every 50ms, and when the device information read in the next time does not find a record in the previous list, which indicates that a new USB device 6 is inserted, sends a device insertion message to the upper application which enables the monitor; and when the device in the previous list is not found in the device list read in the next time, which indicates that the USB device 6 is removed, sending a message of pulling out the device to the upper application which enables the monitor program.
The equipment enumeration module 12 enumerates the currently filtered and recognized USB equipment 6, constructs equipment Reader Name identification information according to the USB equipment information and the USB physical port information, records the Reader Name identification information of all the equipment into an equipment list, and returns the Reader Name identification information to a caller.
And opening the equipment module 13, searching and opening the specified USB equipment 6 according to the Reader Name, constructing an equipment handle according to the physical port identifier in the Reader Name identifier, establishing an association relationship between the equipment handle and the physical port, and returning the association relationship to the interface caller for accessing the equipment.
And the equipment closing module 14 is used for receiving the equipment closing request, judging the validity of the handle and releasing the resource occupied by the handle.
A Handle (Handle) is an identifier used to identify an object or item and to describe a form, a file, etc. in programming, a Handle is a special intelligent pointer, and is used when an application refers to a memory block or an object managed by another system (e.g., a database, an operating system).
Construction of device handle: the device handle is a 16-ary number that includes two parts: and when an equipment handle is constructed, acquiring equipment name information sysname on the USB physical port. The physical port device name here is unique. Non-numeric characters can be removed and converted into decimal numbers, and custom starting number information is added to uniquely identify and distinguish equipment on the physical port.
For example: and externally connecting a USB device 6 on a 16-port USB hub, wherein the name of the USB device on the port is 2-2.1:1.0, removing non-numeric characters, converting the non-numeric characters into decimal numbers, and adding a starting number of 0x10000000 to construct a corresponding physical identifier of 0x 1000565E. The physical port is uniquely identified by the handle.
In this embodiment, the Reader Name identifier of the USB device is constructed according to the information of the USB device 6 and the information of the USB physical port, the management relationship between the Reader Name identifier of the device and the USB physical port is established, and the USB physical port where the device is located is obtained through the Reader Name of the device.
The flow of processing by the USB device management module 1 will be described below with reference to a flowchart.
FIG. 2 is a flow chart of a USB device management module process. As shown in figure 2 of the drawings, in which,
step S101 (first step): the enumeration device module 12 enumerates the USB devices 6 on the system bus 5, identifies the USB devices 6 according to the filtering rule, constructs device Reader Name identification information according to the USB device information and the USB physical port information, and records all the device Reader Name information into a device list.
Step S102 (second step): and the equipment opening module 13 opens the specified USB equipment 6 according to the USB equipment Reader Name identification information.
Step S103 (third step): and comparing the monitoring equipment module 11 with the previous equipment Reader Name list, judging the change condition of the equipment in the list, jumping to the step S101, adding the USB equipment 6, entering the next step, removing the USB equipment 6, jumping to the step S105, canceling monitoring and ending the process.
Step S104 (fourth step): the device management module 1 sends the message inserted by the USB device 6 to the upper layer application.
Step S105 (fifth step): the device management module 1 sends the USB device 6 pull-out message to the upper layer application.
The following describes the processing flow of the USB port binding module 2.
FIG. 3 is a flow chart of the USB port binding module process. As shown in figure 3 of the drawings,
in step S201 (sixth step), the USB port binding module 2 clears the USB port binding information list.
Step S202 (seventh step), the USB port binding module 2 calls the monitoring device module 11 to monitor the plugging/unplugging message of the USB device 6, and when it is monitored that the device is plugged, the next step is performed, and when the monitoring cancellation message is received, the step S206 is skipped.
Step S203 (eighth step), the USB port binding module 2 obtains physical port information from the Reader Name information of the newly inserted USB device 6.
Step S204 (ninth step), the USB port binding module 2 determines whether the currently acquired USB physical port is bound, if the port is bound, the process jumps to step S202, and if not, the process proceeds to the next step.
In step S205 (tenth step), the USB port binding module 2 updates the USB physical port and the binding serial number to the binding information list, and jumps to step S202.
In step S206 (eleventh step), the USB port binding module 2 completes this binding, and updates the binding information into the binding information configuration file.
Through the above processing, the binding of the USB port is completed. After the binding of the USB ports is successful, the USB device batch production module 3 reads the binding information configuration file written by the USB port binding module 2, obtains the mapping relation between the binding serial number ID and the physical port, and provides a device method for managing and operating the USB physical port through the binding serial number ID.
The following describes a flow used by the USB mass production module 3 with a flowchart.
FIG. 4 is a flow chart of USB Mass production Module processing. As shown in figure 4 of the drawings,
step S301 (twelfth step), the USB mass production module 3 reads the binding information configuration file, and obtains the number of the bound ports, the binding serial number ID, and the association relationship between the USB physical ports.
Step S302 (thirteenth step), the USB mass production module 3 creates worker threads for each bound USB physical port according to the binding serial number ID, where the number of created worker threads is the number of bound ports.
In step S303 (fourteenth step), the USB mass production module 3 calls the monitoring device module 11 to monitor the plugging/unplugging message of the USB device 6.
Step S304 (fifteenth step), when monitoring the device plugging/unplugging message, the USB mass production module 3 firstly queries the binding index table and determines whether the physical port where the device is located is bound; if not, returning to the step S303 to continue monitoring the equipment plugging and unplugging message; otherwise, the next step is continuously executed.
Step S305 (sixteenth step), the worker thread of the USB mass production module 3 responds to the event of plugging and unplugging the device, obtains the Reader Name information of the device, processes the production flow, and displays the current thread progress. When the inserting equipment message is processed, the USB equipment 6 on the corresponding USB physical port is opened, the production flow of the USB equipment 6 is executed, and the processing progress and the execution result are displayed; when the message is pulled out for the device, the worker thread corresponding to the current port executes cleaning operation and waits to respond to the pull-out message of the USB device 6 which is produced next to the physical port corresponding to the thread.
As a modified example, in step S305, when the USB mass production module finishes the production process, the USB mass production module stops monitoring the device plugging/unplugging message first, notifies the worker threads to finish the production process, and exits after all the worker threads finish executing.
As can be seen from the above, in this embodiment, after the USB mass production module 3 obtains the USB physical port where the USB device 6 is located, the binding index table is queried to obtain the binding serial number corresponding to the USB port, and then the device on the designated USB port is operated according to the binding serial number.
Because the USB device 6 is bound with the USB physical port, the method for operating the corresponding device according to the binding serial number realizes the batch production operation of the device on the USB port. For example, the mass production module 3 may operate all devices on the bound USB ports according to the binding serial numbers, perform mass management and control on the production flow and the production progress of each USB device 6, and display the execution status and the execution result.
In the invention, because the binding logic of the USB physical port on the Linux system is established, the binding logic is as follows: the function of operating the USB equipment on the designated USB physical port through the equipment Reader Name identifier and the equipment handle is realized, and the framework support is provided for the batch production of the USB equipment on the Linux system, such as batch personalization, initialization, prefabrication and the like.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and those skilled in the art may design alternative embodiments without departing from the scope of the appended claims, for example, the embodiments are described by taking the Linux system as an example, but not limited to the Linux system, for example, a domestic operating system developed based on the Linux system for the second time, and the like, and the kernel creates a corresponding device file for the device according to the insertion order of the device to access the device file and operate the operating system of the device when the system recognizes the new device.

Claims (6)

1. A USB port binding structure based on a Linux system is characterized by comprising the following modules,
the USB device management module (1) is arranged on an application layer of a computer, filters and identifies USB devices (6) on a system bus (5), provides management services of a USB material port and the USB devices for upper-layer software, and provides a channel for connecting the USB devices (6) with the interior of a computer system by the system bus (5);
the upper layer software comprises a USB port binding module (2), a USB batch production module (3) and a USB equipment management module (4) which are all arranged on an application layer;
the USB port binding module (2) establishes a mapping relation between a USB physical port and a binding serial number by calling the service provided by the USB equipment management module (1), and writes port binding information into a binding index configuration file for the USB batch production module (3) to inquire and use;
the USB batch production module (3) reads the binding information configuration file written by the USB port binding module (2), obtains the mapping relation between the binding serial number ID and the physical port, and provides a method for managing and operating USB physical port equipment through the binding serial number ID;
the USB device management tool module (4) operates the device by calling the device enumeration, opening and closing the device interface provided by the USB device management module (1).
2. The Linux system-based USB port binding structure of claim 1,
the USB device management module (1) comprises a monitoring device module (11), an enumeration device module (12), an opening device module (13) and a closing device module (14),
the monitoring equipment module (11) can compare the change conditions of the USB equipment list recorded by the front time interval and the rear time interval of the USB equipment (6) on the circulating checking system bus (5), and send the plugging and unplugging information of the USB equipment (6) to the upper layer;
the equipment enumeration module (12) enumerates the currently filtered and recognized USB equipment (6), constructs equipment Reader Name identification information according to the USB equipment information and the USB physical port information, records the Reader Name identification information of all the equipment into an equipment list, and returns the Reader Name identification information to a caller;
the device opening module (13) searches and opens the specified USB device (6) according to the Reader Name, constructs a device handle according to the physical port identifier in the Reader Name identifier, establishes the association relationship between the device handle and the physical port, and returns the association relationship to the interface caller for accessing the device;
and the equipment closing module (14) receives the equipment closing request, judges the validity of the handle and releases the resource occupied by the handle.
3. A USB port binding method based on Linux system is characterized in that,
the first step is as follows: an enumeration equipment module (12) enumerates USB equipment (6) on a system bus (5), identifies the USB equipment (6) according to a filtering rule, constructs equipment Reader Name identification information according to USB equipment information and USB physical port information, and records all the equipment Reader Name information into an equipment list;
the second step is as follows: the equipment opening module (13) opens the specified USB equipment 6 according to the Reader Name identification information of the USB equipment;
the third step: comparing the monitoring equipment module (11) with a previous equipment Reader Name list, judging the change condition of the equipment in the list, jumping to the first step when the equipment is not changed, changing the equipment, entering the fourth step when the USB equipment (6) is newly added, changing the equipment, and jumping to the fifth step when the USB equipment (6) is removed;
the fourth step: the device management module (1) sends the message inserted by the USB device (6) to the upper application;
the fifth step: the device management module (1) sends the USB device (6) pull-out message to the upper layer application.
4. The Linux system-based USB port binding method of claim 3, further comprising the steps of:
a sixth step, the USB port binding module (2) empties the USB port binding information list;
a seventh step, the USB port binding module (2) calls a monitoring equipment module (11) to monitor the plugging and unplugging information of the USB equipment (6), when the insertion of the equipment is monitored, the eighth step is carried out, and when a monitoring canceling message is received, the eleventh step is skipped to;
eighthly, the USB port binding module (2) acquires physical port information from Reader Name information of newly inserted USB equipment (6);
a ninth step, a USB port binding module (2) judges whether the currently acquired USB physical port is bound, if the port is bound, the seventh step is skipped, and if the port is not bound, the tenth step is carried out;
a tenth step, the USB port binding module (2) updates the USB physical port and the binding serial number to a binding information list, and jumps to the seventh step;
and eleventh, the USB port binding module (2) completes the binding, and updates the binding information into a binding information configuration file.
5. The Linux system-based USB port binding method according to claims 3-4,
a twelfth step, the USB batch production module (3) reads the binding information configuration file and obtains the number of the bound ports, the binding serial number ID and the incidence relation between the USB physical ports;
thirteenth step, the USB batch production module (3) creates worker threads for each bound USB physical port according to the binding serial number ID, and the number of the created worker threads is the number of the bound ports;
a fourteenth step, the USB batch production module (3) calls a monitoring equipment module (11) to monitor the plugging and unplugging information of the USB equipment (6);
fifteenth step, when monitoring the device plugging message, the USB batch production module (3) firstly inquires a binding index table and judges whether a physical port where the device is located is bound; if not, returning to the fourteenth step to continue monitoring the equipment plugging and unplugging message; otherwise, executing the sixteenth step;
sixthly, responding to the event of plugging and unplugging the equipment by the worker thread of the USB batch production module (3), acquiring Reader Name information of the equipment, processing the production flow and displaying the current thread progress.
6. The Linux system-based USB port binding method of claim 5, further comprising the steps of:
in the sixteenth step, when the USB batch production module (3) finishes the batch production process of the USB devices (6), the USB batch production module (3) first stops monitoring the device plugging/unplugging message, notifies the worker threads to finish the production process, and quits after all the worker threads finish executing.
CN202011470148.3A 2020-12-14 2020-12-14 Linux system based USB port binding structure and method Pending CN112699071A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011470148.3A CN112699071A (en) 2020-12-14 2020-12-14 Linux system based USB port binding structure and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011470148.3A CN112699071A (en) 2020-12-14 2020-12-14 Linux system based USB port binding structure and method

Publications (1)

Publication Number Publication Date
CN112699071A true CN112699071A (en) 2021-04-23

Family

ID=75507934

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011470148.3A Pending CN112699071A (en) 2020-12-14 2020-12-14 Linux system based USB port binding structure and method

Country Status (1)

Country Link
CN (1) CN112699071A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114036081A (en) * 2021-11-15 2022-02-11 江苏卓易信息科技股份有限公司 USB CDC driving method based on dependence injection type equipment library
CN115515079A (en) * 2022-08-05 2022-12-23 福建新大陆通信科技股份有限公司 Emergency broadcasting equipment LTE module management method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667934A (en) * 2009-08-25 2010-03-10 中国工程物理研究院电子工程研究所 Centralized supervision device and supervision method of USB interface equipment networking
CN105721566A (en) * 2016-01-29 2016-06-29 华为技术有限公司 Method for redirecting port, server and system
CN106844120A (en) * 2017-02-06 2017-06-13 深圳芯智汇科技有限公司 A kind of method and apparatus for binding multi-channel A/D B device and USB port

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667934A (en) * 2009-08-25 2010-03-10 中国工程物理研究院电子工程研究所 Centralized supervision device and supervision method of USB interface equipment networking
CN105721566A (en) * 2016-01-29 2016-06-29 华为技术有限公司 Method for redirecting port, server and system
CN106844120A (en) * 2017-02-06 2017-06-13 深圳芯智汇科技有限公司 A kind of method and apparatus for binding multi-channel A/D B device and USB port

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114036081A (en) * 2021-11-15 2022-02-11 江苏卓易信息科技股份有限公司 USB CDC driving method based on dependence injection type equipment library
CN115515079A (en) * 2022-08-05 2022-12-23 福建新大陆通信科技股份有限公司 Emergency broadcasting equipment LTE module management method
CN115515079B (en) * 2022-08-05 2023-06-27 福建新大陆通信科技股份有限公司 Emergency broadcasting equipment LTE module management method

Similar Documents

Publication Publication Date Title
CN108008914B (en) The method, apparatus and ARM equipment of disk management in a kind of ARM equipment
CN104699423B (en) The method and apparatus that drive is bound in linux system
CN103150279B (en) Method allowing host and baseboard management controller to share device
US20070028014A1 (en) Method and apparatus for managing I/O paths on a storage network
CN112738060B (en) Method and device for processing micro-service data, micro-service processing platform and medium
CN103412769A (en) External card parameter configuration method, equipment and system
CN109426613A (en) The method and its computer system of tune-up data are retrieved in UEFI
CN101281474A (en) Method and apparatus for opening appoint terminal port USB equipment
CN102393848A (en) Method and system for acquiring identification information of data terminal equipment
CN102253845B (en) Server system
CN101620578B (en) Method for managing USB equipment based on virtualized system
CN112699071A (en) Linux system based USB port binding structure and method
CN113608790A (en) Linux system based self-adaptive management method and system for serial device and storage medium
CN106126277A (en) Multi-microprocessor and the upgrade method of external memory system
CN101853142B (en) Identification method of USB device with virtual drive
CN102147710B (en) Management hub, in order to manage the method for multiple drivers be connected with a main frame
US10944587B2 (en) Event processing associated with a smart device
JPH11177655A (en) Device and method for automatically verifying communication software
CN110569933A (en) intelligent card management device and method
CN110795369A (en) Method and terminal for realizing MIDO slave function based on GPIO pin
US20110241981A1 (en) Input Routing for Simultaneous USB Connections of Similar Device Types
CN109271332A (en) A kind of method and apparatus of node device driving initialization
US20150195366A1 (en) Switching device, non-transitory computer readable medium and zoning setting method
CN101655822B (en) Computer system, device information management system of computer system and method thereof
CN110958147A (en) Internet of things equipment interconnection strategy configuration system

Legal Events

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