CN110008758B - ID obtaining method and device, electronic equipment and storage medium - Google Patents

ID obtaining method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110008758B
CN110008758B CN201910252988.3A CN201910252988A CN110008758B CN 110008758 B CN110008758 B CN 110008758B CN 201910252988 A CN201910252988 A CN 201910252988A CN 110008758 B CN110008758 B CN 110008758B
Authority
CN
China
Prior art keywords
target
target device
equipment
preset
storage space
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
CN201910252988.3A
Other languages
Chinese (zh)
Other versions
CN110008758A (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.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201910252988.3A priority Critical patent/CN110008758B/en
Publication of CN110008758A publication Critical patent/CN110008758A/en
Application granted granted Critical
Publication of CN110008758B publication Critical patent/CN110008758B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • G06F21/77Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information in smart cards
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Abstract

The embodiment of the invention provides an identification obtaining method and device, electronic equipment and a storage medium. The scheme is as follows: detecting whether a read permission aiming at an external storage space of a target device exists, if the read permission aiming at the external storage space does not exist, determining whether a preset application is installed in the target device, wherein the preset application comprises a target port used for acquiring a device ID of the device, and if the preset application is installed, acquiring the device ID of the target device from the target port as the target ID based on interprocess communication between the preset application and other applications installed in the target device. According to the technical scheme provided by the embodiment of the invention, under the condition that no read permission is given to the external storage space, the device ID is obtained from the target port for obtaining the device ID in the preset application in an inter-process communication mode, so that the device ID can be obtained under the condition that permission is not actively requested to the device, and the effectiveness of obtaining the device ID is improved.

Description

ID obtaining method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer application technologies, and in particular, to an ID obtaining method and apparatus, an electronic device, and a storage medium.
Background
In the application development process, an Identification (ID) of a device is often required to be obtained to identify the device.
At present, in order to avoid the problems that the randomly generated device ID is not stable enough and the device ID stored in the internal storage space is easy to be cleared or changed, the device ID may be generated according to a certain algorithm and stored in a Secure Digital (SD) card of the device. When the device ID of the device needs to be acquired, the device ID can be directly acquired from the SD card of the device. However, as the security awareness of users increases, the users can set the read authority of the SD card, which makes it impossible to obtain the stored device ID from the SD card without the read authority of the SD card.
Disclosure of Invention
An object of embodiments of the present invention is to provide an ID obtaining method, an ID obtaining apparatus, an electronic device, and a storage medium, so as to obtain a device ID stored in a device without actively requesting a permission from the device, and improve validity of obtaining the device ID. The specific technical scheme is as follows:
the embodiment of the invention provides an identification ID obtaining method, which comprises the following steps:
detecting whether the external storage space of the target device has read permission;
if the target device does not have the read permission for the external storage space, determining whether a preset application is installed in the target device, wherein the preset application comprises a target port for acquiring the device ID of the device;
and if the preset application is installed, acquiring the device ID of the target device from the target port as the target ID based on the interprocess communication between the preset application and other applications installed in the target device.
Optionally, the method further includes:
detecting whether a target ID of a target device exists in an internal storage space of the target device;
and if the target ID does not exist, executing the step of detecting whether the read permission of the external storage space of the target device exists.
Optionally, the method further includes:
and if the read permission aiming at the external storage space exists, acquiring the device ID stored in the external storage space as the target ID of the target device.
Optionally, the step of obtaining the device ID stored in the external storage space as the target ID of the target device includes:
acquiring a device ID stored in the external storage space;
performing tamper-proof verification on the obtained equipment ID;
and if the verification is passed, determining that the equipment ID is the target ID of the target equipment.
Optionally, the step of determining whether the target device has the preset application installed therein includes:
judging whether an installed application list of the target device comprises an identifier of the preset application or not, wherein the installed application list comprises the identifier of the installed application;
if the preset application identifier is included, determining that the preset application is installed in the target device;
and if the identifier of the preset application is not included, determining that the preset application is not installed in the target device.
Optionally, if the preset application is not installed, the method further includes:
acquiring identification information of the target equipment;
generating a target ID of the target equipment according to the identification information;
storing the target ID in an internal storage space and an external storage space of the target device.
Optionally, the step of generating the target ID of the target device according to the identification information includes:
determining whether the operating system version of the target device is a preset operating system version;
if the preset operating system version is available, generating a target ID of the target equipment according to the initial ID, equipment brand and equipment model of the target equipment;
and if the target device is not the preset operating system version, taking a preset identifier included in the target device as a target ID of the target device.
Optionally, if the target device does not include the preset identifier, the method further includes:
and generating the target ID of the target equipment according to the hardware serial number, the equipment brand and the equipment model of the target equipment.
Optionally, before generating the target ID of the target device according to the hardware serial number, the device brand, and the device model of the target device, the method further includes:
detecting whether the target device has write permission for the external storage space;
the step of generating the target ID of the target device according to the hardware serial number, the device brand, and the device model of the target device includes:
if the target device does not have the write permission aiming at the external storage space, generating a target ID of the target device according to the hardware serial number, the device brand and the device model of the target device;
and if the write permission aiming at the external storage space exists, generating a target ID of the target equipment according to a target character string, a hardware serial number of the target equipment, an equipment brand and an equipment model, wherein the target character string is generated according to a preset rule.
The embodiment of the present invention further provides an identifier ID obtaining apparatus, including:
the device comprises a first detection module, a second detection module and a control module, wherein the first detection module is used for detecting whether the device has read permission aiming at an external storage space of a target device;
a first determining module, configured to determine whether a preset application is installed in the target device when a detection result of the first detecting module is negative, where the preset application includes a target port for obtaining a device ID of the device;
a first obtaining module, configured to, when a determination result of the first determining module is yes, obtain, based on inter-process communication between the preset application and another application installed in the target device, a device ID of the target device from the target port as a target ID.
Optionally, the apparatus further comprises:
the second detection module is used for detecting whether the target ID of the target device exists in the internal storage space of the target device; and if the detection result of the second detection module is negative, executing the step of detecting whether the external storage space of the target device has the read permission.
Optionally, the apparatus further comprises:
and a second obtaining module, configured to, if a detection result of the first detecting module is yes, obtain the device ID stored in the external storage space as a target ID of the target device.
Optionally, the second obtaining module is specifically configured to obtain the device ID stored in the external storage space; performing tamper-proof verification on the obtained equipment ID; and if the verification is passed, determining that the equipment ID is the target ID of the target equipment.
Optionally, the first determining module is specifically configured to determine whether an installed application list of the target device includes an identifier of the preset application, where the installed application list includes the identifier of the installed application; if the preset application identifier is included, determining that the preset application is installed in the target device; and if the identifier of the preset application is not included, determining that the preset application is not installed in the target device.
Optionally, the apparatus further comprises:
a third obtaining module, configured to obtain, if the determination result of the first determining module is negative, the identification information of the target device;
a first generating module, configured to generate a target ID of the target device according to the identification information;
and the storage module is used for storing the target ID into the internal storage space and the external storage space of the target equipment.
Optionally, the first generating module is specifically configured to determine whether an os version of the target device is a preset os version; if the preset operating system version is available, generating a target ID of the target equipment according to the initial ID, equipment brand and equipment model of the target equipment; and if the target device is not the preset operating system version, taking a preset identifier included in the target device as a target ID of the target device.
Optionally, the apparatus further comprises:
and the second generation module is used for generating the target ID of the target equipment according to the hardware serial number, the equipment brand and the equipment model of the target equipment when the preset identification is not included in the target equipment.
Optionally, the apparatus further comprises:
the third detection module is used for detecting whether the target device has write permission aiming at the external storage space;
the second generating module is specifically configured to generate a target ID of the target device according to the hardware serial number, the device brand, and the device model of the target device if the detection result of the third detecting module is negative; and when the detection result of the third detection module is yes, generating a target ID of the target equipment according to a target character string, a hardware serial number of the target equipment, an equipment brand and an equipment model, wherein the target character string is a character string generated according to a preset rule.
The embodiment of the invention also provides electronic equipment, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and a processor for implementing any of the above-described ID acquisition method steps when executing the program stored in the memory.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the ID obtaining method described above are implemented.
An embodiment of the present invention further provides a computer program product including instructions, which when run on a computer, causes the computer to execute any one of the ID obtaining methods described above.
The ID obtaining method, the ID obtaining apparatus, the electronic device, and the storage medium according to embodiments of the present invention may detect whether there is a read permission for an external storage space of a target device, and determine whether a preset application is installed in the target device if there is no read permission for the external storage space, where the preset application includes a target port for obtaining a device ID of the device, and if the preset application is installed, obtain the device ID of the target device as the target ID from the target port based on inter-process communication between the preset application and another application installed in the target device. According to the technical scheme provided by the embodiment of the invention, the device ID can be obtained from the target port for obtaining the device ID in the preset application in an interprocess communication mode under the condition that the read permission aiming at the external storage space does not exist, so that the device ID can be obtained under the condition that the permission is not actively requested to the device, and the effectiveness of obtaining the device ID is improved.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a first flowchart of an ID generation method according to an embodiment of the present invention;
fig. 2 is a second flowchart of an ID generation method according to an embodiment of the present invention;
fig. 3 is a first flowchart of an ID obtaining method according to an embodiment of the present invention;
fig. 4 is a second flowchart of an ID obtaining method according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a third method for acquiring an ID according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an ID obtaining apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
Currently, when acquiring a device ID of a device, the device may temporarily generate the device ID of the device according to a certain rule or algorithm. The device may generate a device ID of the device in advance according to a certain rule or algorithm, and store the generated device ID in the internal storage space of the device. When the device ID of the device needs to be acquired, the device ID is directly acquired from the internal storage space of the device. The device may also generate the device ID of the device in advance according to a certain rule or algorithm, store the generated device ID in the SD card of the device, and directly obtain the device ID from the SD card of the device when the device ID of the device needs to be obtained.
However, in the above-mentioned process of obtaining the device ID, when the device obtains the device ID through the method of temporarily generating the device ID, since the device ID is often formed by a preset ID in the device, taking an Android device as an example, the preset ID in the Android device may include one or more of an Android identifier (Android ID), a Google Advertising identifier (Google Advertising ID), an International Mobile Equipment Identity (IMEI), a Media Access Control (MAC) address, a bluetooth address, a serial number, and the like. In the process of acquiring the preset IDs, there may be reasons that the authority setting or the preset IDs provided by the manufacturer are not fixed values, and the like, so that there may be a large difference between the device IDs temporarily generated each time, resulting in poor stability and uniqueness of the device IDs. When a device acquires a device ID from an internal storage space of the device, because the device ID is often stored in a storage directory corresponding to an installed application in the device, if data in the storage directory of the installed application in the device is removed or the installed application is uninstalled, the device ID stored in the internal storage space of the device may be removed or changed, which affects the acquisition of the device ID and the stability and uniqueness of the device ID. When the device acquires the device ID from the SD card of the device, although the device ID is stored in the SD card of the device, the problem of poor stability and uniqueness of the device ID caused by temporarily generating the device ID and acquiring the device ID from the internal storage space of the device can be alleviated to some extent, but as the security awareness of the user increases, the user can set the read authority for the SD card, which makes it impossible to acquire the stored device ID from the SD card without the read authority for the SD card.
In addition, the device generates a device ID according to the preset ID of the device, and the problem of permission limitation also exists. Taking an android device as an example, in an android device, the IMEI is often used as a device ID to identify the android device. However, with the development of technology, the equipment also needs the authority to acquire the IMEI. For such a situation, if the android device does not have the IMEI acquisition permission, the device cannot acquire the IMEI, and cannot use the IMEI as the device ID, which affects the acquisition of the device ID.
In order to solve the problems that the device cannot acquire the stored device ID from the SD card under the condition that the SD card is not read with permission, and the valid preset ID cannot be effectively acquired to generate the device ID due to the permission problem, an embodiment of the present invention provides an ID acquisition method. The method can be applied to any electronic equipment including but not limited to mobile phones, computers and the like. The ID obtaining method provided in the embodiment of the present invention may detect whether there is a read permission for an external storage space of a target device, and if there is no read permission for the external storage space, determine whether a preset application is installed in the target device, where the preset application includes a target port for obtaining a device ID of the device, and if the preset application is installed, obtain the device ID of the target device as the target ID from the target port based on inter-process communication between the preset application and another application installed in the target device.
By the method provided by the embodiment of the invention, the device ID can be obtained from the target port for obtaining the device ID in the preset application in an inter-process communication mode under the condition that the read permission aiming at the external storage space does not exist, so that the device ID can be obtained under the condition that the permission is not actively requested to the device, and the effectiveness of obtaining the device ID is improved.
The following examples illustrate the present invention.
With regard to the acquisition of the device ID, it is often acquired when an installed application in the target device needs to identify the target device. If the device ID is stored in the internal storage space or the external storage space of the target device, the installed application in the target device may identify the target device by acquiring the stored device ID. If the device ID of the target device is not stored in both the internal storage space and the external storage space of the target device, the installed application in the target device generates the device ID of the target device according to a certain algorithm to identify the target device, and stores the generated device ID in the internal storage space and the external storage space of the target device. For convenience of description, the target device is explained as an execution subject in the embodiment of the present invention.
The embodiment of the invention provides an ID generation method. Specifically, as shown in fig. 1, fig. 1 is a first flowchart of an ID generation method according to an embodiment of the present invention. The method comprises the following steps.
Step S101, determining whether the os version of the target device is a preset os version. If yes, go to step S102. If not, step S103 is executed.
In this step, the operating system version of the target device may be obtained, and the obtained operating system version is compared with the preset operating system version to determine whether the preset operating system version includes the version of the operating system of the target device. Specifically, if the preset os version includes an os version of the target device, it may be determined that the os version of the target device is the preset os version. If the preset os version does not include the os version of the target device, it may be determined that the os version of the target device is not the preset os version. The preset operating system version at least comprises one operating system version.
The android operating system is taken as an example for explanation. If the preset operating system version comprises Android 5.0, Android 6.0 and Android 7.0. The two existing target devices are device 1 and device 2, respectively, where an operating system version of device 1 is Android 7.0, and an operating system version of device 2 is Android 8.0. For the device 1 and the device 2, by comparing the operating system versions of the device 1 and the device 2 with the preset operating system version, it can be determined that the operating system version of the device 1 is the preset operating system version, and the operating system version of the device 2 is not the preset operating system version.
The preset os version may be set according to the current technical development level and the user's requirements. The device 1 and the device 2 are described as an example for acquiring Android IDs and generating corresponding device IDs. In the version of Android 7.0, when each application installed in the device 1 acquires an Android ID generation device ID, the acquired Android ID is better in uniqueness, and if the same Android ID is acquired, the device 1 may acquire the Android ID generation device ID of the device 1. However, in the Android 8.0 version, when each application installed in the device 2 acquires the Android ID to generate the device ID, the uniqueness of the acquired Android ID is poor, and if the Android IDs acquired by the applications including different signature files in the device 2 are different, the Android ID is no longer the unique identifier of the device 2, and the device 2 may not acquire the Android ID of the device 2 to generate the device ID. Therefore, in the process of generating the device ID, the device ID can be generated by adopting different methods by setting the preset operating system version so that the operating system version is the target device of the Android 7.0 and the Android 8.0. In the embodiment of the present invention, the number of the os versions included in the preset os version and the setting of the preset os version are not specifically limited.
In the embodiment of the present invention, by determining whether the os version of the target device is the preset os version, different methods may be used to generate the target ID of the target device in the target devices with different os versions, so that the ID generation method provided in the embodiment of the present invention may be applied to more target devices, and the collision rate of the target IDs of the target devices with different os versions is reduced, that is, the probability of device IDs in different target devices colliding is reduced.
And S102, generating the target ID of the target equipment according to the initial ID, the equipment brand and the equipment model of the target equipment.
In this step, if it is determined that the os version of the target device is the preset os version, the target ID of the target device may be generated according to the initial ID, the device brand, and the device model of the target device. The target ID is the device ID of the target device that is ultimately needed.
In one embodiment, when it is determined that the operating system version of the target device is the preset operating system version, the initial ID, the device brand, and the device model of the target device may be obtained, and the obtained initial ID, the device brand, and the device model are spliced to obtain the target ID of the target device. For example, the initial ID of the target device is ID1, the device brand is brand 1, the device model is model 1, and the spliced target ID can be expressed as: ID 1-brand 1-model 1. In the embodiment of the present invention, the initial ID, the equipment brand, the splicing sequence of the equipment model, and the splicing method are not particularly limited.
In one embodiment, for the initial ID, the initial ID may be an ID generated for the target device by an operating system installed in the target device. Taking the target device as an Android device as an example for explanation, in the Android device, the initial ID may be represented as the Android ID. The Android ID is a 16-system number corresponding to a 64-bit number randomly generated by an Android operating system when the Android device is first started.
The initial ID may be composed of numbers, letters, or special symbols. In the embodiment of the present invention, the initial ID is not particularly limited.
In an optional embodiment, if it is determined that the os version of the target device is the preset os version, the initial ID and the hardware serial number of the target device may be obtained, and the target ID of the target device may be generated according to the obtained initial ID, the obtained hardware serial number, the device brand of the target device, and the device model. Here, the generation process of the target ID is not specifically described.
Step S103, using the preset identifier included in the target device as the target ID of the target device.
In this step, if the operating system version of the target device is not the preset operating system version, the preset identifier stored in the target device may be acquired, and the acquired preset identifier may be used as the target ID of the target device.
In one embodiment, the preset identifier may be an identifier provided by a specific application installed in the target device for the target device. The Google augmentation ID is taken as an example for explanation. The Google Advertising ID is an ID provided by Google game Service (Google Play Service) that can be reset by the user. The target device may use the Google Advertising ID as the preset identification. In the embodiment of the present invention, the preset identifier is not particularly limited.
In an optional embodiment, in the step S102, if the initial ID of the target device is not obtained, a preset identifier in the target device may be obtained as the target ID of the target device, that is, when the target device does not obtain the initial ID, the step S103 is executed.
In an alternative embodiment, for the target ID generated in step S102 and step S103, the target ID may be stored in the internal storage space and the external storage space of the target device. The internal storage space includes, but is not limited to, an internal storage space of the target device, and a memory and a private storage directory of an installed application in the target device. And the memory of the installed application is a corresponding temporary storage space in the running process of the installed application. The external storage space includes but is not limited to an SD card, a solid state disk, and the like.
In one embodiment, the target device may store the generated target ID in a plurality of specific storage directories of the external storage space when storing the target ID in the external storage space.
In an optional embodiment, when the target device stores the generated target ID, the target device may further perform encryption processing on the generated target ID.
In one embodiment, the target device may encrypt the generated target ID. In another embodiment, the target device may encrypt a partial string in the generated target ID. Here, the specific procedure of the encryption processing and the method of the encryption processing are not described.
In an optional embodiment, based on the ID generation method shown in fig. 1, an embodiment of the present invention further provides an ID generation method. Specifically, as shown in fig. 2, fig. 2 is a second flowchart of the ID generation method according to the embodiment of the present invention. The method comprises the following steps.
In step S201, it is determined whether the os version of the target device is a preset os version. If yes, go to step S202. If not, go to step S203.
Step S202, generating the target ID of the target equipment according to the initial ID, the equipment brand and the equipment model of the target equipment.
The above steps S201 and S202 are the same as the above steps S101 and S102.
Step S203, detecting whether the target device includes a preset identifier. If yes, go to step S204. If not, go to step S205.
Step S204, using the preset identifier included in the target device as the target ID of the target device.
Step S204 is the same as step S103.
Step S205, generating a target ID of the target device according to the hardware serial number, the device brand and the device model of the target device.
In this step, if the target device does not include the preset identifier, the hardware serial number of the target device may be obtained, and the target ID of the target device may be generated according to the device brand, the device model, and the obtained hardware serial number of the target device. For example, the generated target ID may be expressed as: hardware serial number-device brand-device model number.
As to the method for generating the target ID of the target device according to the hardware serial number, the device brand, and the device model of the target device, reference may be made to the method for generating the target ID of the target device according to the initial ID, the device brand, and the device model of the target device in step S102, which is not described herein again.
The hardware serial number includes, but is not limited to, a hardware serial number of the motherboard and a hardware serial number of the battery. In the embodiment of the present invention, the hardware serial number is not particularly limited.
In the embodiment of the present invention, the execution sequence of step S203 and step S204 is not limited.
Through the embodiment provided in fig. 2, when the target device does not include the preset identifier, the device ID of the target device may be generated according to the hardware serial number, the device brand, and the device model of the target device, so that the collision rate of the target IDs in different target devices is reduced.
In an alternative embodiment, in the step S204, a target ID of the target device is generated according to a hardware serial number, a device brand, and a device model of the target device, and the ID generation manner may include the following steps.
It is detected whether the target device has write permission for the external storage space.
Specifically, the target device may detect whether the target device has write permission for an external storage control of the target device.
In one embodiment, the target device may obtain, through an Application Programming Interface (API) for permission determination, each permission for an external storage space of the target device, and further determine whether the target device has a write permission for the external storage space.
In another embodiment, since the API for permission determination may have a determination error in some devices due to compatibility and the like, in order to improve accuracy of determining the write permission of the target device, the target device may directly write a preset message or a preset file into the external storage space, so as to determine whether the target device has the write permission for the external storage space.
For example, the file 1 is preset and the file 1 is written into the external storage space of the target device. And if the file 1 is successfully written into the external storage space, the target device receives a response message of successfully writing into the external storage space, and the target device determines the write permission of the target device for the external storage space according to the received response message. If the file 1 is not successfully written into the external storage space, the target device will not receive the corresponding response message, or receive the response message of unsuccessful writing, and it may be determined that the target device does not have the write permission for the external storage space.
In an optional embodiment, if it is determined that the write permission for the external storage space is not available, the target ID of the target device may be generated according to the hardware serial number, the device brand, and the device model of the target device.
In another alternative embodiment, if it is determined that the write permission for the external storage space exists, the target device may generate the target ID of the target device according to the target character string, and the hardware serial number, the device brand, and the device model of the target device. The target character string is a character string generated according to a preset rule.
In an embodiment, the target device may randomly select a preset number of character strings, and concatenate the selected preset number of character strings to obtain the target character string. And the target equipment generates a target ID of the target equipment according to the target character string, the hardware serial number, the equipment brand and the equipment model of the target equipment.
For example, the preset number of randomly selected character strings are A, B and C. From A, B and C, the generated target string is ABC. The target device may generate a target ID according to the target character string, and the hardware serial number, the device brand, and the device model of the target device, where the target ID may be represented as: hardware serial number-ABC-device brand-device model number, hardware serial number-device brand-ABC-device model number, or hardware serial number-ABC-device brand-ABC-device model number.
In another embodiment, the target device may randomly select a preset number of character strings as the target character string. The target device may generate a target ID of the target device according to a preset number of target character strings, and a hardware serial number, a device brand, and a device model of the target device.
For example, the preset number of target character strings are a and B, and the target device generates a target ID according to the preset number of target character strings, and the hardware serial number, the device brand, and the device model of the target device, as follows: hardware serial number-a-device brand-B-device model, hardware serial number-B-device brand-a-device model, or hardware serial number-a-B-device brand-device model, etc.
In the embodiment of the present invention, the preset number and the target character string are not specifically limited.
The initial ID, the preset identifier, the hardware serial number, the equipment brand, and the equipment model are identification information of the target equipment. The identification information of the target device is identification information that can be acquired by the target device under the condition that the authority is not actively acquired from the target device. And changing according to the permission setting condition in each target device. In the embodiment of the present invention, the identification information of the target device is not particularly limited.
By adding a target character string to the generated target ID, the collision rate of target IDs generated in different target devices can be reduced.
Based on the same inventive concept, on the basis of the ID generation method shown in fig. 1, the embodiment of the present invention further provides an ID acquisition method. Specifically, as shown in fig. 3, fig. 3 is a first flowchart of an ID obtaining method according to an embodiment of the present invention. The method comprises the following steps.
Step S301, detecting whether there is a read right for the external storage space of the target device. If not, go to step S302.
In this step, the target device may detect whether it has a read right to an external storage space of the target device.
The detection method of the read right may refer to the detection method of the write right described above, for example, the target device may read a preset file from the external storage space, thereby detecting whether the external storage space has the read right. The read rights to the external memory space of the target device are not specifically described here.
Step S302, determining whether a preset application is installed in the target device. The preset application comprises a target port used for obtaining the device ID of the device. If yes, go to step S303.
In this step, if it is detected that the target device does not have the read permission for the external storage space, it may be determined whether a preset application is installed in the target device.
In an embodiment of the present invention, the preset application is an application integrated with a Software Development Kit (SDK). The SDK of the preset application comprises a target port for acquiring the device ID of the device and an SDK white list maintained by the server. The target device may determine, for each installed application, whether the SDK is integrated in the installed application, and screen out the installed application in which the SDK is integrated. The target device can send the screened identification information of the installed application to the server, and the server can update the SDK white list according to the received identification information to obtain a new SDK white list. In one embodiment, whether the preset application is installed in the target device may be determined according to whether the SDK is integrated in the installed application of the target device. In another embodiment, whether the preset application is installed in the target device may be determined according to the SDK white list. In the embodiment of the present invention, the method for determining the preset application is not particularly limited.
In an optional embodiment, if it is detected that the external storage space has the read permission, the device ID stored in the external storage space of the target device may be acquired as the target ID of the target device.
In one embodiment, when detecting that the target device has the read right for the external storage space, the target device may obtain the target ID of the target device from a specific storage directory of the external storage space.
By detecting whether the target device has the read right for the external storage space, the device ID of the target device can be directly read from the external storage space and used as the target ID of the target device when the target device has the read right for the external storage space, and the acquisition efficiency of the target ID is improved.
In an alternative embodiment, during the use of the target device, the target ID stored in the external storage space may be changed or an error may occur due to some unexpected operation behavior of the user. In order to improve the accuracy of the target ID acquired from the external storage space of the target device, when the device ID stored in the external storage space is acquired as the target ID of the target device, the target device may acquire the device ID stored in the external storage space and perform tamper-proof verification on the acquired device ID. If the verification passes, the target device may determine that the obtained device ID is the target ID of the target device. If the verification fails, the target device may determine that the acquired device ID is not the target ID of the target device, and the target device may execute step S303. Here, the tamper-proof verification process of the acquired device ID is not specifically described.
Step S303, based on inter-process communication between the preset application and another application installed in the target device, obtains the device ID of the target device from the target port as the target ID.
In this step, if it is determined that the preset application is installed in the target device, the target device may establish inter-process communication between the preset application and another application installed in the target device, so that the other application may obtain a target ID of the target device from a target port included in the preset application.
In an optional embodiment, when the number of the preset applications installed in the target device includes at least two, the target device may select the preset application with the highest priority to establish inter-process communication with the other applications according to the priority of each preset application, and obtain the target ID of the target device from the target port of the preset application.
In one embodiment, the SDK white list includes a priority of each predetermined application. When the target device performs inter-process communication between the preset application and other applications, the target device may determine, according to the priority of each preset application in the stored SDK white list, the preset application with the highest priority among the plurality of preset applications installed in the target device, and perform inter-process communication with other applications by using the preset application.
In the embodiment of the present invention, the priority of the preset application may be set by a user amount and a size corresponding to the preset application. Here, the priority of the preset application is not particularly limited.
The target ID stored in the target port of the preset application is the same as the target ID stored in the internal storage space and the external storage space of the target device.
In summary, with the method provided by the embodiment of the present invention, the device ID of the device can be obtained from the port for obtaining the device ID included in the preset application in an inter-process communication manner without a read permission for the external storage space, so that the device ID stored in the device can be obtained without actively requesting a permission from the device.
In an alternative embodiment, in the step S302, the step of determining whether the preset application is installed in the target device may include the following steps.
Step S3021, determining whether an installed application list of the target device includes an identifier of a preset application, where the installed application list includes the identifier of the installed application. If yes, go to step S3022. If not, step S3023 is executed.
In this step, an installed application list of the target device may be obtained, and the identifier of the installed application in the target device may be compared with the identifier of the preset application, so as to determine whether the identifier of the installed application in the target device includes the identifier of the preset application, that is, determine whether the installed application list of the target device includes the preset application.
In one embodiment, the target device may detect whether it has read permission for the list of installed applications. If the target device has the read permission for the installed application list of the target device, the target device may read the installed application list. And the target equipment compares the identifier of the preset application with the read identifier of each application in the installed application list, and judges whether the installed application list of the target equipment comprises the identifier of the preset application.
In step S3022, it is determined that the preset application is installed in the target apparatus.
In this step, if it is determined that the installed application list of the target device includes the identifier of the preset application, it may be determined that the preset application is installed in the target device.
In step S3023, it is determined that the preset application is not installed in the target apparatus.
In this step, if it is determined that the installed application list of the target device does not include the identifier of the preset application, it may be determined that the preset application is not installed in the target device.
By directly reading the installed application list of the target device, the target device can more quickly and accurately judge whether the preset application is installed in the target device, and the judgment accuracy and efficiency are improved.
In an alternative embodiment, due to different setting of permissions in the target device by different vendors, in part of the target devices, the user may set the read permission for the installed application list of the target device. In addition, the target device need not have corresponding permissions while the target device traverses the installed applications in the target device. Therefore, when the target device does not have the read right for the installed application list, the accuracy of the judgment on whether the preset application is installed on the target device is improved. When the target device does not have the read right for the installed application list, the step S302 of determining whether the preset application is installed in the target device may be represented as:
and aiming at each preset application in the SDK white list, searching whether the preset application is installed in the target equipment one by one according to the identifier of the preset application in the sequence from high priority to low priority, and further determining whether the preset application is installed in the target equipment.
The preset applications included in the SDK white list are taken as application a, application B, and application C for example. If the priority of application A is higher than that of application B, the priority of application B is higher than that of application C. The target device may detect whether an application with the same identifier exists in the target device according to the identifier of the application a, for example, a packet name of a data packet corresponding to the application a. If it is detected that the applications with the same identifier exist, the target device may determine that the application a, that is, the preset application, is installed. If the application with the same identification is not detected to exist, the target device may determine that the application a is not installed. And in the same way, whether the application B and the application C are installed in the target equipment is detected respectively, and whether the preset application is installed in the target equipment is further determined.
In an optional embodiment, according to the ID obtaining method shown in fig. 3, an embodiment of the present invention further provides an ID obtaining method. Specifically, as shown in fig. 4, fig. 4 is a second flowchart of the ID obtaining method according to the embodiment of the present invention. The method comprises the following steps.
Step S401 detects whether there is a read right for the external storage space of the target device. If not, go to step S402.
Step S402, determining whether a preset application is installed in the target device. The preset application comprises a target port used for obtaining the device ID of the device. If yes, go to step S403. If not, go to step S404.
Step S403, based on inter-process communication between the preset application and another application installed in the target device, acquires the device ID of the target device from the target port as the target ID.
The above-described steps S401 to S403 are the same as the above-described steps S301 to S303.
Step S404, obtains the identification information of the target device.
In this step, if the preset application is not installed in the target device, the identification information of the target device may be acquired. The identification information may include the initial ID, a preset identifier, a hardware serial number, a device brand, a device model, and the like.
Step S405, generates a target ID of the target device according to the identification information.
In this step, the target device may generate a device ID of the target device according to the acquired identification information. Regarding the generation method of the target ID, reference may be made to the ID generation method provided in fig. 1, and details thereof are not described herein.
Step S406, the target ID is stored in the internal storage space and the external storage space of the target device.
In this step, the target device may store the generated target ID in the internal storage space and the external storage space of the target device, so that when the device ID of the target device needs to be acquired next time, the target ID may be acquired from the internal storage space and the external storage space of the target device, thereby improving the acquisition efficiency of the target ID.
Compared with the prior art, the method has the advantage that the device ID is directly generated when no SD card is read in the process of acquiring the device ID. In the ID obtaining method provided in the embodiment of the present invention, the target device generates the device ID of the target device only when the target device does not actively request the permission from the target device and the preset application is not installed in the target device, so that the uniqueness and stability of the generated device ID are significantly improved in the device ID obtaining process of the target device.
In an alternative embodiment, each application program is continuously updated as the technology is continuously developed, which causes the preset application installed in the target device to be continuously changed. In order to enable the target device to accurately determine whether the preset application is installed in the target device. The target device may detect whether the installed application includes the target port. And if the installed application is detected to comprise the target port, determining the installed application as the preset application, and improving the accuracy of the preset application. The concrete can be realized in the following manner.
Specifically, for each installed application in the target device, the target device may detect, according to a preset time interval, whether the installed application includes a target port for acquiring a device ID of the target device. If the installed application is detected to include the target port, the target device may send the identification information of the installed application to the server, so that the server updates the SDK white list.
In an optional embodiment, according to the ID obtaining method shown in fig. 3, an embodiment of the present invention further provides an ID obtaining method. Specifically, as shown in fig. 5, fig. 5 is a third schematic flow chart of the ID obtaining method according to the embodiment of the present invention. The method may include the following steps.
Step S501, detecting whether the target ID of the target device exists in the internal storage space of the target device. If not, go to step S502.
Step S502, detecting whether there is a read right for the external storage space of the target device. If not, go to step S503. If yes, go to step S504.
Step S503, determining whether a preset application is installed in the target device, wherein the preset application comprises a target port for acquiring the device ID of the device;
step S504, based on inter-process communication between the preset application and another application installed in the target device, obtains the device ID of the target device from the target port as the target ID.
The steps S502 to S504 are the same as the steps S301 to S505.
In step S501, the internal storage space of the target device may be an internal storage space of the target device, may also be a memory of an application installed in the target device, and may also be a private storage directory of the application installed in the target device. For different internal storage spaces, the target device may obtain data in the internal storage space in different manners.
An android device is taken as an example for explanation. In one embodiment, if the internal storage space of the target device is the internal storage space of the installed application, that is, the local cache of the installed application, the target device may directly obtain the stored target ID from the internal storage space. In another embodiment, if the internal storage space of the target device is a private storage directory of the installed application, the target device may obtain the stored target ID from the private storage directory of the installed application through processing by a content provider (ContentProvider) and a content parser (ContentResolver).
In the embodiment of the present invention, the target ID of the target device may be stored in the internal storage space and the external storage space of the target device. Since the target device obtains the target ID directly from the internal storage space significantly faster than the target ID from the external storage space. Therefore, if the target ID exists in the internal storage space of the target device, the target device can directly acquire the target ID of the target device from the internal storage space, thereby shortening the time consumed by the target ID acquisition process and improving the device ID acquisition efficiency.
Based on the same inventive concept, according to the ID obtaining method provided in the above embodiment of the present invention, an embodiment of the present invention further provides an ID obtaining apparatus. Specifically, as shown in fig. 6, fig. 6 is a schematic structural diagram of an ID obtaining apparatus according to an embodiment of the present invention. The apparatus includes the following modules.
The first detecting module 601 is configured to detect whether there is a read permission for an external storage space of a target device.
A first determining module 602, configured to determine whether a preset application is installed in the target device when the detection result of the first detecting module 601 is negative, where the preset application includes a target port for obtaining the device ID of the device.
A first obtaining module 603, configured to, when the determination result of the first determining module 602 is yes, obtain, based on inter-process communication between the preset application and another application installed in the target device, a device ID of the target device as a target ID from the target port.
Optionally, the ID obtaining apparatus may further include:
the second detection module is used for detecting whether the target ID of the target device exists in the internal storage space of the target device; and if the detection result of the second detection module is negative, executing a step of detecting whether the external storage space of the target device has the read permission.
Optionally, the ID obtaining apparatus may further include:
and a second obtaining module, configured to, when the detection result of the first detecting module 601 is yes, obtain the device ID stored in the external storage space as the target ID of the target device.
Optionally, the second obtaining module may be specifically configured to obtain a device ID stored in an external storage space; performing tamper-proof verification on the obtained equipment ID; and if the verification is passed, determining that the equipment ID is the target ID of the target equipment.
Optionally, the first determining module 602 may be specifically configured to determine whether an installed application list of the target device includes an identifier of a preset application, where the installed application list includes the identifier of the installed application; if the target equipment comprises the identifier of the preset application, determining that the preset application is installed in the target equipment; and if the identifier of the preset application is not included, determining that the preset application is not installed in the target equipment.
Optionally, the ID obtaining apparatus may further include:
a third obtaining module, configured to obtain the identification information of the target device if the determination result of the first determining module 602 is negative.
And the first generation module is used for generating the target ID of the target equipment according to the identification information.
And the storage module is used for storing the target ID into the internal storage space and the external storage space of the target device.
Optionally, the first generating module may be specifically configured to determine whether an os version of the target device is a preset os version; if the version of the operating system is preset, generating a target ID of the target equipment according to the initial ID, the equipment brand and the equipment model of the target equipment; and if the target device is not the preset operating system version, taking a preset identifier included in the target device as a target ID of the target device.
Optionally, the ID obtaining apparatus may further include:
and the second generation module is used for generating the target ID of the target equipment according to the hardware serial number, the equipment brand and the equipment model of the target equipment when the preset identification is not included in the target equipment.
Optionally, the ID obtaining apparatus may further include:
the third detection module is used for detecting whether the target device has write permission aiming at the external storage space;
the second generating module is specifically configured to generate a target ID of the target device according to the hardware serial number, the device brand, and the device model of the target device if the detection result of the third detecting module is negative; and when the detection result of the third detection module is yes, generating a target ID of the target equipment according to the target character string, the hardware serial number of the target equipment, the equipment brand and the equipment model, wherein the target character string is a character string generated according to a preset rule.
By the device provided by the embodiment of the invention, the device ID can be obtained from the target port for obtaining the device ID in the preset application in an interprocess communication mode under the condition that the read permission aiming at the external storage space does not exist, so that the device ID can be obtained under the condition that the permission is not actively requested to the device, and the effectiveness of obtaining the device ID is improved.
Based on the same inventive concept, according to the ID obtaining method provided in the above embodiment of the invention, an embodiment of the invention further provides an electronic device, as shown in fig. 7, including a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702 and the memory 703 complete mutual communication through the communication bus 704;
a memory 703 for storing a computer program;
the processor 701 is configured to implement the following steps when executing the program stored in the memory 703:
detecting whether the external storage space of the target device has read permission;
if the target device does not have the read permission for the external storage space, determining whether a preset application is installed in the target device, wherein the preset application comprises a target port for acquiring the device ID of the device;
and if the preset application is installed, acquiring the device ID of the target device from the target port as the target ID based on the interprocess communication between the preset application and other applications installed in the target device.
According to the electronic device provided by the embodiment of the invention, the device ID can be obtained from the target port for obtaining the device ID in the preset application in an interprocess communication mode under the condition that the read permission aiming at the external storage space does not exist, so that the device ID can be obtained under the condition that the permission is not actively requested to the device, and the effectiveness of obtaining the device ID is improved.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
Based on the same inventive concept, according to the ID obtaining method provided in the above embodiments of the invention, an embodiment of the invention further provides a computer readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the ID obtaining methods described above.
Based on the same inventive concept, according to the ID acquisition methods provided by the above embodiments of the present invention, embodiments of the present invention also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the ID acquisition methods in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (16)

1. An identification ID acquisition method, comprising:
detecting whether the external storage space of the target device has read permission;
if the target device does not have the read permission for the external storage space, determining whether a preset application is installed in the target device, wherein the preset application comprises a target port for acquiring the device ID of the device;
if the preset application is installed, acquiring the device ID of the target device from the target port as a target ID based on inter-process communication between the preset application and other applications installed in the target device;
the preset application is an application integrated with a Software Development Kit (SDK); the SDK of the preset application comprises a target port for acquiring the equipment ID of the equipment and an SDK white list maintained by a server;
if the preset application is not installed, the method further comprises the following steps:
acquiring identification information of the target equipment;
generating a target ID of the target equipment according to the identification information;
storing the target ID into an internal storage space and an external storage space of the target device;
the step of generating the target ID of the target device according to the identification information includes:
determining whether the operating system version of the target device is a preset operating system version;
if the preset operating system version is available, generating a target ID of the target equipment according to the initial ID, equipment brand and equipment model of the target equipment;
and if the target device is not the preset operating system version, taking a preset identifier included in the target device as a target ID of the target device.
2. The method of claim 1, further comprising:
detecting whether a target ID of a target device exists in an internal storage space of the target device;
and if the target ID does not exist, executing the step of detecting whether the read permission of the external storage space of the target device exists.
3. The method of claim 1, further comprising:
and if the read permission aiming at the external storage space exists, acquiring the device ID stored in the external storage space as the target ID of the target device.
4. The method according to claim 3, wherein the step of obtaining the device ID stored in the external storage space as the target ID of the target device comprises:
acquiring a device ID stored in the external storage space;
performing tamper-proof verification on the obtained equipment ID;
and if the verification is passed, determining that the equipment ID is the target ID of the target equipment.
5. The method of claim 1, wherein the step of determining whether the preset application is installed in the target device comprises:
judging whether an installed application list of the target device comprises an identifier of the preset application or not, wherein the installed application list comprises the identifier of the installed application;
if the preset application identifier is included, determining that the preset application is installed in the target device;
and if the identifier of the preset application is not included, determining that the preset application is not installed in the target device.
6. The method of claim 1, wherein if the preset identifier is not included in the target device, the method further comprises:
and generating the target ID of the target equipment according to the hardware serial number, the equipment brand and the equipment model of the target equipment.
7. The method of claim 6, further comprising, prior to generating the target ID of the target device based on the hardware serial number, device make, and device model number of the target device:
detecting whether the target device has write permission for the external storage space;
the step of generating the target ID of the target device according to the hardware serial number, the device brand, and the device model of the target device includes:
if the target device does not have the write permission aiming at the external storage space, generating a target ID of the target device according to the hardware serial number, the device brand and the device model of the target device;
and if the write permission aiming at the external storage space exists, generating a target ID of the target equipment according to a target character string, a hardware serial number of the target equipment, an equipment brand and an equipment model, wherein the target character string is generated according to a preset rule.
8. An identification ID acquisition apparatus, comprising:
the device comprises a first detection module, a second detection module and a control module, wherein the first detection module is used for detecting whether the device has read permission aiming at an external storage space of a target device;
a first determining module, configured to determine whether a preset application is installed in the target device when a detection result of the first detecting module is negative, where the preset application includes a target port for obtaining a device ID of the device;
a first obtaining module, configured to, when a determination result of the first determining module is yes, obtain, based on inter-process communication between the preset application and another application installed in the target device, a device ID of the target device from the target port as a target ID;
the preset application is an application integrated with a Software Development Kit (SDK); the SDK of the preset application comprises a target port for acquiring the equipment ID of the equipment and an SDK white list maintained by a server;
the device further comprises:
a third obtaining module, configured to obtain, if the determination result of the first determining module is negative, the identification information of the target device;
a first generating module, configured to generate a target ID of the target device according to the identification information;
a storage module for storing the target ID in an internal storage space and an external storage space of the target device;
the first generation module is specifically configured to determine whether the operating system version of the target device is a preset operating system version; if the preset operating system version is available, generating a target ID of the target equipment according to the initial ID, equipment brand and equipment model of the target equipment; and if the target device is not the preset operating system version, taking a preset identifier included in the target device as a target ID of the target device.
9. The apparatus of claim 8, further comprising:
the second detection module is used for detecting whether the target ID of the target device exists in the internal storage space of the target device; and if the detection result of the second detection module is negative, executing the step of detecting whether the external storage space of the target device has the read permission.
10. The apparatus of claim 8, further comprising:
and a second obtaining module, configured to, if a detection result of the first detecting module is yes, obtain the device ID stored in the external storage space as a target ID of the target device.
11. The apparatus according to claim 10, wherein the second obtaining module is specifically configured to obtain a device ID stored in the external storage space; performing tamper-proof verification on the obtained equipment ID; and if the verification is passed, determining that the equipment ID is the target ID of the target equipment.
12. The apparatus according to claim 8, wherein the first determining module is specifically configured to determine whether an installed application list of the target device includes an identifier of the preset application, where the installed application list includes the identifier of the installed application; if the preset application identifier is included, determining that the preset application is installed in the target device; and if the identifier of the preset application is not included, determining that the preset application is not installed in the target device.
13. The apparatus of claim 8, further comprising:
and the second generation module is used for generating the target ID of the target equipment according to the hardware serial number, the equipment brand and the equipment model of the target equipment when the preset identification is not included in the target equipment.
14. The apparatus of claim 13, further comprising:
the third detection module is used for detecting whether the target device has write permission aiming at the external storage space;
the second generating module is specifically configured to generate a target ID of the target device according to the hardware serial number, the device brand, and the device model of the target device if the detection result of the third detecting module is negative; and when the detection result of the third detection module is yes, generating a target ID of the target equipment according to a target character string, a hardware serial number of the target equipment, an equipment brand and an equipment model, wherein the target character string is a character string generated according to a preset rule.
15. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 7 when executing a program stored in the memory.
16. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.
CN201910252988.3A 2019-03-29 2019-03-29 ID obtaining method and device, electronic equipment and storage medium Active CN110008758B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910252988.3A CN110008758B (en) 2019-03-29 2019-03-29 ID obtaining method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910252988.3A CN110008758B (en) 2019-03-29 2019-03-29 ID obtaining method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110008758A CN110008758A (en) 2019-07-12
CN110008758B true CN110008758B (en) 2021-06-18

Family

ID=67169006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910252988.3A Active CN110008758B (en) 2019-03-29 2019-03-29 ID obtaining method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110008758B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110929233B (en) * 2019-11-22 2022-11-15 连尚(新昌)网络科技有限公司 Information processing method and device
CN111931254A (en) * 2020-09-26 2020-11-13 绿漫科技有限公司 Hybrid identification method for unique identification of Android device
CN115277223A (en) * 2022-07-29 2022-11-01 招商局金融科技有限公司 Equipment identifier obtaining method and device, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5867160A (en) * 1996-10-31 1999-02-02 International Business Machines Corporation System and method for task prioritization in computerized graphic interface environments
CN103248670A (en) * 2012-02-01 2013-08-14 塔塔咨询服务有限公司 Connection management in a computer networking environment
CN105207791A (en) * 2014-05-29 2015-12-30 中国电信股份有限公司 Method, central platform, system and network camera for information configuration
CN106603530A (en) * 2016-12-14 2017-04-26 杭州古北电子科技有限公司 Control system and method for electronic device compatible with different communication protocols
CN108287662A (en) * 2017-12-08 2018-07-17 五八有限公司 Obtain method, equipment and the computer readable storage medium of equipment unique mark
CN108600404A (en) * 2018-03-01 2018-09-28 深圳市共进电子股份有限公司 Terminal management method, device, computer equipment and storage medium in wireless network
CN108830113A (en) * 2018-06-14 2018-11-16 山东浪潮通软信息科技有限公司 A kind of acquisition methods of Android device unique identification

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106549989B (en) * 2015-09-17 2020-02-18 腾讯科技(深圳)有限公司 Data transmission method and system, user terminal and application server
CN108604281B (en) * 2016-11-24 2020-09-08 华为技术有限公司 Data processing method and terminal thereof
CN106649186A (en) * 2016-12-12 2017-05-10 青岛海信电器股份有限公司 Communication method and device for application program and serial port peripheral

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5867160A (en) * 1996-10-31 1999-02-02 International Business Machines Corporation System and method for task prioritization in computerized graphic interface environments
CN103248670A (en) * 2012-02-01 2013-08-14 塔塔咨询服务有限公司 Connection management in a computer networking environment
CN105207791A (en) * 2014-05-29 2015-12-30 中国电信股份有限公司 Method, central platform, system and network camera for information configuration
CN106603530A (en) * 2016-12-14 2017-04-26 杭州古北电子科技有限公司 Control system and method for electronic device compatible with different communication protocols
CN108287662A (en) * 2017-12-08 2018-07-17 五八有限公司 Obtain method, equipment and the computer readable storage medium of equipment unique mark
CN108600404A (en) * 2018-03-01 2018-09-28 深圳市共进电子股份有限公司 Terminal management method, device, computer equipment and storage medium in wireless network
CN108830113A (en) * 2018-06-14 2018-11-16 山东浪潮通软信息科技有限公司 A kind of acquisition methods of Android device unique identification

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
leonordo.获取以太网卡的MAC地址.《https://www.cnblogs.com/guoyilin/archive/2009/04/01/1426846.html》.2009, *
获取以太网卡的MAC地址;leonordo;《https://www.cnblogs.com/guoyilin/archive/2009/04/01/1426846.html》;20090401;第1-2页 *

Also Published As

Publication number Publication date
CN110008758A (en) 2019-07-12

Similar Documents

Publication Publication Date Title
JP7177576B2 (en) Runtime self-modification for blockchain ledgers
US10073916B2 (en) Method and system for facilitating terminal identifiers
CN110008758B (en) ID obtaining method and device, electronic equipment and storage medium
US9177129B2 (en) Devices, systems, and methods for monitoring and asserting trust level using persistent trust log
US9483636B2 (en) Runtime application integrity protection
US11762987B2 (en) Systems and methods for hardening security systems using data randomization
US9870472B2 (en) Detecting malign code in unused firmware memory
US10158990B2 (en) SMS message reading control method and terminal
US11275835B2 (en) Method of speeding up a full antivirus scan of files on a mobile device
US20230334127A1 (en) System and method for protecting software licensing information via a trusted platform module
CN111177703B (en) Method and device for determining data integrity of operating system
CN113946854B (en) File access control method and device and computer readable storage medium
WO2016173267A1 (en) Completeness checking method and apparatus
US10606813B2 (en) Systems and methods for securely managing program execution
CN110941825B (en) Application monitoring method and device
CN111158771B (en) Processing method and device and computer equipment
US20230015273A1 (en) Verification information revising device, verification information revising method, and verification information revising program
US11921859B2 (en) System and method for managing device security during startup
CN115563594A (en) User identifier acquisition method and device, electronic equipment and storage medium
CN116414451A (en) Remote verification method and device based on application-only Memory
KR20230121406A (en) Method and system for generating safe internet resource access information
CN111090889A (en) Method for detecting ELF file and electronic equipment
CN113783923A (en) Web page anti-brush processing method, device, equipment and storage medium
CN115795457A (en) Trojan horse program monitoring method and device, computing 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