CN111045737B - Equipment identifier acquisition method, device, terminal equipment and storage medium - Google Patents

Equipment identifier acquisition method, device, terminal equipment and storage medium Download PDF

Info

Publication number
CN111045737B
CN111045737B CN201911205590.0A CN201911205590A CN111045737B CN 111045737 B CN111045737 B CN 111045737B CN 201911205590 A CN201911205590 A CN 201911205590A CN 111045737 B CN111045737 B CN 111045737B
Authority
CN
China
Prior art keywords
serial port
identifier
identification
path
equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911205590.0A
Other languages
Chinese (zh)
Other versions
CN111045737A (en
Inventor
陈建军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huizhou TCL Mobile Communication Co Ltd
Original Assignee
Huizhou TCL Mobile Communication 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 Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN201911205590.0A priority Critical patent/CN111045737B/en
Publication of CN111045737A publication Critical patent/CN111045737A/en
Application granted granted Critical
Publication of CN111045737B publication Critical patent/CN111045737B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • G06F9/4413Plug-and-play [PnP]
    • G06F9/4415Self describing peripheral devices
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Systems (AREA)

Abstract

The application discloses a device identifier acquisition method, which is applied to first terminal equipment and comprises the following steps: and acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of the identification equipment to be acquired, acquiring a serial port position path corresponding to the serial port according to the serial port identification, determining a full path of the identification equipment to be acquired according to the serial port position path, and finally acquiring the equipment identification of the identification equipment to be acquired according to the full path. According to the method and the device, the full path of the identification device to be acquired is determined through the position path of the serial port, so that the device identification of the identification device to be acquired is acquired according to the full path, and the problem that the device identification of a single device cannot be acquired when a plurality of devices are simultaneously accessed to a computer is effectively solved.

Description

Equipment identifier acquisition method, device, terminal equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a device identifier obtaining method, a device, a terminal device, and a storage medium.
Background
ADB (Android Debug Bridge ) is a set of methods developed by google to debug android devices. When the android device is connected with the computer in the ADB mode, the computer end can find one device, and a user can control the device by using the ADB tool.
When multiple devices are connected to the computer at the same time, the ADB tool distinguishes each device through the device identification. The device identification is obtained by using the traditional ADB instruction mode, the device identifications of all devices connected with the computer can be obtained only once, and the device identifications and the devices cannot be corresponding, so that when one device is needed to be used, the device identification corresponding to the device cannot be determined, and the device identification of a single device cannot be identified.
Disclosure of Invention
The embodiment of the application provides a device identifier acquisition method, a device, a mobile terminal and a storage medium, which aim to solve the problem that the device identifier of a single device cannot be acquired when a plurality of devices are simultaneously accessed to a computer.
The technical scheme provided by the application is as follows:
the application provides a device identifier acquisition method, which is applied to first terminal equipment and comprises the following steps:
acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of identification equipment to be acquired;
acquiring a serial port position path corresponding to the serial port according to the serial port identifier;
determining the full path of the identification equipment to be acquired according to the serial port position path;
acquiring the equipment identifier of the equipment to be identified according to the full path;
the determining the full path of the identification device to be acquired according to the serial port position path includes:
acquiring device position paths of second terminal devices connected with the first terminal device, wherein the number of the second terminal devices is at least two;
judging whether the equipment position path matched with the serial port position path exists or not;
if so, taking the equipment position path successfully matched as a target equipment position path;
and acquiring a full path corresponding to the position path of the target equipment as the full path of the identification equipment to be acquired.
In the method for acquiring the device identifier provided by the application, the first terminal device comprises at least one serial port, and before acquiring the identifier acquisition instruction, the method further comprises:
determining serial port identifiers of each serial port to obtain at least one serial port identifier;
and establishing a data table according to the at least one serial port identifier and the serial port, wherein the data table stores the association relation between each serial port and the corresponding serial port identifier.
In the method for acquiring the equipment identifier provided by the application, the equipment identifier is acquired according to a full path, and the method specifically comprises the following steps:
and calling a preset function by taking the full path as a parameter to acquire the equipment identifier.
In the method for acquiring the device identifier provided by the application, the acquisition of the serial port position path of the corresponding serial port according to the serial port identifier comprises the following steps:
and calling a library function by taking the serial port identifier as a parameter to acquire a serial port position path.
The application also provides a device identifier obtaining device, which is applied to the first terminal device and comprises:
the first acquisition module is used for acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of the identification equipment to be acquired;
the second acquisition module is used for acquiring a serial port position path corresponding to the serial port according to the serial port identifier;
the first determining module is used for determining the full path of the identification equipment to be acquired according to the serial port position path;
and the third acquisition module is used for acquiring the equipment identifier of the equipment to be identified according to the full path.
In the device identifier obtaining apparatus provided by the present application, the first determining module specifically includes:
and the fourth acquisition submodule is used for acquiring the equipment position paths of the second terminal equipment connected with the first terminal equipment, and the number of the second terminal equipment is at least two.
The judging submodule is used for judging whether the equipment path matched with the serial port position path exists or not;
the second determining submodule is used for taking the equipment position path successfully matched as a target equipment position path if the equipment position path exists;
and a fifth acquisition sub-module, configured to acquire a full path corresponding to the target device location path, as the full path of the to-be-acquired identification device.
In the device identifier obtaining apparatus provided by the present application, the device identifier obtaining apparatus further includes:
the third determining module is used for determining the serial port identifier of each serial port before the first obtaining module obtains the identifier obtaining instruction;
and the table building module is used for building a data table according to the at least one serial port identifier and the serial ports, and the data table stores the association relation between each serial port and the corresponding serial port identifier.
The application also provides a terminal device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the steps of the device identifier acquisition method according to any one of the above steps when executing the computer program.
The present application also provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the device identification acquisition method of any one of the above.
The beneficial effects of the application are as follows: the application discloses a device identifier acquisition method, which is applied to first terminal equipment and comprises the following steps: and acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of the identification equipment to be acquired, acquiring a serial port position path corresponding to the serial port according to the serial port identification, determining a full path of the identification equipment to be acquired according to the serial port position path, and finally acquiring the equipment identification of the identification equipment to be acquired according to the full path. According to the method and the device, the full path of the identification device to be acquired is determined through the position path of the serial port, so that the device identification of the identification device to be acquired is acquired according to the full path, and the problem that the device identification of a single device cannot be acquired when a plurality of devices are simultaneously accessed to a computer is effectively solved.
Drawings
The technical solution and other advantageous effects of the present application will be made apparent by the following detailed description of the specific embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is an application scenario schematic diagram of a device identifier obtaining method provided in an embodiment of the present application.
Fig. 2 is a flowchart of a method for obtaining a device identifier according to an embodiment of the present application.
Fig. 3 is another flow chart of a method for obtaining a device identifier according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of an apparatus for acquiring a device identifier according to an embodiment of the present application.
Fig. 5 is another schematic structural diagram of an apparatus for acquiring a device identifier according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Fig. 7 is another schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
The embodiment of the application provides a device identifier acquisition method, a device, terminal equipment and a storage medium.
Referring to fig. 1, fig. 1 provides a schematic application scenario of an apparatus identifier obtaining system, where the apparatus identifier obtaining system may include any one of the apparatus identifier obtaining devices provided in the embodiment of the present application, and the apparatus identifier obtaining device may be integrated in a first terminal device, where the first terminal device is typically a computer.
The first terminal equipment can acquire an identification acquisition instruction, the identification acquisition instruction carries a serial port identification of the identification equipment to be acquired, a serial port position path corresponding to the serial port is acquired according to the serial port identification, then a full path of the identification equipment to be acquired is determined according to the serial port position path, and finally, the equipment identification of the identification equipment to be acquired is acquired according to the full path.
For example, referring to fig. 1, four second terminal devices are simultaneously connected to the first terminal device, when we need to acquire the device identifier of one of the second terminal devices (for example, the second terminal device counted from top to bottom), the first terminal device acquires an identifier acquisition instruction, where the identifier acquisition instruction carries the serial port identifier of the identifier device to be acquired (for example, the serial port identifier of the second serial port counted from top to bottom), then acquires the serial port position path of the corresponding serial port according to the serial port identifier, then determines the full path of the identifier device to be acquired according to the serial port position path, and finally acquires the device identifier (A2) of the identifier device to be acquired according to the full path.
Fig. 2 is a flow chart of a device identifier obtaining method according to an embodiment of the present application, where the device identifier obtaining method is applied to a first terminal device, and the first terminal device is typically a computer. The specific flow of the method for acquiring the device identifier provided in this embodiment may be as follows:
s101, acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of identification equipment to be acquired.
Specifically, the first terminal device comprises at least one serial port, and the second terminal device is connected to the first terminal device through the serial port. A Serial Interface (Serial Interface), which is also called a Serial communication Interface or a Serial communication Interface (commonly referred to as COM Interface), is an expansion Interface adopting a Serial communication system. The serial interface is used for sequentially transmitting data bit by bit, and is characterized by simple communication line, and can realize two-way communication by only one pair of transmission lines (telephone lines can be directly used as transmission lines), thereby greatly reducing the cost, being particularly suitable for long-distance communication, but having slower transmission speed, such as USB (Universal Serial Bus ). Before step S101, the method further includes the following steps:
1-1, determining a serial port identifier of each serial port to obtain at least one serial port identifier;
and 1-2, establishing a data table according to at least one serial port identifier and the serial port, wherein the data table stores the association relation between each serial port and the corresponding serial port identifier.
Specifically, when the first terminal device is a PC (Personal Computer ), the data table is a registry of the PC, that is, no table is needed to be built, but the registry needs to be locked, and the locking is that each serial port has a unique serial port identifier, if the locking is not performed, the serial port identifiers may be different when different second terminal devices are connected to a serial port of the first terminal device.
S102, acquiring a serial port position path corresponding to the serial port according to the serial port identifier.
In this embodiment, step S102 specifically includes:
and calling a library function by taking the serial port identifier as a parameter to acquire a serial port position path.
Specifically, the library functions herein are API (Application Programming Interface, application program interface) functions, are predefined functions, or refer to conventions by which different components of the software system are joined. The objective is to provide the application and developer the ability to access a set of routines based on some software or hardware without having to access the native code or understand the details of the internal operating mechanisms.
S103, determining the full path of the identification equipment to be acquired according to the serial port position path.
In this embodiment, step S103 specifically includes the following substeps:
2-1, acquiring device position paths of second terminal devices connected with the first terminal device, wherein the number of the second terminal devices is at least two.
2-2, judging whether a device position path matched with the serial port position path exists or not;
2-3, if the equipment position path exists, taking the successfully matched equipment position path as a target equipment position path;
and 2-4, acquiring a full path corresponding to the position path of the target equipment, and taking the full path as the full path of the identification equipment to be acquired.
Specifically, whether the device position path matched with the serial port position path exists or not is judged, namely whether the device position path identical with the serial port position path exists or not is judged.
S104, acquiring the equipment identification of the equipment to be identified according to the full path.
In this embodiment, step S104 specifically includes: and calling a preset function by taking the full path as a parameter to acquire the equipment identifier, wherein the preset function is a library function.
As can be seen from the foregoing, the method for acquiring a device identifier provided in this embodiment is applied to a first terminal device, and includes: and acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of the identification equipment to be acquired, acquiring a serial port position path corresponding to the serial port according to the serial port identification, determining a full path of the identification equipment to be acquired according to the serial port position path, and finally acquiring the equipment identification of the identification equipment to be acquired according to the full path. According to the method and the device, the full path of the identification device to be acquired is determined through the position path of the serial port, so that the device identification of the identification device to be acquired is acquired according to the full path, and the problem that the device identification of a single device cannot be acquired when a plurality of devices are simultaneously accessed to a computer is effectively solved.
Fig. 3 is a schematic flow chart of an apparatus identifier obtaining method according to an embodiment of the present application, where the apparatus identifier obtaining method is applied to a first terminal device, and the first terminal device is typically a computer. The specific flow of the method for acquiring the device identifier provided in this embodiment may be as follows:
s201, determining serial port identifiers of each serial port to obtain at least one serial port identifier.
Specifically, the first terminal device comprises at least one serial port, and the second terminal device is connected to the first terminal device through the serial port. A Serial Interface (Serial Interface), which is also called a Serial communication Interface or a Serial communication Interface (commonly referred to as COM Interface), is an expansion Interface adopting a Serial communication system. The serial interface is used for sequentially transmitting data bit by bit, and is characterized by simple communication line, and can realize two-way communication by only one pair of transmission lines (telephone lines can be directly used as transmission lines), thereby greatly reducing the cost, being particularly suitable for long-distance communication, but having slower transmission speed, such as USB (Universal Serial Bus ).
S202, a data table is established according to at least one serial port identifier and the serial ports, and the association relation between each serial port and the corresponding serial port identifier is stored in the data table.
Specifically, when the first terminal device is a PC (Personal Computer ), the data table is a registry of the PC, that is, no table is needed to be built, but the registry needs to be locked, and the locking is that each serial port has a unique serial port identifier, if the locking is not performed, the serial port identifiers may be different when different second terminal devices are connected to a serial port of the first terminal device.
S203, acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of the identification equipment to be acquired.
S204, acquiring a serial port position path corresponding to the serial port according to the serial port identification.
Specifically, step S204 specifically includes:
and calling a library function by taking the serial port identifier as a parameter to acquire a serial port position path.
Specifically, the library functions herein are API (Application Programming Interface, application program interface) functions, are predefined functions, or refer to conventions by which different components of the software system are joined. The objective is to provide the application and developer the ability to access a set of routines based on some software or hardware without having to access the native code or understand the details of the internal operating mechanisms.
S205, acquiring device position paths of second terminal devices connected with the first terminal device, wherein the number of the second terminal devices is at least two.
S206, judging whether a device position path matched with the serial port position path exists.
Specifically, whether the device position path matched with the serial port position path exists or not is judged, namely whether the device position path identical with the serial port position path exists or not is judged.
S207, if the device position path exists, the device position path successfully matched is used as a target device position path.
S208, acquiring a full path corresponding to the position path of the target equipment, and taking the full path as the full path of the identification equipment to be acquired.
S209, acquiring the equipment identification of the equipment to be identified according to the full path.
In this embodiment, step S209 specifically includes: and calling a preset function by taking the full path as a parameter to acquire the equipment identifier, wherein the preset function is a library function.
As can be seen from the foregoing, the method for acquiring a device identifier provided in this embodiment is applied to a first terminal device, and includes: determining serial port identifiers of each serial port to obtain at least one serial port identifier, establishing a data table according to the at least one serial port identifier and the serial port identifier, storing an association relation between each serial port and the corresponding serial port identifier in the data table, acquiring an identifier acquisition instruction, wherein the identifier acquisition instruction carries the serial port identifier of the identifier to be acquired, acquiring a serial port position path corresponding to the serial port according to the serial port identifier, acquiring device position paths of second terminal devices connected with the first terminal device, judging whether the device position paths matched with the serial port position paths exist or not, taking the successfully matched device position paths as target device position paths if the device position paths exist, acquiring a full path corresponding to the target device position paths as a full path of the identifier to be acquired, and finally acquiring the device identifier of the identifier to be acquired according to the full path, thereby effectively solving the problem that the device identifier of a single device cannot be acquired when a plurality of devices are simultaneously connected with a computer.
The method according to the above embodiment will be further described from the perspective of a device identifier obtaining apparatus, which may be implemented as a separate entity, or may be implemented as an integrated electronic device, such as a terminal, which may be a computer or the like.
Referring to fig. 4, fig. 4 specifically illustrates an apparatus for acquiring a device identifier according to an embodiment of the present application, which is applied to a first terminal device, and the first terminal device is typically a computer. The device identifier obtaining apparatus may include: a first acquisition module 10, a second acquisition module 20, a first determination module 30, and a third acquisition module 40, wherein:
(1) First acquisition module 10
The first obtaining module 10 is configured to obtain an identifier obtaining instruction, where the identifier obtaining instruction carries a serial port identifier of an identifier device to be obtained.
Specifically, the first terminal device comprises at least one serial port, and the second terminal device is connected to the first terminal device through the serial port. A Serial Interface (Serial Interface), which is also called a Serial communication Interface or a Serial communication Interface (commonly referred to as COM Interface), is an expansion Interface adopting a Serial communication system. The serial interface is used for sequentially transmitting data bit by bit, and is characterized by simple communication line, and can realize two-way communication by only one pair of transmission lines (telephone lines can be directly used as transmission lines), thereby greatly reducing the cost, being particularly suitable for long-distance communication, but having slower transmission speed, such as USB (Universal Serial Bus ).
In this embodiment, the device identifier obtaining apparatus further includes a third determining module (not shown in the figure) and a table building module (not shown in the figure).
And a third determination module: for determining serial port identification of each serial port before the first acquisition module 10 acquires the identification acquisition instruction.
And the table building module is used for building a data table according to at least one serial port identifier and the serial port, and the data table stores the association relation between each serial port and the corresponding serial port identifier.
Specifically, when the first terminal device is a PC (Personal Computer ), the data table is a registry of the PC, that is, no table is needed to be built, but the registry needs to be locked, and the locking is that each serial port has a unique serial port identifier, if the locking is not performed, the serial port identifiers may be different when different second terminal devices are connected to a serial port of the first terminal device.
(2) Second acquisition module 20
The second obtaining module 20 is configured to obtain a serial port location path corresponding to the serial port according to the serial port identifier.
Specifically, the "acquiring the serial port position path of the corresponding serial port according to the serial port identifier" specifically includes:
and calling a library function to acquire a serial port position path.
Specifically, the library functions herein are API (Application Programming Interface, application program interface) functions, are predefined functions, or refer to conventions by which different components of the software system are joined. The objective is to provide the application and developer the ability to access a set of routines based on some software or hardware without having to access the native code or understand the details of the internal operating mechanisms.
(3) First determination module 30
The first determining module 30 is configured to determine a full path of the identification device to be acquired according to the serial port location path.
Referring to fig. 5, fig. 5 is another schematic structural diagram of an apparatus identifier obtaining device according to an embodiment of the present application, in this embodiment, the first determining module 30 may specifically include:
a fourth obtaining sub-module 31, configured to obtain a device location path of a second terminal device connected to the first terminal device, where the number of the second terminal devices is at least two.
The judging submodule 32 is configured to judge whether a device location path matching the serial location path exists.
A second determining submodule 33 is configured to take the device location path successfully matched as the target device location path if the device location path exists.
And a fifth acquiring sub-module 34, configured to acquire a full path corresponding to the target device location path as the full path of the identification device to be acquired.
Specifically, whether the device position path matched with the serial port position path exists or not is judged, namely whether the device position path identical with the serial port position path exists or not is judged.
(4) Third acquisition module 40
And a third acquiring module 40, configured to acquire the device identifier of the device to be identified according to the full path.
Specifically, the above-mentioned "acquiring the device identifier of the identifying device to be acquired according to the full path" includes: and calling a preset function by taking the full path as a parameter to acquire the equipment identifier, wherein the preset function is a library function.
In the implementation, each module may be implemented as an independent entity, or may be combined arbitrarily, and implemented as the same entity or several entities, and the implementation of each module may be referred to the foregoing method embodiment, which is not described herein again.
As can be seen from the foregoing, the device identifier obtaining apparatus provided in this embodiment is applied to a first terminal device, and includes: the first obtaining module 10 obtains an identifier obtaining instruction, where the identifier obtaining instruction carries a serial port identifier of an identifier device to be obtained, then the second obtaining module 20 obtains a serial port position path corresponding to the serial port according to the serial port identifier, the first determining module 30 determines a full path of the identifier device to be obtained according to the serial port position path, and finally the third obtaining module 40 obtains the device identifier of the identifier device to be obtained according to the full path. The method and the device effectively solve the problem that the device identification of a single device cannot be acquired when a plurality of devices are simultaneously accessed into a computer.
In addition, the embodiment of the application also provides terminal equipment. As shown in fig. 6, the terminal device 500 includes a processor 501, a memory 502. The processor 501 is electrically connected to the memory 502.
The processor 501 is a control center of the terminal device 500, connects various parts of the entire terminal device using various interfaces and lines, and performs various functions of the terminal device and processes data by running or loading application programs stored in the memory 502 and calling data stored in the memory 502, thereby performing overall monitoring of the terminal device.
In this embodiment, the processor 501 in the terminal device 500 loads instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 executes the application programs stored in the memory 502, so as to implement various functions:
acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of identification equipment to be acquired;
acquiring a serial port position path corresponding to the serial port according to the serial port identifier;
determining a full path of the identification equipment to be acquired according to the serial port position path;
and acquiring the equipment identification of the equipment to be identified according to the full path.
Fig. 7 shows a specific block diagram of a terminal device according to an embodiment of the present application, where the terminal device may be used to implement the device identifier obtaining method provided in the foregoing embodiment. The terminal device 300 may be a computer.
The RF circuit 310 is configured to receive and transmit electromagnetic waves, and to perform mutual conversion between the electromagnetic waves and the electrical signals, thereby communicating with a communication network or other devices. RF circuitry 310 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and the like. The RF circuitry 310 may communicate with various networks such as the internet, intranets, wireless networks, or other devices via wireless networks. The wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network. The wireless network may use various communication standards, protocols, and technologies including, but not limited to, global system for mobile communications (Global System for Mobile Communication, GSM), enhanced mobile communications technology (Enhanced Data GSM Environment, EDGE), wideband code division multiple access technology (Wideband Code Division Multiple Access, WCDMA), code division multiple access technology (Code Division Access, CDMA), time division multiple access technology (Time Division Multiple Access, TDMA), wireless fidelity technology (Wireless Fidelity, wi-Fi) (e.g., institute of electrical and electronics engineers standards IEEE 802.11a,IEEE 802.11b,IEEE802.11g and/or IEEE802.11 n), internet telephony (Voice over Internet Protocol, voIP), worldwide interoperability for microwave access (Worldwide Interoperability for Microwave Access, wi-Max), other protocols for mail, instant messaging, and short messaging, as well as any other suitable communication protocols, even including those not currently developed.
The memory 320 may be used to store software programs and modules, such as the device identification acquisition method and corresponding program instructions/modules in the above embodiments, and the processor 380 executes the software programs and modules stored in the memory 320, thereby performing various functional applications and data processing, i.e., implementing network search functions. Memory 320 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 320 may further include memory remotely located relative to processor 380, which may be connected to terminal device 300 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input unit 330 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 330 may include a touch-sensitive surface 331 as well as other input devices 332. The touch-sensitive surface 331, also referred to as a touch display screen or a touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch-sensitive surface 331 or thereabout using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 331 may comprise two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 380, and can receive and execute commands sent from the processor 380. In addition, the touch-sensitive surface 331 may be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 331, the input unit 330 may also comprise other input devices 332. In particular, other input devices 332 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 340 may be used to display information input by a user or information provided to the user and various graphical user interfaces of the terminal device 300, which may be composed of graphics, text, icons, video, and any combination thereof. The display unit 340 may include a display panel 341, and optionally, the display panel 341 may be configured in the form of an LCD (Liquid Crystal Display ), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch sensitive surface 331 may overlay the display panel 341 and, upon detection of a touch operation thereon or thereabout by the touch sensitive surface 331, is communicated to the processor 380 to determine the type of touch event, and the processor 380 then provides a corresponding visual output on the display panel 341 based on the type of touch event. Although in fig. 7 the touch sensitive surface 331 and the display panel 341 are implemented as two separate components, in some embodiments the touch sensitive surface 331 may be integrated with the display panel 341 to implement the input and output functions.
The terminal device 300 may also include at least one sensor 350, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 341 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 341 and/or the backlight when the terminal device 300 moves to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and the direction when the mobile phone is stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the terminal device 300 are not described in detail herein.
Audio circuitry 360, speaker 361, and microphone 362 may provide an audio interface between a user and terminal device 300. The audio circuit 360 may transmit the received electrical signal converted from audio data to the speaker 361, and the electrical signal is converted into a sound signal by the speaker 361 and output; on the other hand, the microphone 362 converts the collected sound signals into electrical signals, receives the electrical signals from the audio circuit 360, converts the electrical signals into audio data, outputs the audio data to the processor 380 for processing, and transmits the audio data to, for example, another terminal via the RF circuit 310, or outputs the audio data to the memory 320 for further processing. Audio circuitry 360 may also include an ear bud jack to provide communication of the peripheral ear bud with terminal device 300.
The terminal device 300 may facilitate user email, web browsing, streaming media access, etc. via the transmission module 370 (e.g., wi-Fi module), which provides wireless broadband internet access to the user. Although fig. 7 shows the transmission module 370, it is understood that it does not belong to the essential constitution of the terminal device 300, and may be omitted entirely as needed within the scope of not changing the essence of the application.
Processor 380 is a control center of terminal device 300 that connects the various parts of the overall handset using various interfaces and lines, performs various functions of terminal device 300 and processes data by running or executing software programs and/or modules stored in memory 320, and invoking data stored in memory 320, thereby performing overall monitoring of the handset. Optionally, processor 380 may include one or more processing cores; in some embodiments, processor 380 may integrate an application processor that primarily processes operating systems, user interfaces, applications, etc., with a modem processor that primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 380.
The terminal device 300 also includes a power supply 390 (e.g., a battery) that provides power to the various components, and in some embodiments, may be logically coupled to the processor 380 via a power management system to perform functions such as managing charging, discharging, and power consumption via the power management system. The power supply 190 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal device 300 may further include a camera (such as a front camera, a rear camera), a bluetooth module, etc., which will not be described herein. In particular, in this embodiment, the display unit of the terminal device is a touch screen display, the terminal device further includes a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for:
acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of identification equipment to be acquired;
acquiring a serial port position path corresponding to the serial port according to the serial port identifier;
determining a full path of the identification equipment to be acquired according to the serial port position path;
and acquiring the equipment identification of the equipment to be identified according to the full path.
In the implementation, each module may be implemented as an independent entity, or may be combined arbitrarily, and implemented as the same entity or several entities, and the implementation of each module may be referred to the foregoing method embodiment, which is not described herein again.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, embodiments of the present application provide a computer-readable storage medium comprising terminal device-executable instructions. Wherein the terminal device executable instructions, when executed by the terminal device processor, perform the steps in any device identity acquisition method provided by the embodiments of the present application.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The instructions stored in the storage medium may perform steps in any one of the method for acquiring a device identifier provided in the embodiment of the present application, so that the beneficial effects that any one of the method for acquiring a device identifier provided in the embodiment of the present application can be achieved, which are detailed in the previous embodiments and are not described herein.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
In view of the foregoing, it will be evident to those skilled in the art that these embodiments are thus presented in terms of a preferred embodiment, and that these embodiments are not limited to the particular embodiments disclosed herein, as these embodiments are intended to be included within the scope of the application as defined by the following claims.

Claims (8)

1. The device identifier obtaining method is applied to a first terminal device and is characterized by comprising the following steps:
acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of identification equipment to be acquired;
acquiring a serial port position path corresponding to the serial port according to the serial port identifier;
determining the full path of the identification equipment to be acquired according to the serial port position path;
acquiring the equipment identifier of the equipment to be identified according to the full path;
the determining the full path of the identification device to be acquired according to the serial port position path includes:
acquiring device position paths of second terminal devices connected with the first terminal device, wherein the number of the second terminal devices is at least two;
judging whether the equipment position path matched with the serial port position path exists or not;
if so, taking the equipment position path successfully matched as a target equipment position path;
and acquiring a full path corresponding to the position path of the target equipment as the full path of the identification equipment to be acquired.
2. The apparatus identifier acquisition method according to claim 1, wherein the first terminal apparatus includes at least one serial port, and further comprising, before acquiring the identifier acquisition instruction:
determining serial port identifiers of each serial port to obtain at least one serial port identifier;
and establishing a data table according to the at least one serial port identifier and the serial port, wherein the data table stores the association relation between each serial port and the corresponding serial port identifier.
3. The method for acquiring the device identifier according to claim 1, wherein the acquiring the device identifier according to the full path specifically includes:
and calling a preset function by taking the full path as a parameter to acquire the equipment identifier.
4. The method for obtaining the device identifier according to claim 1, wherein obtaining the serial port location path of the corresponding serial port according to the serial port identifier includes:
and calling a library function by taking the serial port identifier as a parameter to acquire a serial port position path.
5. A device identifier obtaining apparatus applied to a first terminal device, wherein the device identifier obtaining apparatus includes:
the first acquisition module is used for acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of the identification equipment to be acquired;
the second acquisition module is used for acquiring a serial port position path corresponding to the serial port according to the serial port identifier;
the first determining module is used for determining the full path of the identification equipment to be acquired according to the serial port position path;
the third acquisition module is used for acquiring the equipment identifier of the equipment to be identified according to the full path;
the first determining module specifically includes:
a fourth obtaining submodule, configured to obtain device location paths of second terminal devices connected to the first terminal device, where the number of the second terminal devices is at least two;
the judging submodule is used for judging whether the equipment position path matched with the serial port position path exists or not;
the second determining submodule is used for taking the equipment position path successfully matched as a target equipment position path if the equipment position path exists;
and a fifth acquisition sub-module, configured to acquire a full path corresponding to the target device location path, as the full path of the to-be-acquired identification device.
6. The apparatus according to claim 5, characterized in that the apparatus further comprises:
the third determining module is used for determining the serial port identifier of each serial port before the first obtaining module obtains the identifier obtaining instruction;
and the table building module is used for building a data table according to the serial port identifiers and the serial ports, and the data table stores the association relation between each serial port and the corresponding serial port identifier.
7. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the device identity acquisition method according to any one of claims 1 to 4 when the computer program is executed.
8. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the device identity acquisition method of any one of claims 1 to 4.
CN201911205590.0A 2019-11-29 2019-11-29 Equipment identifier acquisition method, device, terminal equipment and storage medium Active CN111045737B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911205590.0A CN111045737B (en) 2019-11-29 2019-11-29 Equipment identifier acquisition method, device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911205590.0A CN111045737B (en) 2019-11-29 2019-11-29 Equipment identifier acquisition method, device, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111045737A CN111045737A (en) 2020-04-21
CN111045737B true CN111045737B (en) 2023-09-19

Family

ID=70234206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911205590.0A Active CN111045737B (en) 2019-11-29 2019-11-29 Equipment identifier acquisition method, device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111045737B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112733210B (en) * 2021-04-06 2021-07-09 北京芯盾时代科技有限公司 Equipment identifier obtaining method and device and computer readable storage medium
CN113965917B (en) * 2021-10-19 2024-04-02 深圳市元征科技股份有限公司 Communication method, device and terminal equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963950A (en) * 2010-09-30 2011-02-02 北京飞天诚信科技有限公司 Method for positioning USB port in connection of device
CN105391652A (en) * 2015-12-03 2016-03-09 武汉噢易云计算有限公司 USB equipment network sharing system and method based on USB redirection
CN107678984A (en) * 2017-09-26 2018-02-09 厦门市美亚柏科信息股份有限公司 USB port mapping method and computer-readable recording medium
CN108460271A (en) * 2016-12-09 2018-08-28 腾讯科技(深圳)有限公司 Terminal identification method and device
CN110457894A (en) * 2019-08-06 2019-11-15 惠州Tcl移动通信有限公司 Distribution method, device, storage medium and the terminal device of root authority
CN110472413A (en) * 2019-07-26 2019-11-19 Oppo广东移动通信有限公司 Device management method, device, storage medium and electronic equipment based on jenkins

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8966138B2 (en) * 2010-08-31 2015-02-24 Apple Inc. Communication between a host device and an accessory using multiple-endpoint identification

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963950A (en) * 2010-09-30 2011-02-02 北京飞天诚信科技有限公司 Method for positioning USB port in connection of device
CN105391652A (en) * 2015-12-03 2016-03-09 武汉噢易云计算有限公司 USB equipment network sharing system and method based on USB redirection
CN108460271A (en) * 2016-12-09 2018-08-28 腾讯科技(深圳)有限公司 Terminal identification method and device
CN107678984A (en) * 2017-09-26 2018-02-09 厦门市美亚柏科信息股份有限公司 USB port mapping method and computer-readable recording medium
CN110472413A (en) * 2019-07-26 2019-11-19 Oppo广东移动通信有限公司 Device management method, device, storage medium and electronic equipment based on jenkins
CN110457894A (en) * 2019-08-06 2019-11-15 惠州Tcl移动通信有限公司 Distribution method, device, storage medium and the terminal device of root authority

Also Published As

Publication number Publication date
CN111045737A (en) 2020-04-21

Similar Documents

Publication Publication Date Title
EP3454240A1 (en) Unlocking methods and related products
EP3654680B1 (en) Method for determining access method of mobile terminal, storage medium, and mobile terminal
CN109714476B (en) Data processing method and device, mobile terminal and storage medium
CN111277991B (en) Operator name display method and device, mobile terminal and storage medium
CN111045737B (en) Equipment identifier acquisition method, device, terminal equipment and storage medium
CN106936516B (en) Display screen display state control method, storage medium and terminal
CN111026457B (en) Hardware configuration method and device, storage medium and terminal equipment
CN112415367B (en) Drive chip abnormality detection method, drive chip abnormality detection device, electronic device and readable storage medium
CN110851014B (en) Touch recognition method and device, storage medium and terminal equipment
CN111064847B (en) False touch prevention method and device, storage medium and electronic equipment
CN112199246A (en) Terminal testing method and device, storage medium and mobile terminal
US10719926B2 (en) Image stitching method and electronic device
CN109947617B (en) Method, terminal and readable storage medium for monitoring display content of application interface
CN112261634B (en) Bluetooth transmission control method and device, terminal equipment and storage medium
CN112004240B (en) Radio frequency parameter configuration method, device, storage medium and mobile terminal
CN112867171B (en) WIFI connection method and device, storage medium and mobile terminal
CN110995324B (en) Bluetooth communication method, device, storage medium and terminal equipment
CN109831771B (en) Bluetooth searching method and device, mobile terminal and storage medium
CN113613310A (en) WIFI connection method and device, storage medium and mobile terminal
CN112130928A (en) Automatic searching method, device, equipment and storage medium for Linux system sound card
CN112486350A (en) Detection method and device for touch screen of mobile terminal, storage medium and mobile terminal
CN108073508B (en) Compatibility detection method and device
CN110849407A (en) Sensor testing method and device, storage medium and electronic equipment
CN110972220B (en) Wireless communication method, device, storage medium and terminal equipment
CN111031588B (en) Network searching method, device, terminal equipment and storage medium

Legal Events

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