CN116244764A - Method and system for generating device unique ID of Android device - Google Patents

Method and system for generating device unique ID of Android device Download PDF

Info

Publication number
CN116244764A
CN116244764A CN202211623446.0A CN202211623446A CN116244764A CN 116244764 A CN116244764 A CN 116244764A CN 202211623446 A CN202211623446 A CN 202211623446A CN 116244764 A CN116244764 A CN 116244764A
Authority
CN
China
Prior art keywords
android
unique
server
client
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.)
Pending
Application number
CN202211623446.0A
Other languages
Chinese (zh)
Inventor
李亚松
赵敏全
李荣波
胡明同
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Southern Power Grid Digital Platform Technology Guangdong Co ltd
Original Assignee
China Southern Power Grid Digital Platform Technology Guangdong 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 China Southern Power Grid Digital Platform Technology Guangdong Co ltd filed Critical China Southern Power Grid Digital Platform Technology Guangdong Co ltd
Priority to CN202211623446.0A priority Critical patent/CN116244764A/en
Publication of CN116244764A publication Critical patent/CN116244764A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/73Protecting 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 by creating or determining hardware identification, e.g. serial numbers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a method and a system for generating a device unique ID of Android device, wherein the method comprises the following steps: the client calls an Android system API in the Android device to randomly generate a UUID character string, and a device ID is obtained; the client encrypts the equipment ID through an encryption algorithm to obtain an equipment unique ID; the client sends the unique ID of the equipment to a server for equipment registration; the server receives the unique ID of the device and generates a server-side ID according to preset ID generation control conditions. Therefore, the method and the device can generate the safe and stable device unique ID in the Android system in the Android device to mark the device, so that the Android device is accurately managed and controlled.

Description

