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

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

Info

Publication number
CN111045737A
CN111045737A CN201911205590.0A CN201911205590A CN111045737A CN 111045737 A CN111045737 A CN 111045737A CN 201911205590 A CN201911205590 A CN 201911205590A CN 111045737 A CN111045737 A CN 111045737A
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.)
Granted
Application number
CN201911205590.0A
Other languages
Chinese (zh)
Other versions
CN111045737B (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

Images

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 obtaining method, which is applied to a first terminal device and comprises the following steps: acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of an identification device to be acquired, acquiring a serial port position path of a corresponding serial port according to the serial port identification, determining a full path of the identification device to be acquired according to the serial port position path, and finally acquiring the device identification of the identification device 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 connected to a computer is effectively solved.

Description

Equipment identifier acquisition method and device, terminal equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for acquiring a device identifier, a terminal device, and a storage medium.
Background
ADB (Android Debug Bridge) is a set of methods developed by google for debugging Android devices. When the android device is connected with the computer in the ADB mode, the computer end can find a device, and at the moment, the user can control the device by using the ADB tool.
When a plurality of devices are simultaneously connected to the computer, the ADB tool distinguishes each device through the device identification. The device identifier is obtained by using a traditional ADB instruction mode, and the device identifiers of all devices accessed to a computer can only be obtained at one time, but cannot be associated with each other, so that when one device needs to be used, the device identifier corresponding to the device cannot be determined, and the device identifier of a single device cannot be identified.
Disclosure of Invention
The embodiment of the application provides a method and a device for acquiring equipment identifiers, a mobile terminal and a storage medium, and aims to solve the problem that when a plurality of pieces of equipment are simultaneously connected to a computer, the equipment identifiers of the single piece of equipment cannot be acquired.
The technical scheme provided by the application is as follows:
the application provides a device identifier obtaining method, which is applied to a first terminal device 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 of a corresponding serial port according to the serial port identification;
determining the full path of the identification equipment to be obtained according to the serial port position path;
and acquiring the equipment identifier of the identification equipment to be acquired according to the full path.
In the device identifier obtaining method provided by the present application, the determining the full path of the identifier device to be obtained according to the serial port position path includes:
acquiring a device position path 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 yes, taking the successfully matched equipment position path 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 equipment to be acquired.
In the device identifier obtaining method provided by the present application, the first terminal device includes at least one serial port, and before obtaining the identifier obtaining instruction, the method further includes:
determining a serial port identifier 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 relationship between each serial port and the corresponding serial port identifier.
In the method for acquiring a device identifier provided by the present application, the acquiring a device identifier according to a full path specifically includes:
and calling a preset function by taking the full path as a parameter to acquire the equipment identifier.
In the device identifier obtaining method provided by the present application, obtaining a serial port position path of a corresponding serial port according to the serial port identifier includes:
and calling a library function by taking the serial port identification as a parameter so as to obtain a serial port position path.
The application further provides an apparatus for obtaining device identifier, which is applied to a first terminal device, and includes:
the first acquisition module is used for acquiring an identifier acquisition instruction, and the identifier acquisition instruction carries a serial port identifier of the identifier equipment to be acquired;
the second acquisition module is used for acquiring a serial port position path of the corresponding serial port according to the serial port identification;
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 identification equipment to be acquired according to the full path.
In the device identifier obtaining apparatus provided in the present application, the first determining module specifically includes:
and the fourth obtaining submodule is used for obtaining the device position path of the second terminal device connected with the first terminal device, and the number of the second terminal devices 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 successfully matched equipment position path as a target equipment position path if the equipment position path exists;
and the fifth obtaining submodule is used for obtaining 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 obtained.
In the device identifier obtaining apparatus provided in 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 acquiring module acquires the identifier acquiring 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 port, and the data table stores the association relationship 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 implements the steps of the device identifier obtaining method of any one of the above items when executing the computer program.
The present application further provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the device identifier obtaining method according to any one of the above.
The beneficial effect of this application does: the application discloses a device identifier obtaining method, which is applied to a first terminal device and comprises the following steps: acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of an identification device to be acquired, acquiring a serial port position path of a corresponding serial port according to the serial port identification, determining a full path of the identification device to be acquired according to the serial port position path, and finally acquiring the device identification of the identification device 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 connected to a computer is effectively solved.
Drawings
The technical solution and other advantages of the present application will become apparent from the detailed description of the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a schematic view of an application scenario of a device identifier obtaining method according to an embodiment of the present application.
Fig. 2 is a schematic flowchart of a device identifier obtaining method according to an embodiment of the present application.
Fig. 3 is another schematic flow chart of the method for acquiring a device identifier according to the embodiment of the present application.
Fig. 4 is a schematic structural diagram of an apparatus identifier obtaining device according to an embodiment of the present application.
Fig. 5 is another schematic structural diagram of an apparatus for acquiring 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 technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a method and a device for acquiring a device identifier, a terminal device and a storage medium.
Referring to fig. 1, fig. 1 provides a schematic view of an application scenario of an equipment identifier obtaining system, where the equipment identifier obtaining system may include any one of the equipment identifier obtaining apparatuses provided in the embodiments of the present application, and the equipment identifier obtaining apparatus may be integrated in a first terminal device, where the first terminal device is usually a computer.
The first terminal device can obtain an identification obtaining instruction, the identification obtaining instruction carries a serial port identification of the identification device to be obtained, then a serial port position path of the corresponding serial port is obtained according to the serial port identification, then a full path of the identification device to be obtained is determined according to the serial port position path, and finally the device identification of the identification device to be obtained is obtained according to the full path.
For example, please refer to fig. 1, four second terminal devices are simultaneously connected to a first terminal device, when we need to obtain a device identifier of one of the second terminal devices (for example, a second terminal device counting from top to bottom), the first terminal device obtains an identifier obtaining instruction, where the identifier obtaining instruction carries a serial identifier of the identifier device to be obtained (for example, a serial identifier of a second serial port counting from top to bottom), then obtains a serial port position path of a corresponding serial port according to the serial identifier, then determines a full path of the identifier device to be obtained according to the serial port position path, and finally obtains the device identifier of the identifier device to be obtained according to the full path (a 2).
As shown in fig. 2, fig. 2 is a schematic flowchart of an apparatus identifier obtaining method provided in 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 process of the device identifier obtaining method provided by 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 includes at least one serial port, and the second terminal device is connected to the first terminal device through the serial port. Serial interfaces, i.e., Serial interfaces (Serial interfaces), also called Serial communication interfaces or Serial communication interfaces (generally referred to as COM interfaces), are extended interfaces that use Serial communication. The serial interface means data transmission sequentially one bit by one bit, and is characterized in that a communication line is simple, bidirectional communication can be realized only by one pair of transmission lines (a telephone line can be directly used as the transmission line), so that the cost is greatly reduced, and the serial interface is particularly suitable for remote communication, but has a slow transmission speed, such as Universal Serial Bus (USB). Before step S101, the following steps are further included:
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 identification and the serial port, wherein the data table stores the association relation between each serial port and the corresponding serial port identification.
Specifically, when the first terminal device is a PC (Personal Computer), the data table is a registry of the PC, that is, a table does not need to be built, but a locking port needs to be performed on the registry, the locking port is a serial port identifier that each serial port has unique determination, and if the locking port is not performed, when different second terminal devices are connected to a certain serial port of the first terminal device, the serial port identifiers may be different.
And S102, acquiring a serial port position path of the corresponding serial port according to the serial port identification.
In this embodiment, step S102 specifically includes:
and calling a library function by taking the serial port identification as a parameter so as to obtain a serial port position path.
Specifically, the library function is an API (Application Programming Interface) function, which is a predefined function or a convention for linking different components of a software system. The goal is to provide applications and developers the ability to access a set of routines based on certain software or hardware without having to access native code or understand the details of the internal workings.
S103, determining a full path of the identification equipment to be acquired according to the serial port position path.
In this embodiment, the step S103 specifically includes the following sub-steps:
and 2-1, acquiring a device position path of second terminal equipment connected with the first terminal equipment, wherein the number of the second terminal equipment is at least two.
2-2, judging whether an equipment position path matched with the serial port position path exists or not;
2-3, if the matching is successful, 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 as the full path of the identification equipment to be acquired.
Specifically, it is determined whether an apparatus location path matching the serial port location path exists, that is, whether an apparatus location path identical to the serial port location path exists is determined.
And S104, acquiring the equipment identifier of the identification equipment to be acquired 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 above, the method for acquiring a device identifier provided in this embodiment is applied to a first terminal device, and includes: acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries a serial port identification of an identification device to be acquired, acquiring a serial port position path of a corresponding serial port according to the serial port identification, determining a full path of the identification device to be acquired according to the serial port position path, and finally acquiring the device identification of the identification device 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 connected to a computer is effectively solved.
Please refer to fig. 3, and fig. 3 is another schematic flow chart of the method for acquiring an equipment identifier according to the embodiment of the present application, where the method for acquiring an equipment identifier is applied to a first terminal device, and the first terminal device is usually a computer. The specific process of the device identifier obtaining method provided by this embodiment may be as follows:
s201, determining a serial port identifier of each serial port to obtain at least one serial port identifier.
Specifically, the first terminal device includes at least one serial port, and the second terminal device is connected to the first terminal device through the serial port. Serial interfaces, i.e., Serial interfaces (Serial interfaces), also called Serial communication interfaces or Serial communication interfaces (generally referred to as COM interfaces), are extended interfaces that use Serial communication. The serial interface means data transmission sequentially one bit by one bit, and is characterized in that a communication line is simple, bidirectional communication can be realized only by one pair of transmission lines (a telephone line can be directly used as the transmission line), so that the cost is greatly reduced, and the serial interface is particularly suitable for remote communication, but has a slow transmission speed, such as Universal Serial Bus (USB).
S202, establishing a data table according to at least one serial port identification and the serial port, wherein the data table stores the association relation between each serial port and the corresponding serial port identification.
Specifically, when the first terminal device is a PC (Personal Computer), the data table is a registry of the PC, that is, a table does not need to be built, but a locking port needs to be performed on the registry, the locking port is a serial port identifier that each serial port has unique determination, and if the locking port is not performed, when different second terminal devices are connected to a certain serial port of the first terminal device, the serial port identifiers may be different.
S203, acquiring an identification acquisition instruction, wherein the identification acquisition instruction carries the serial port identification of the identification equipment to be acquired.
And S204, acquiring a serial port position path of the corresponding serial port according to the serial port identification.
Specifically, step S204 specifically includes:
and calling a library function by taking the serial port identification as a parameter so as to obtain a serial port position path.
Specifically, the library function is an API (Application Programming Interface) function, which is a predefined function or a convention for linking different components of a software system. The goal is to provide applications and developers the ability to access a set of routines based on certain software or hardware without having to access native code or understand the details of the internal workings.
S205, acquiring a device position path 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 an equipment position path matched with the serial port position path exists or not.
Specifically, it is determined whether an apparatus location path matching the serial port location path exists, that is, whether an apparatus location path identical to the serial port location path exists is determined.
And S207, if the matching exists, taking the successfully matched equipment position path as a target equipment position path.
And S208, acquiring a full path corresponding to the position path of the target equipment as the full path of the identification equipment to be acquired.
And S209, acquiring the equipment identifier of the identification equipment to be acquired 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 above, the method for acquiring a device identifier provided in this embodiment is applied to a first terminal device, and includes: determining a serial port identifier of each serial port to obtain at least one serial port identifier, then establishing a data table according to the at least one serial port identifier and the serial port, wherein the data table stores the association relationship between each serial port and the corresponding serial port identifier, then acquiring an identifier acquisition instruction which carries the serial port identifier of the identifier device to be acquired, then acquiring a serial port position path of the corresponding serial port according to the serial port identifier, then acquiring a device position path of a second terminal device connected with a first terminal device, wherein the number of the second terminal devices is at least two, then judging whether a device position path matched with the serial port position path exists, if so, taking the successfully matched device position path as a target device position path, then acquiring a full path corresponding to the target device position path as the full path of the identifier device to be acquired, and finally, acquiring the equipment identifier of the identification equipment to be acquired according to the full path, thereby effectively solving the problem that the equipment identifier of a single equipment cannot be acquired when a plurality of equipment are simultaneously accessed into the computer.
According to the method described in the foregoing embodiment, the embodiment will be further described from the perspective of an apparatus identifier obtaining device, where the apparatus identifier obtaining device may be specifically implemented as an independent entity, or may be implemented by being integrated in an electronic device, such as a terminal, and the terminal may be a computer or the like.
Referring to fig. 4, fig. 4 specifically illustrates an apparatus identifier obtaining device provided in the embodiment of the present application, which is applied to a first terminal device, where the first terminal device is usually a computer. The device identification acquisition means may include: a first obtaining module 10, a second obtaining module 20, a first determining module 30 and a third obtaining 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 identifier of an identifier device to be obtained.
Specifically, the first terminal device includes at least one serial port, and the second terminal device is connected to the first terminal device through the serial port. Serial interfaces, i.e., Serial interfaces (Serial interfaces), also called Serial communication interfaces or Serial communication interfaces (generally referred to as COM interfaces), are extended interfaces that use Serial communication. The serial interface means data transmission sequentially one bit by one bit, and is characterized in that a communication line is simple, bidirectional communication can be realized only by one pair of transmission lines (a telephone line can be directly used as the transmission line), so that the cost is greatly reduced, and the serial interface is particularly suitable for remote communication, but has a slow transmission speed, such as Universal Serial Bus (USB).
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).
A third determination module: the serial port identification determining module is configured to determine the serial port identification of each serial port before the first obtaining module 10 obtains the identification obtaining 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, a table does not need to be built, but a locking port needs to be performed on the registry, the locking port is a serial port identifier that each serial port has unique determination, and if the locking port is not performed, when different second terminal devices are connected to a certain serial port of the first terminal device, the serial port identifiers may be different.
(2) Second acquisition module 20
And the second obtaining module 20 is configured to obtain a serial port position path of the corresponding serial port according to the serial port identifier.
Specifically, the "obtaining 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 function is an API (Application Programming Interface) function, which is a predefined function or a convention for linking different components of a software system. The goal is to provide applications and developers the ability to access a set of routines based on certain software or hardware without having to access native code or understand the details of the internal workings.
(3) First determination module 30
The first determining module 30 is configured to determine a full path of the identification device to be obtained according to the serial port position path.
Referring to fig. 5, fig. 5 is another schematic structural diagram of the device identifier obtaining apparatus according to the embodiment of the present application, in this embodiment, the first determining module 30 may specifically include:
the fourth obtaining submodule 31 is 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.
And the judging submodule 32 is configured to judge whether an apparatus location path matching the serial port location path exists.
And a second determining submodule 33, configured to, if the target device location path exists, take the device location path successfully matched as the target device location path.
And the fifth obtaining sub-module 34 is configured to obtain a full path corresponding to the target device location path, as the full path of the to-be-obtained identification device.
Specifically, it is determined whether an apparatus location path matching the serial port location path exists, that is, whether an apparatus location path identical to the serial port location path exists is determined.
(4) Third acquisition module 40
And a third obtaining module 40, configured to obtain the device identifier of the identifier device to be obtained according to the full path.
Specifically, the "acquiring the device identifier of the identifier 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 specific implementation, the above modules may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and specific implementation of the above modules may refer to the foregoing method embodiments, which are not described herein again.
As can be seen from the above, the apparatus for acquiring device identifier 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 of a corresponding 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 problem that the device identification of a single device cannot be acquired when a plurality of devices are simultaneously connected to a computer is effectively solved.
In addition, the embodiment of the application also provides terminal equipment. As shown in fig. 6, the terminal device 500 includes a processor 501 and 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 by using various interfaces and lines, and executes various functions of the terminal device and processes data by running or loading an application program 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 processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 runs the application programs stored in the memory 502, thereby implementing 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 identification;
determining the full path of the identification equipment to be acquired according to the serial port position path;
and acquiring the equipment identifier of the identification equipment to be acquired according to the full path.
Fig. 7 shows a specific structural block diagram of a terminal device provided in 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 used for receiving and transmitting electromagnetic waves, and performing interconversion between the electromagnetic waves and 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 so forth. RF circuit 310 may communicate with various networks such as the internet, an intranet, a wireless network, or with other devices over a wireless network. The wireless network may comprise 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 Communication (GSM), Enhanced Mobile Communication (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (e.g., IEEE802.11a, IEEE802.11 b, IEEE802.11g and/or IEEE802.11 n), Internet telephony (Voice over Internet Protocol, VoIP), world wide Internet Microwave Access (Microwave for Wireless Communication), and other short message protocols, as well as any other suitable communication protocols, and may even include those that have not yet been developed.
The memory 320 may be used for storing software programs and modules, such as the device identifier obtaining method and the corresponding program instructions/modules in the above embodiments, and the processor 380 executes various functional applications and data processing, i.e. implementing the network searching function, by running the software programs and modules stored in the memory 320. The 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 located remotely from 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 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 screen or touch pad, may collect touch operations by a user on or near the touch-sensitive surface 331 (e.g., operations by a user on or near the touch-sensitive surface 331 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 331 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction 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 sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 380, and can receive and execute commands sent by the processor 380. In addition, the touch-sensitive surface 331 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. The input unit 330 may comprise other input devices 332 in addition to the touch sensitive surface 331. In particular, other input devices 332 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 340 may be used to display information input by or provided to the user and various graphic user interfaces of the terminal apparatus 300, which may be configured by 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, touch-sensitive surface 331 may overlay display panel 341, and when touch-sensitive surface 331 detects a touch operation thereon or thereabout, communicate to processor 380 to determine the type of touch event, and processor 380 then provides a corresponding visual output on display panel 341 in accordance with the type of touch event. Although in FIG. 7, touch-sensitive surface 331 and display panel 341 are implemented as two separate components for input and output functions, in some embodiments, touch-sensitive surface 331 and display panel 341 may be integrated for 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 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal device 300, detailed descriptions thereof are omitted.
Audio circuitry 360, speaker 361, microphone 362 may provide an audio interface between a user and terminal device 300. The audio circuit 360 may transmit the electrical signal converted from the received audio data to the speaker 361, and the audio signal is converted by the speaker 361 and output; on the other hand, the microphone 362 converts the collected sound signal into an electrical signal, which is received by the audio circuit 360 and converted into audio data, which is then processed by the audio data output processor 380 and then transmitted to, for example, another terminal via the RF circuit 310, or the audio data is output to the memory 320 for further processing. The audio circuit 360 may also include an earbud jack to provide communication of peripheral headphones with the terminal device 300.
The terminal device 300 may assist the user in e-mail, web browsing, streaming media access, etc. through the transmission module 370 (e.g., a Wi-Fi module), which provides the user with wireless broadband internet access. 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 not changing the essence of the invention.
The processor 380 is a control center of the terminal device 300, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the terminal device 300 and processes data by running or executing software programs and/or modules stored in the memory 320 and calling data stored in the memory 320, thereby performing overall monitoring of the mobile phone. Optionally, processor 380 may include one or more processing cores; in some embodiments, processor 380 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 380.
Terminal device 300 also includes a power supply 390 (e.g., a battery) for powering the various components, which may be logically coupled to processor 380 via a power management system in some embodiments to manage charging, discharging, and power consumption management functions via the power management system. The power supply 190 may also include any component including one or more of a dc or ac power source, 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 (e.g., a front camera, a rear camera), a bluetooth module, and the like, which are not described in detail herein. Specifically, 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, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include 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 identification;
determining the full path of the identification equipment to be acquired according to the serial port position path;
and acquiring the equipment identifier of the identification equipment to be acquired according to the full path.
In specific implementation, the above modules may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and specific implementation of the above modules may refer to the foregoing method embodiments, which are not described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present application provides a computer-readable storage medium including instructions executable by a terminal device. When executed by a terminal device processor, the terminal device executable instruction performs the steps of any one of the device identifier obtaining methods provided by the embodiments of the present application.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium may execute the steps in any device identifier obtaining method provided in the embodiment of the present invention, beneficial effects that can be achieved by any device identifier obtaining method provided in the embodiment of the present invention may be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
In summary, although the present application has been described with reference to the preferred embodiments, the above-described preferred embodiments are not intended to limit the present application, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application, so that the scope of the present application shall be determined by the appended claims.

Claims (10)

1. An apparatus identifier obtaining method is applied to a first terminal apparatus, and is characterized in that the apparatus identifier obtaining method includes:
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 of a corresponding serial port according to the serial port identification;
determining the full path of the identification equipment to be obtained according to the serial port position path;
and acquiring the equipment identifier of the identification equipment to be acquired according to the full path.
2. The method for acquiring the device identifier according to claim 1, wherein the determining the full path of the identifier device to be acquired according to the serial port position path includes:
acquiring a device position path 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 yes, taking the successfully matched equipment position path 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.
3. The device identifier obtaining method according to claim 1, wherein the first terminal device includes at least one serial port, and before obtaining the identifier obtaining instruction, the method further includes:
determining a serial port identifier 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 relationship between each serial port and the corresponding serial port identifier.
4. 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.
5. The method for obtaining the device identifier according to claim 1, wherein the obtaining the serial port position path of the corresponding serial port according to the serial port identifier includes:
and calling a library function by taking the serial port identification as a parameter so as to obtain a serial port position path.
6. An apparatus for obtaining device identifier is applied to a first terminal device, and the apparatus for obtaining device identifier comprises:
the first acquisition module is used for acquiring an identifier acquisition instruction, and the identifier acquisition instruction carries a serial port identifier of the identifier equipment to be acquired;
the second acquisition module is used for acquiring a serial port position path of the corresponding serial port according to the serial port identification;
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 identification equipment to be acquired according to the full path.
7. The device identifier obtaining apparatus according to claim 6, wherein the first determining module specifically includes:
and the fourth obtaining submodule is used for obtaining the device position path of the second terminal device connected with the first terminal device, and the number of the second terminal devices 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 successfully matched equipment position path as a target equipment position path if the equipment position path exists;
and the fifth obtaining submodule is used for obtaining 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 obtained.
8. The apparatus according to claim 6, wherein the apparatus identifier obtaining apparatus further comprises:
the third determining module is used for determining the serial port identifier of each serial port before the first acquiring module acquires the identifier acquiring 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 port, and the data table stores the association relationship between each serial port and the corresponding serial port identifier.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the device identification acquisition method according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the device identification acquisition method of any one of claims 1 to 5.
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 true CN111045737A (en) 2020-04-21
CN111045737B 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)

Cited By (2)

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

Citations (7)

* 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
US20130145057A1 (en) * 2010-08-31 2013-06-06 Apple Inc. Communication between a host device and an accessory using multiple-endpoint identification
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

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130145057A1 (en) * 2010-08-31 2013-06-06 Apple Inc. Communication between a host device and an accessory using multiple-endpoint identification
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

Cited By (4)

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

Also Published As

Publication number Publication date
CN111045737B (en) 2023-09-19

Similar Documents

Publication Publication Date Title
WO2018166204A1 (en) Method for controlling fingerprint recognition module, and mobile terminal and storage medium
CN111277991B (en) Operator name display method and device, mobile terminal and storage medium
CN111651030B (en) Sensor detection method and device, storage medium and mobile terminal
CN111045737A (en) Equipment identifier acquisition method and device, terminal equipment and storage medium
CN110830127A (en) Radio frequency parameter processing method and device, mobile terminal and storage medium
CN111026457B (en) Hardware configuration method and device, storage medium and terminal equipment
CN111064847B (en) False touch prevention method and device, storage medium and electronic equipment
CN110851014B (en) Touch recognition method and device, storage medium and terminal equipment
CN112199246A (en) Terminal testing method and device, storage medium and mobile terminal
CN115348256A (en) Posting data downloading method and device, storage medium and electronic equipment
CN112486350B (en) Detection method and device for touch screen of mobile terminal, storage medium and mobile terminal
CN110995324B (en) Bluetooth communication method, device, storage medium and terminal equipment
CN111083288B (en) Screen control method and device, terminal equipment and storage medium
CN109831770B (en) Pairing method and device of mobile terminal, storage medium and mobile terminal
CN109831771B (en) Bluetooth searching method and device, mobile terminal and storage medium
CN110618798A (en) Multi-screen display method, multi-screen device, storage medium and terminal equipment
CN105988801B (en) Method and device for displaying annotation information
CN105278967B (en) System updating method, device and system of mobile terminal
CN110972220B (en) Wireless communication method, device, storage medium and terminal equipment
CN109995441B (en) Communication information processing method, device and storage medium
CN111026488B (en) Communication data saving method, device, terminal equipment and storage medium
CN111182141B (en) Method, device and storage medium for acquiring state of terminal device
CN114721785B (en) Configuration method, device, equipment and storage medium of software application library of virtual machine
CN112367701B (en) Mobile terminal control method, device, storage medium and mobile terminal
CN111651313B (en) Conversion method and system of identification card, storage medium and terminal equipment

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