Method and system for generating device unique ID of Android device
Technical Field
The invention relates to the technical field of computers, in particular to a method and a system for generating a device unique ID of Android device.
Background
Android (Android) systems are used as open source operating systems, are currently applied to various intelligent devices such as smart phones, tablet computers, mobile tablets, wearable devices and the like in a large number, and when Android devices are managed and controlled, information of uniqueness of marking devices such as IMEI, MAC, android ID and the like of the devices is needed to be obtained in many cases.
However, as the version of the Android system is upgraded, the system pays more attention to user privacy, the permission limit of the application program is more strict, and the process of acquiring the IMEI of the equipment becomes complex and difficult; the MAC address is required to be acquired from a hardware system of the Android device, so that the stability and the accuracy are poor, and meanwhile, the problem of difficult acquisition caused by upgrading of the Android system also exists; although any permission is not required for acquiring the Android ID, the Android ID can be changed by upgrading, flashing, restoring factory settings and the like of the Android system. Therefore, how to generate a safe and stable device unique ID in an Android system in the Android device to mark the Android device is particularly important, so that the Android device is accurately managed and controlled.
Disclosure of Invention
The invention provides a device unique ID generation method and system for Android devices, which can generate safe and stable device unique IDs in an Android system of the Android devices to mark the devices, so that the Android devices are accurately controlled.
In order to solve the technical problems, the first aspect of the invention discloses a device unique ID generation method of Android device, which comprises the following steps:
The client calls an Android system API in the Android device to randomly generate a UUID character string, and a device ID is obtained;
the client encrypts the equipment ID through an encryption algorithm to obtain an equipment unique ID;
the client sends the equipment unique ID to a server for equipment registration;
the server receives the equipment unique ID and generates a server-side ID according to a preset ID generation control condition, wherein the equipment unique ID and the server-side ID have a one-to-one corresponding binding relationship on the server, and the binding relationship is recorded in a table structure of a database of the server.
In an optional implementation manner, in a first aspect of the present invention, the client calls an Android system API in an Android device to randomly generate a UUID string, to obtain a device ID, including:
and the client calls an Android system API in the Android device through a programming language to randomly generate a UUID character string, wherein the programming language comprises one of a C language, a C++ language, a JAVA language and a Python language.
In a first aspect of the present invention, after the client encrypts the device ID by using an encryption algorithm to obtain a device unique ID, the client sends the device unique ID to a server to perform device registration, so that before the server is triggered to generate a server ID, the method further includes:
The client marks the type of the equipment unique ID through a type tag, and stores the equipment unique ID into a local storage space of the Android equipment, wherein the type of the equipment unique ID comprises one of IMEI, MAC address, android ID and UUID.
As an optional implementation manner, in the first aspect of the present invention, after the server receives the device unique ID, before the server generates the server-side ID according to a preset ID generation control condition, the method further includes:
the server judges whether the equipment unique ID is registered on the server or not;
when judging that the equipment unique ID is not registered on the server, the server registers the Android equipment according to the equipment unique ID so as to trigger the server to execute the operation of generating the server-side ID according to preset ID generation control conditions;
and, the method further comprises:
the server returns the generated server side ID to the client side;
the client stores the server ID in a cache space of the client.
As an optional implementation manner, in the first aspect of the present invention, before the client calls an Android system API in an Android device to randomly generate a UUID string, the method further includes:
the client acquires the device ID of the Android device to obtain a return value, and judges whether the return value is empty or not;
when the return value is judged to be empty, the client triggers and executes the operation of calling an Android system API in the Android device to randomly generate a UUID character string, so as to obtain a device ID;
when the return value is judged not to be empty, the client encrypts the return value through an encryption algorithm to obtain a unique ID of the equipment;
the device ID comprises one of an IMEI, an MAC address and an Android ID, and the acquisition priority when the device ID is acquired is as follows: IMEI > MAC address > Android ID.
As an optional implementation manner, in the first aspect of the present invention, before the client obtains the device ID of the Android device to obtain the return value, the method further includes:
the client reads the cache space of the client and judges whether a server ID which has binding relation with the unique ID of the Android device is stored in the cache space of the client or not;
When judging that the server-side ID which has a binding relation with the device unique ID of the Android device is not stored in the cache space of the client, the client reads the local storage space of the Android device and judges whether the device unique ID is stored in the local storage space of the Android device;
when judging that the equipment unique ID is stored in the local storage space of the Android equipment, the client reads the equipment unique ID and sends the equipment unique ID to the server for equipment registration;
and when judging that the device unique ID is not stored in the local storage space of the Android device, triggering and executing the operation of acquiring the device ID of the Android device to obtain a return value by the client.
The invention discloses a device unique ID generation system of Android devices, which comprises a client and a server, wherein the client comprises a calling module, a data processing module and a first communication module, and the server comprises a second communication module and a generation module, wherein:
the calling module is used for calling an Android system API in the Android device to randomly generate a UUID character string to obtain a device ID;
The data processing module is used for carrying out encryption processing on the equipment ID through an encryption algorithm to obtain an equipment unique ID;
the first communication module is used for sending the equipment unique ID to a server for equipment registration;
the second communication module is used for receiving the unique ID of the equipment;
the generation module is used for generating a server-side ID according to preset ID generation control conditions, wherein the unique equipment ID and the server-side ID have a binding relationship corresponding to each other on the server, and the binding relationship is recorded in a table structure of a database of the server.
In a second aspect of the present invention, the method for the calling module to call the Android system API in the Android device to randomly generate a UUID string specifically includes:
and the calling module calls an Android system API in the Android device through a programming language to randomly generate a UUID character string, wherein the programming language comprises one of a C language, a C++ language, a JAVA language and a Python language.
As an optional implementation manner, in the second aspect of the present invention, the client further includes a marking module, where:
The marking module is used for marking the type of the equipment unique ID through a type tag, wherein the type of the equipment unique ID comprises one of IMEI, MAC address, android ID and UUID;
the first communication module is further configured to send the device unique ID to a local storage space of the Android device for storage.
In a second aspect of the present invention, as an optional implementation manner, the server further includes a first judging module, and a registering module, where:
the first judging module is used for judging whether the equipment unique ID is subjected to equipment registration on the server;
the registration module is used for registering the Android device according to the device unique ID when the first judgment module judges that the device unique ID is not registered on the server, so as to trigger the generation module to execute the operation of generating the device unique ID according to preset ID generation control conditions;
the second communication module is further configured to return the server ID generated by the generating module to a client, so as to trigger the client to perform an operation of storing the server ID in a cache space of the client.
In a second aspect of the present invention, as an optional implementation manner, the client further includes an obtaining module, and a second judging module, where:
the acquisition module is used for acquiring the device ID of the Android device to obtain a return value;
the second judging module is used for judging whether the return value is empty, and triggering the calling module to execute the operation of calling an Android system API in the Android device to randomly generate a UUID character string to obtain a device ID when the return value is judged to be empty;
the data processing module is further configured to encrypt the return value through an encryption algorithm to obtain an equipment ID when the second judging module judges that the return value is not empty;
the device ID comprises one of an IMEI, an MAC address and an Android ID, and the acquisition priority when the acquisition module acquires the device ID is as follows: IMEI > MAC address > Android ID.
In a second aspect of the present invention, as an optional implementation manner, the client further includes a reading module and a third judging module, where:
the reading module is used for reading the cache space of the client;
the third judging module is used for judging whether a server-side ID which has a binding relation with the device unique ID of the Android device is stored in the cache space of the client side;
The reading module is further configured to read a local storage space of the Android device when the third judging module judges that the server ID having a binding relationship with the device unique ID of the Android device is not stored in the cache space of the client;
the third judging module is further configured to judge whether a device unique ID of the Android device is stored in the local storage space of the Android device, and trigger the acquiring module to execute an operation of acquiring the device ID of the Android device when it is judged that the device unique ID of the Android device is not stored in the local storage space of the Android device;
the reading module is further configured to, when the third judging module judges that the device unique ID of the Android device is stored in the local storage space of the Android device, read the device unique ID, so as to trigger the first communication module to perform an operation of sending the device unique ID to the server for device registration.
The third aspect of the present invention discloses another device unique ID generating apparatus for an Android device, where the apparatus includes:
a memory storing executable program code;
A processor coupled to the memory;
and the processor calls the executable program codes stored in the memory to execute the device unique ID generation method of the Android device disclosed by the first aspect of the invention.
The fourth aspect of the present invention discloses a computer storage medium, where computer instructions are stored, where the computer instructions are used to execute the device unique ID generation method of the Android device disclosed in the first aspect of the present invention when the computer instructions are called.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, a client calls an Android system API in an Android device to randomly generate a UUID character string to obtain a device ID; the client encrypts the equipment ID through an encryption algorithm to obtain an equipment unique ID; the client sends the unique ID of the equipment to a server for equipment registration; the server receives the device unique ID and generates a client ID according to a preset ID generation control condition. Therefore, by means of the method, the device ID can be generated by calling the API of the Android system, and combined with various methods for obtaining the device ID, the device ID is stored in an encrypted mode and is bound with the server-side ID, and the safe and stable device unique ID is generated on the Android system of the Android device to mark the device, so that the Android device is accurately managed and controlled.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a method for generating a device unique ID of an Android device according to an embodiment of the present invention;
fig. 2 is a flow chart of another method for generating a device unique ID of an Android device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an equipment unique ID generation system of an Android device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another device unique ID generation system of an Android device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a device unique ID generating device of an Android device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms first, second and the like in the description and in the claims and in the above-described figures are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, apparatus, article, or article that comprises a list of steps or elements is not limited to only those listed but may optionally include other steps or elements not listed or inherent to such process, method, article, or article.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the invention. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
The invention discloses a device unique ID generation method and system of Android devices, which can generate stable device unique IDs in an Android system of the Android devices to mark the devices, so that the Android devices are accurately controlled. The following will describe in detail.
Example 1
Referring to fig. 1, fig. 1 is a flowchart of a method for generating a device unique ID of an Android device according to an embodiment of the present invention. The method for generating the device unique ID of the Android device described in fig. 1 can be applied to an enterprise terminal management system, and can also be applied to all scenes of managing intelligent terminals in units needing to use various terminals, such as government institutions, education, finance, transportation, telecom and the like. The intelligent terminal is an intelligent device provided with an Android system, such as an Android development board, a smart phone, a tablet personal computer, an intelligent wearable device (such as a smart phone watch), a face recognition access control device, an automatic vending machine, a doll grabbing machine, a handheld POS machine, a government affair self-service machine, a cash register, an automobile multimedia, an electronic banquet, an express delivery collection cabinet, a cinema ticket taking machine, an advertisement video machine and the like, and the embodiment of the invention is not limited. As shown in fig. 1, the method for generating the device unique ID of the Android device may include the following operations:
101. and the client calls an Android system API in the Android device to randomly generate a UUID character string, and a device ID is obtained.
In the embodiment of the invention, the client can be an application program in the Android device or proxy software independent of the application program in the Android device, and the embodiment of the invention is not limited.
In the embodiment of the invention, the Android device can comprise any device in devices using an Android system, and the embodiment of the invention is not limited.
In the embodiment of the present invention, the version of the Android system may include any version of the current released version, and the embodiment of the present invention is not limited.
In the embodiment of the invention, the API may be understood as an application program interface or an application programming interface, and the API may include any API that can randomly generate a UUID string in an Android system in the Android device.
In the embodiment of the invention, it is to be noted that the operation of calling the Android system API in the Android device by the client to randomly generate the UUID character string can be performed without obtaining any authority, wherein the content of the UUID character string which is randomly generated is different when the client executes the operation of calling the Android system API in the Android device to randomly generate the UUID character string each time.
In this embodiment of the present invention, as an optional implementation manner, the client calls an Android system API in the Android device to randomly generate a UUID string, which may include:
And the client calls an Android system API in the Android device through a programming language to randomly generate a UUID character string.
In this optional embodiment, the programming language may include any programming language capable of calling an Android system API in an Android device to randomly generate a UUID string, such as a C language, a c++ language, a JAVA language, and a Python language, which is not limited in the embodiment of the present invention.
Therefore, the method and the device can randomly generate the UUID character string by calling the Android system API in the Android device through the client without any permission, so that the device ID is obtained, the step of generating the device ID of the Android device by the client is reduced, the difficulty of acquiring the device ID of the Android device by the client is reduced, the uniqueness of the device ID of the Android device generated by the client is ensured, and the stability of generating the device unique ID by the device unique ID generating method of the Android device is further improved.
As an optional embodiment, before executing step 101, the method for generating a device unique ID of the Android device may further include the following steps:
the client acquires the device ID of the Android device to obtain a return value, and judges whether the return value is empty;
When the return value is judged to be empty, triggering and executing the step 101 by the client;
when the return value is judged not to be empty, triggering and executing step 102 by the client;
the device ID may include one of IMEI, MAC address, and Android ID, where the acquiring priority when acquiring the device ID of the Android device is: IMEI > MAC address > Android ID.
Therefore, in the optional embodiment, the stability of acquiring the device ID of the Android device can be improved through various ways of acquiring the device ID of the Android device, and further, the stability of generating the device unique ID through the device unique ID generating method of the Android device can be improved.
As an alternative embodiment, before executing step 101, the method for generating a device unique ID of the Android device may further include the following steps:
the client reads the cache space of the client and judges whether the cache space of the client stores a server ID which has binding relation with the unique ID of the Android device;
when judging that the cache space of the client does not store the server ID which has binding relation with the device unique ID of the Android device, the client reads the local storage space of the Android device and judges whether the device unique ID is stored in the local storage space of the Android device;
When judging that the local storage space of the Android device stores the device unique ID, the client reads the device unique ID and sends the device unique ID to the server for device registration;
and when judging that the unique device ID is not stored in the local storage space of the Android device, triggering and executing the operation of acquiring the device ID of the Android device to obtain a return value by the client.
102. And the client encrypts the equipment ID through an encryption algorithm to obtain the equipment unique ID.
In the embodiment of the present invention, the encryption algorithm may include any encryption algorithm capable of performing encryption processing on the UUID string, such as MD5 and SHA256, and the embodiment of the present invention is not limited.
103. And the client sends the device unique ID to the server for device registration.
As yet another alternative embodiment, after performing step 102 and before performing step 103, the device unique ID generating method of the Android device may further include the steps of:
and the client marks the type of the unique ID of the device by using the type tag, and sends the device ID to a local storage space of the Android device for storage.
In this alternative embodiment, the type of the device unique ID may include any ID type that may mark the device unique, such as IMEI, MAC address, android ID, UUID, etc., which is not limited in the embodiment of the present invention.
In the optional embodiment, it should be noted that, the "local" referred to by this optional embodiment may be understood as external storage of the Android device, which may be an external SD card of the Android device, or a partial partition of an internal memory card of the Android device; the external storage space may include a public storage space of the SD card and a cache space of the client, which is not limited in the embodiment of the present invention.
It can be seen that, in this optional embodiment, the device unique ID generated by the client may be stored in a public storage space of the local storage space of the Android device and a cache space of the client, and when the client is unloaded, and the device unique ID is deleted and cannot be read from the cache space of the client, the device unique ID may also be read from the public storage space of the SD card of the Android device.
104. The server receives the unique ID of the equipment and generates a server-side ID according to preset ID generation control conditions.
In the embodiment of the invention, the unique ID of the equipment and the ID of the server end are in a one-to-one corresponding binding relation on the server, and the binding relation is recorded in a table structure of a database of the server.
As a further alternative embodiment, after the server receives the device unique ID, the method for generating the device unique ID of the Android device may further include the following steps before the server generates the server-side ID according to the preset ID generation control condition
The server judges whether the device unique ID is registered on the server;
when the equipment unique ID is judged not to be registered on the server, the server registers the Android equipment according to the equipment unique ID and triggers the server to execute the operation of generating the server-side ID according to the preset ID generation control condition.
As yet another optional embodiment, after performing step 104, the device unique ID generating method of the Android device may further include the following steps:
the server returns the generated server ID to the client;
the client stores the server side ID in the client's cache space.
Therefore, the method for generating the device unique ID of the Android device described in fig. 1 can generate the safe and stable device unique ID on the Android system of the Android device by calling the method for generating the UUID character of the Android system API, encrypting the device ID, and generating the server-side ID which has a binding relation with the device unique ID generated by the client through the server.
Example two
Referring to fig. 2, fig. 2 is a flowchart illustrating another method for generating a device unique ID of an Android device according to an embodiment of the present invention. The method for generating the device unique ID of the Android device described in fig. 2 can be applied to an enterprise terminal management system, and can also be applied to all scenes of managing intelligent terminals in units needing to use various terminals, such as government institutions, education, finance, transportation, telecom and the like. The intelligent terminal is an intelligent device provided with an Android system, such as an Android development board, a smart phone, a tablet personal computer, an intelligent wearable device (such as a smart phone watch), a face recognition access control device, an automatic vending machine, a doll grabbing machine, a handheld POS machine, a government self-service machine, a cash register, an automobile multimedia, an electronic banquet, an express cabinet, a cinema ticket taking machine, an advertisement video machine and the like, and the embodiment of the invention is not limited. As shown in fig. 2, the method for generating the device unique ID of the Android device may include the following operations:
201. The client reads the cache space of the client.
202. The client judges whether the server side ID having a binding relationship with the device unique ID of the Android device is stored in the cache space of the client, and when the judging result of the step 202 is no, the client is triggered to execute the step 203, and when the judging result of the step 202 is yes, the process can be ended.
203. And the client reads the local storage space of the Android device.
In an embodiment of the present invention, as an optional implementation manner, the reading, by the client, the local storage space of the Android device may include:
and reading the cache space of the client.
Further optionally, the public storage space of the SD card of the Android device is read.
204. The client judges whether the local space of the Android device stores a device unique ID or not, and when the judging result of the step 204 is yes, the client is triggered to execute the step 205; when the result of the determination in step 204 is no, the client is triggered to execute step 206.
205. And the client sends the device unique ID in the local storage space to the server for device registration.
206. And the client acquires the device ID of the Android device to obtain a return value.
In an embodiment of the present invention, as an optional implementation manner, the obtaining, by the client, the device ID of the Android device to obtain the return value may include:
The method comprises the steps that a client obtains an IMEI of Android equipment to obtain a first return value, and whether the first return value is empty or not is judged;
triggering the client to execute step 209 when the first return value is not empty;
when the first return value is judged to be empty, the client acquires the MAC address of the Android device to obtain a second return value, and judges whether the second return value is a default value or not;
triggering the client to execute step 209 when the second return value is not the default value;
when the second return value is judged to be a default value, the client acquires the Android ID of the Android device to obtain a third return value, and judges whether the third return value is empty or not;
triggering the client to execute step 209 when the third return value is not empty;
when the third return value is determined to be null, the client is triggered to execute step 208.
Therefore, the device ID of the Android device can be obtained in various modes, so that the stability of generating the unique device ID of the Android device by the client is improved.
207. The client judges whether the return value is empty, and when the judgment result of the step 207 is negative, the client is triggered to execute the step 209; when the result of the determination in step 207 is yes, the client is triggered to execute step 208.
208. And the client calls an Android system API in the Android device to randomly generate a UUID character string, and a device ID is obtained.
209. The client encrypts the equipment ID through an encryption algorithm to obtain the unique equipment ID.
210. The client marks the type of the unique ID of the device through the type tag, and stores the unique ID of the device into a local storage space of the Android device.
In an embodiment of the present invention, as an optional implementation manner, the storing, by the client, the device unique ID in the local storage space of the Android device may include:
and storing the device unique ID into a local storage space of the Android device in a local storage mode.
In this alternative embodiment, the local Storage manner may include one of cookie, localStorage, session Storage, and session, which is not limited in the embodiment of the present invention.
211. And the client sends the device unique ID generated by the client to the server for device registration.
212. The server judges whether the device unique ID is registered on the server, and when the judgment result of step 212 is yes, the server is triggered to execute step 214; when the result of the determination in step 212 is no, the trigger server executes step 213.
213. And the server registers the Android device according to the unique ID of the device, and generates a server-side ID according to preset ID generation control conditions.
214. The server sends the server-side ID with the one-to-one corresponding binding relation with the device unique ID to the client side, and triggers the client side to execute the operation of storing the server-side ID in the cache space of the client side.
In the embodiment of the present invention, the descriptions of step 208, step 209, step 211 and step 213 refer to the detailed descriptions of step 101-step 104 in the embodiment, and the description of the embodiment of the present invention is omitted.
Therefore, the method for generating the unique device ID of the Android device described in FIG. 2 can reduce the step of generating the device ID of the Android device by the client, reduce the difficulty of generating the device ID of the Android device by the client, ensure the uniqueness of the device ID generated by the client, further improve the uniqueness of the device unique ID generated by the device unique ID generating system of the Android device, and generate the server-side ID bound with the device unique ID by the server under the condition that no permission exists; and the stability of generating the unique ID of the equipment by the client can be improved by firstly acquiring the IMEI, the MAC address and the Android ID of the Android equipment. In addition, the security of the unique device ID generated by the client is enhanced by encrypting the device ID; the device unique ID generated by the client can be stored in the local storage space of the Android device, so that when the device ID cannot be obtained in the cache space of the client after the client is reinstalled, the device unique ID can be obtained from the public storage space of the local storage space of the Android device; in summary, the method for generating the device unique ID of the Android device described in fig. 2 can generate the secure and stable device unique ID on the Android system of the Android device by calling the Android system API to generate the UUID string, combining various methods for acquiring the device ID, encrypting the device ID, binding the device unique ID generated by the client with the server-side ID generated by the server.
Example III
Referring to fig. 3, fig. 3 is a schematic structural diagram of an apparatus unique ID generation system of an Android apparatus according to an embodiment of the present invention. As shown in fig. 3, the device unique ID generation system of the Android device may include a client and a server, where the client may include a calling module 301, a data processing module 302, a first communication module 303, and the server may include a second communication module 304, and a generating module 305, where:
and the calling module 301 is configured to call an Android system API in the Android device to randomly generate a UUID string, so as to obtain a device ID.
In this embodiment of the present invention, as an optional implementation manner, a manner in which the calling module 301 calls an Android system API in an Android device to randomly generate a UUID string is specifically:
the calling module 301 calls an Android system API in the Android device through a programming language to randomly generate a UUID character string, and obtains a device ID.
In this alternative embodiment, the programming language may include one of a C language, a c++ language, a JAVA language, and a Python language, which is not limited by the embodiment of the present invention.
The data processing module 302 is configured to perform encryption processing on the device ID through an encryption algorithm, so as to obtain a device unique ID.
The first communication module 303 is configured to send the device unique ID to a server for device registration.
A second communication module 304, configured to receive the device unique ID.
The generating module 305 is configured to generate a server ID according to a preset ID generation control condition.
In the embodiment of the invention, the unique ID of the equipment and the ID of the server end have a one-to-one corresponding binding relationship on the server, and the binding relationship is recorded in a table structure of a database of the server.
Therefore, the device unique ID generation system of the Android device described in fig. 3 can generate the secure and stable device unique ID on the Android system of the Android device by calling the method of the Android system API to generate the UUID character, encrypting the device ID, and generating the server side ID having a binding relationship with the device unique ID generated by the client side through the server.
As an alternative embodiment, the device unique ID generation system of the Android device may further include a marking module 306. At this time, the device unique ID generation system of the Android device may be shown in fig. 4, and fig. 4 is a schematic structural diagram of another device unique ID generation system of an Android device disclosed in the embodiment of the present invention, where:
The marking module 306 is configured to mark a type of the device unique ID by a type tag after the data processing module 302 performs encryption processing on the device ID by using an encryption algorithm to obtain the device unique ID, and before the first communication module 303 sends the device unique ID to the server for device registration.
In this alternative embodiment, the type of the device unique ID may include any type of ID that may be used to mark the device unique, such as IMEI, MAC address, androidID, UUID, and the embodiment of the present invention is not limited.
In this alternative embodiment, after the marking module 306 performs the operation of marking the type of the device unique ID by the type tag, the first communication module 303 may be triggered to perform the operation of sending the device unique ID to the local storage space of the Android device for storing.
As another optional embodiment, as shown in fig. 4, the device unique ID generation system of the Android device may further include a first judging module 307 and a registering module 308, where:
a first determining module 307 is configured to determine whether the device unique ID is registered with the server.
The registration module 308 is configured to register the Android device according to the device unique ID when the first determination module 301 determines that the device unique ID is not registered on the server, so as to trigger the generation module 305 to execute an operation of generating a server ID according to a preset ID generation control condition.
In this optional embodiment, further optionally, the second communication module 304 is further configured to return the server ID generated by the generating module 305 to the client, so as to trigger the client to perform an operation of storing the server ID in a cache space of the client.
As yet another optional embodiment, as shown in fig. 4, the device unique ID generation system of the Android device may further include an obtaining module 309 and a second judging module 310, where:
and the obtaining module 309 is configured to obtain a device ID of the Android device to obtain a return value.
In this optional embodiment, the device ID may include one of IMEI, MAC address, and Android ID, where the acquisition priority when the acquisition module acquires the device ID is: IMEI > MAC address > Android ID.
And a second judging module 310, configured to judge whether the return value is null, and when the return value is determined to be null, trigger the calling module 301 to execute an operation of calling the Android system API in the Android device to randomly generate a UUID string, so as to obtain a device ID.
In this alternative embodiment, the data processing module 302 is further optionally further configured to, when the second judging module judges that the return value is not null, encrypt the return value by using an encryption algorithm to obtain the device unique ID.
As yet another optional embodiment, as shown in fig. 4, the device unique ID generation system of the Android device may further include a reading module 311 and a third judging module 312, where:
the reading module 311 is configured to read the cache space of the client.
And a third judging module 312, configured to judge whether a server ID having a binding relationship with the device unique ID of the Android device is stored in the cache space of the client.
In this optional embodiment, further optionally, the reading module 311 is further configured to read the local storage space of the Android device when the third judging module 312 judges that the server ID having a binding relationship with the device unique ID of the Android device is not stored in the cache space of the client.
Still further optionally, the third determining module 312 is further configured to determine whether the device unique ID of the Android device is stored in the local storage space of the Android device, and when it is determined that the device unique ID of the Android device is not stored in the local storage space of the Android device, trigger the acquiring module 309 to execute an operation of acquiring the device ID of the Android device.
Still further optionally, the reading module 311 is further configured to, when the third judging module judges that the device unique ID of the Android device is stored in the local storage space of the Android device, read the device unique ID, so as to trigger the first communication module to perform an operation of sending the device unique ID to the server for device registration.
Therefore, the device unique ID generation system of the Android device described in fig. 4 can reduce the step of generating the device ID of the Android device by the client, reduce the difficulty of generating the device ID of the Android device by the client, ensure the uniqueness of the device ID generated by the client, further improve the uniqueness of the device unique ID generated by the device unique ID generation system of the Android device, and generate the server ID bound with the device unique ID by the server under the condition that no permission exists, so that the uniqueness of the device unique ID is enhanced; and the stability of generating the unique ID of the equipment by the client can be improved by firstly acquiring the IMEI, the MAC address and the Android ID of the Android equipment. In addition, the security of the unique device ID generated by the client is enhanced by encrypting the device ID; the device unique ID generated by the client can be stored in the local storage space of the Android device, so that when the device ID cannot be obtained in the cache space of the client after the client is reinstalled, the device unique ID can be obtained from the public storage space of the local storage space of the Android device; in summary, the device unique ID generation system of the Android device described in fig. 4 can generate a secure and stable device unique ID on the Android system of the Android device by calling an Android system API to generate a UUID string, combining various methods for acquiring the device ID, performing encryption processing on the device ID, and binding the device unique ID generated by the client with a server-side ID generated by the server.
Example IV
Referring to fig. 5, fig. 5 is a schematic structural diagram of an apparatus unique ID generating device of an Android apparatus according to an embodiment of the present invention. As shown in fig. 5, the device unique ID generating method and apparatus of the Android device may include:
a memory 401 storing executable program codes;
a processor 402 coupled with the memory 401;
the processor 402 invokes executable program codes stored in the memory 401 to execute steps executed by a client or steps executed by a server in the device unique ID generation method of the Android device described in the first embodiment or the second embodiment of the present invention.
Example five
The embodiment of the invention discloses a computer storage medium which stores computer instructions for executing steps executed by a client or steps executed by a server in a device unique ID generation method of an Android device described in the first or second embodiment of the invention when the computer instructions are called.
Example six
An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute a step executed by a client or a step executed by a server in a device unique ID generation method of an Android device described in the first embodiment or the second embodiment.
The apparatus embodiments described above are merely illustrative, wherein the modules illustrated as separate components may or may not be physically separate, and the components shown as modules may or may not be physical, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above detailed description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course by means of hardware. Based on such understanding, the foregoing technical solutions may be embodied essentially or in part in the form of a software product that may be stored in a computer-readable storage medium including Read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), programmable Read-Only Memory (Programmable Read-Only Memory, PROM), erasable programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), one-time programmable Read-Only Memory (OTPROM), electrically erasable programmable Read-Only Memory (EEPROM), compact disc Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM) or other optical disc Memory, magnetic disc Memory, tape Memory, or any other medium that can be used for computer-readable carrying or storing data.
Finally, it should be noted that: the method and the system for generating the device unique ID of the Android device disclosed by the embodiment of the invention are disclosed as the preferred embodiment of the invention, and are only used for illustrating the technical scheme of the invention, but are not limited to the technical scheme; although the invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that; the technical scheme recorded in the various embodiments can be modified or part of technical features in the technical scheme can be replaced equivalently; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (10)

1. The method for generating the device unique ID of the Android device is characterized by comprising the following steps:
the client calls an Android system API in the Android device to randomly generate a UUID character string, and a device ID is obtained;
the client encrypts the equipment ID through an encryption algorithm to obtain an equipment unique ID;
the client sends the equipment unique ID to a server for equipment registration;
the server receives the equipment unique ID and generates a server-side ID according to a preset ID generation control condition, wherein the equipment unique ID and the server-side ID have a one-to-one corresponding binding relationship on the server, and the binding relationship is recorded in a table structure of a database of the server.
2. The method for generating the device unique ID of the Android device according to claim 1, wherein the client calls an Android system API in the Android device to randomly generate a UUID string, and obtains a device ID, and the method comprises:
and the client calls an Android system API in the Android device through a programming language to randomly generate a UUID character string, wherein the programming language comprises one of a C language, a C++ language, a JAVA language and a Python language.
3. The method for generating the device unique ID of the Android device according to claim 2, wherein after the client encrypts the device ID by an encryption algorithm to obtain the device unique ID, the client sends the device unique ID to a server for device registration, so as to trigger the server to generate the server ID, and before the method further comprises:
the client marks the type of the equipment unique ID through a type tag, and stores the equipment unique ID into a local storage space of the Android equipment, wherein the type of the equipment unique ID comprises one of IMEI, MAC address, android ID and UUID.
4. The method for generating a device unique ID of an Android device according to claim 3, wherein after the server receives the device unique ID, before the server generates a server-side ID according to a preset ID generation control condition, the method further comprises:
The server judges whether the equipment unique ID is registered on the server or not;
when judging that the equipment unique ID is not registered on the server, the server registers the Android equipment according to the equipment unique ID so as to trigger the server to execute the operation of generating the server-side ID according to preset ID generation control conditions;
and, the method further comprises:
the server returns the generated server side ID to the client side;
and the client stores the server ID into a cache space of the client.
5. The method for generating the device unique ID of the Android device according to claim 4, wherein before the client calls the Android system API in the Android device to randomly generate a UUID string, the method further comprises:
the client acquires the device ID of the Android device to obtain a return value, and judges whether the return value is empty or not;
when the return value is judged to be empty, the client triggers and executes the operation of calling an Android system API in the Android device to randomly generate a UUID character string, so as to obtain a device ID;
When the return value is judged not to be empty, the client encrypts the return value through an encryption algorithm to obtain a unique ID of the equipment;
the device ID comprises one of an IMEI, an MAC address and an Android ID, and the acquisition priority when the device ID is acquired is as follows: IMEI > MAC address > Android ID.
6. The method for generating the device unique ID of the Android device according to claim 5, wherein before the client obtains the device ID of the Android device to obtain the return value, the method further comprises:
the client reads the cache space of the client and judges whether a server ID which has binding relation with the unique ID of the Android device is stored in the cache space of the client or not;
when judging that the server-side ID which has a binding relation with the device unique ID of the Android device is not stored in the cache space of the client, the client reads the local storage space of the Android device and judges whether the device unique ID is stored in the local storage space of the Android device;
when judging that the equipment unique ID is stored in the local storage space of the Android equipment, the client reads the equipment unique ID and sends the equipment unique ID to the server for equipment registration;
And when judging that the device unique ID is not stored in the local storage space of the Android device, triggering and executing the operation of acquiring the device ID of the Android device to obtain a return value by the client.
7. The device unique ID generation system of the Android device is characterized by comprising a client and a server, wherein the client comprises a calling module, a data processing module and a first communication module, and the server comprises a second communication module and a generation module, wherein:
the calling module is used for calling an Android system API in the Android device to randomly generate a UUID character string to obtain a device ID;
the data processing module is used for carrying out encryption processing on the equipment ID through an encryption algorithm to obtain an equipment unique ID;
the first communication module is used for sending the equipment unique ID to a server for equipment registration;
the second communication module is used for receiving the unique ID of the equipment;
the generation module is used for generating a server-side ID according to preset ID generation control conditions, wherein the unique equipment ID and the server-side ID have a binding relationship corresponding to each other on the server, and the binding relationship is recorded in a table structure of a database of the server.
8. The device unique ID generation system of an Android device according to claim 7, wherein the method for calling an Android system API in the Android device to randomly generate a UUID string by the calling module is specifically:
and the calling module calls an Android system API in the Android device through a programming language to randomly generate a UUID character string, wherein the programming language comprises one of a C language, a C++ language, a JAVA language and a Python language.
9. An apparatus for generating a device unique ID of an Android device, the apparatus comprising:
a memory storing executable program code;
a processor coupled to the memory;
the processor invokes the executable program code stored in the memory to perform the device unique ID generation method of the Android device of any one of claims 1-6.
10. A computer storage medium storing computer instructions that, when invoked, perform the device unique ID generation method of the Android device of any one of claims 1-6.
CN202211623446.0A 2022-12-16 2022-12-16 Method and system for generating device unique ID of Android device Pending CN116244764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211623446.0A CN116244764A (en) 2022-12-16 2022-12-16 Method and system for generating device unique ID of Android device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211623446.0A CN116244764A (en) 2022-12-16 2022-12-16 Method and system for generating device unique ID of Android device

Publications (1)

Publication Number Publication Date
CN116244764A true CN116244764A (en) 2023-06-09

Family

ID=86626673

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211623446.0A Pending CN116244764A (en) 2022-12-16 2022-12-16 Method and system for generating device unique ID of Android device

Country Status (1)

Country Link
CN (1) CN116244764A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116723170A (en) * 2023-08-08 2023-09-08 成都初心互动科技有限公司 Method, device, equipment and medium for generating unique identifier of mobile terminal equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116723170A (en) * 2023-08-08 2023-09-08 成都初心互动科技有限公司 Method, device, equipment and medium for generating unique identifier of mobile terminal equipment

Similar Documents

Publication Publication Date Title
US10073916B2 (en) Method and system for facilitating terminal identifiers
US9854431B2 (en) Method, apparatus, and system of distributing data of virtual subscriber identity module
US10231124B2 (en) Anti-theft method and client for a mobile terminal
US20190342753A1 (en) Device configuration method, apparatus and system
US11099889B2 (en) Method-call-chain tracking method, electronic device, and computer readable storage medium
CN103051733B (en) Data downloading method, terminal and system
CN107623907B (en) eSIM card network locking method, terminal and network locking authentication server
US20140273973A1 (en) Method and system for replacing key deployed in se of mobile terminal
CN116244764A (en) Method and system for generating device unique ID of Android device
US20180357059A1 (en) Method for managing a package in a secure element
CN112818270B (en) Data cross-domain transfer method and device and computer equipment
CN110163314A (en) A kind of anti-method, apparatus, computer system and readable storage medium storing program for executing of registering of practising fraud
CN111612947A (en) Method, equipment and storage medium for processing communication abnormity of intelligent lock
US20180107840A1 (en) Method of restoring a secure element to a factory state
CN108667647B (en) Method and device for setting device parameters and server
CN108038403B (en) Card reading method based on NFC technology and client
CN107493288B (en) Application network security control method and device based on Android POS
CN116304403A (en) Webpage access method and device, computer equipment and storage medium
CN110875895A (en) Method, system, equipment and vehicle for realizing intelligent terminal software login
CN106937281B (en) Terminal application management method and device, terminal and server
CN114912097A (en) Certificate verification method and device, electronic equipment and storage medium
WO2017143931A1 (en) Method and apparatus for identifying smart card, method and apparatus for processing smart card identification data, and device
CN111736859B (en) Version updating method of operating system, server and terminal
CN110597557B (en) System information acquisition method, terminal and medium
CN113742702A (en) Method, system, equipment and storage medium for safety access based on enterprise WeChat

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