CN115563594A - User identifier acquisition method and device, electronic equipment and storage medium - Google Patents

User identifier acquisition method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115563594A
CN115563594A CN202211240871.1A CN202211240871A CN115563594A CN 115563594 A CN115563594 A CN 115563594A CN 202211240871 A CN202211240871 A CN 202211240871A CN 115563594 A CN115563594 A CN 115563594A
Authority
CN
China
Prior art keywords
target
user
app
target app
random code
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
CN202211240871.1A
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 Securities Co Ltd
Original Assignee
China Securities 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 Securities Co Ltd filed Critical China Securities Co Ltd
Priority to CN202211240871.1A priority Critical patent/CN115563594A/en
Publication of CN115563594A publication Critical patent/CN115563594A/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/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • 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/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the invention provides a user identification obtaining method, a user identification obtaining device, electronic equipment and a storage medium, and relates to the technical field of computers, wherein the method comprises the following steps: when the target APP meets a preset user identification obtaining condition, detecting whether the target APP is authorized by a target user to have the operation permission about the reserved area; when the operation right of the target APP about the reserved area is detected to be authorized by the target user, whether the reserved area has a storage position about the target APP is identified, and an identification result is obtained; if the identification result is yes, inquiring a random code which accords with a specified text format from the storage position of the target APP in the retention area, and determining the inquired random code as the user identification of the target user; if the recognition result is negative, generating a random code which accords with the specified text format to obtain the user identification of the target user. By the scheme, the user can be identified when the hardware equipment information cannot be acquired and the privacy of the user is not violated.

Description

User identifier acquisition method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for obtaining a user identifier, an electronic device, and a storage medium.
Background
With the development of science and technology, more and more APPs (applications) emerge, each APP needs to distinguish different users, and statistics and analysis are performed on user using behaviors, so as to optimize user using experience, for example: different users can be distinguished for the video playing APP, and the user using behaviors are analyzed for each user, so that videos which are interesting to the users are pushed.
In the related art, each APP identifies different users by acquiring hardware device information of devices used by the users. The hardware device information may include: IMEI (International Mobile Equipment Identity), ANDROID _ ID (unique ID of ANDROID system DEVICE), and DEVICE _ ID (DEVICE ID).
However, with the enhancement of user privacy protection, access prohibition measures become more and more strict, and user authorization is required when hardware device information used by a user is acquired. If the user is not authorized, the hardware device information cannot be accessed and collected, and the scheme provided by the related art cannot be adopted to identify different users.
Therefore, how to identify the user is an urgent problem to be solved when the hardware device information cannot be collected and the privacy of the user is not violated.
Disclosure of Invention
The embodiment of the invention aims to provide a user identification obtaining method, a user identification obtaining device, electronic equipment and a storage medium, so as to identify a user when hardware equipment information cannot be collected and the privacy of the user is not invaded. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for obtaining a user identifier, where the method includes:
when a target APP meets a preset user identification obtaining condition, detecting whether the target APP is authorized by a target user and the operation authority of a reserved area is obtained; the reserved region is a storage region which is reserved for an operating system of the terminal equipment where the target APP operates and allows any APP to operate after the APP is authorized;
when the target APP is detected to be authorized by a target user and the operation right of the reserved area is obtained, whether the reserved area has a storage position related to the target APP is identified, and an identification result is obtained;
if the identification result is yes, inquiring a random code conforming to a specified text format from the storage position of the target APP in the retention area, and determining the inquired random code as the user identifier of the target user; the inquired random code is generated in advance by the target APP and is written into the storage position of the target APP;
if the recognition result is negative, generating a random code which accords with the specified text format to obtain the user identification of the target user.
Optionally, the method further comprises:
if a random code conforming to a specified text format is not inquired from the storage position of the target APP in the retention area, generating a random code conforming to the specified text format to obtain the user identifier of the target user.
Optionally, if a random code conforming to a specified text format is not queried from the storage location of the target APP in the retention region, a random code conforming to the specified text format is generated, and after the user identifier of the target user is obtained, the method further includes:
and storing the generated random code which accords with the specified text format to the retention area by using the storage position of the target APP.
Optionally, if the recognition result is negative, generating a random code conforming to the specified text format, and after obtaining the user identifier of the target user, the method further includes:
requesting a storage position of the target APP in the retention region from the operating system, so that the operating system allocates the storage position of the retention region to the target APP to obtain the storage position of the target APP;
and storing the generated random code which accords with the specified text format into the retention region by using the obtained storage position of the target APP.
Optionally, the storage location of any APP is a storage location with the packet name of the APP as a path;
the identifying whether the retention area has a storage position related to the target APP or not to obtain an identification result includes:
and identifying whether a storage position with the packet name of the target APP as a path exists in the retention area to obtain an identification result.
Optionally, the method further comprises:
if the operation authority of the target APP authorized by the target user about the retention region is not detected, requesting the authorization of the target user by using an authority authentication mode of the retention region of the operating system;
and if the authorization of the target user is successfully requested, executing the step of identifying whether the storage position of the target APP exists in the retention area or not to obtain an identification result.
Optionally, the method further comprises:
and when the target APP is unloaded, reserving the user identification of the target user in the storage position of the target APP in the retention region.
In a second aspect, an embodiment of the present invention provides an apparatus for obtaining a user identifier, where the apparatus includes:
the device comprises a detection module, a storage module and a processing module, wherein the detection module is used for detecting whether a target APP is authorized by a target user to have the operation permission about a reserved area when the target APP meets a preset user identification acquisition condition; the reserved region is a storage region which is reserved for an operating system of the terminal equipment where the target APP operates and allows any APP to operate after the APP is authorized;
the identification module is used for identifying whether the storage position of the target APP exists in the retention area or not when the operation right of the target APP about the retention area authorized by the target user is detected, and obtaining an identification result;
the query module is used for querying a random code conforming to a specified text format from the storage position of the target APP in the retention area if the identification result is yes, and determining the queried random code as the user identifier of the target user; the inquired random code is generated in advance by the target APP and is written into the storage position of the target APP;
and the generating module is used for generating a random code which accords with the specified text format if the recognition result is negative, so as to obtain the user identification of the target user.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any user identification acquisition method when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention 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 computer program implements any one of the user identifier obtaining methods.
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 above-mentioned user identifier obtaining methods.
The embodiment of the invention has the following beneficial effects:
according to the user identifier obtaining method provided by the embodiment of the invention, when the target APP meets the preset user identifier obtaining condition, whether the target APP is authorized by the target user and has the operation authority about the retention region or not can be detected firstly, when the operation authority exists, whether the storage position about the target APP exists in the retention region or not can be identified, if the identification result is yes, the random code conforming to the specified text format can be inquired directly from the storage position about the target APP in the retention region, and the obtained random code is used as the user identifier of the target user; if the recognition result is negative, a random code conforming to the specified text format can be generated, so that the user identification of the target user is obtained. The user identifier obtaining method provided by the invention does not need to obtain hardware equipment information of user equipment, but identifies the target user based on the random code generated by the target APP used by the user, specifically, when the storage position of the target APP exists in the retention area, the random code in the specified text format can be directly obtained as the user identifier, and when the storage position of the target APP does not exist in the retention area, the random code in the specified text format can be generated as the user identifier of the target user. Therefore, the user can be identified when the hardware equipment information cannot be collected and the privacy of the user is not invaded through the scheme.
Of course, it is not necessary for any product or method to achieve all of the above-described advantages at the same time for practicing 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 embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other embodiments can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a schematic flowchart of a user identifier obtaining method according to an embodiment of the present invention;
fig. 2 is another schematic flow chart of a method for obtaining a user identifier according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a method for reading a target APP information retention area according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for writing a target APP information retention area according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a user identifier obtaining apparatus according to an embodiment of the present invention;
fig. 6 is a schematic 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 from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
In order to count and analyze user behaviors and optimize user experience, each APP needs to identify each user using the APP, so as to distinguish different users, and thus, the user behaviors are counted and analyzed for each user.
The related technology identifies users through equipment identification, so as to distinguish different users; the device identifier can be determined by using hardware device information used by a user, user authorization is required when the hardware device information is collected, along with enhancement of user privacy protection, access prohibition measures are stricter and stricter, namely, the user cannot generally authorize, so that the hardware device information cannot be collected, and at the moment, the user cannot be identified by using a related technology.
Moreover, when the user does not authorize the hardware device information, if the hardware device information is continuously collected, the user privacy can be violated, and strict user privacy protection measures cannot be met.
Based on this, the embodiment of the invention provides a user identifier obtaining method and device, an electronic device and a storage medium, so as to identify a user when hardware device information cannot be collected and user privacy is not violated.
First, a method for obtaining a user identifier according to an embodiment of the present invention is described below.
The user identifier obtaining method provided in the embodiment of the present invention may be applied to a terminal device, and exemplarily, the terminal device may be: the invention relates to a smart phone, a tablet computer, a desktop computer or a notebook computer, etc., and the invention does not limit the concrete form of the electronic equipment; the user identification acquisition method provided by the embodiment of the invention can be applied to any scene which can identify the user so as to distinguish the user identity, for example: user identification is needed to distinguish user identities so as to count, analyze scenes of user behaviors and the like.
Specifically, the execution main body of the user identifier obtaining method may be a user identifier obtaining apparatus, where the user identifier obtaining apparatus may be a plug-in a target APP, and the target APP is any APP with a user identifier obtaining requirement, for example, the target APP may be an APP with a user identifier obtaining requirement and used for realizing video playing, or an APP with a user identifier obtaining requirement and used for realizing consultation information display, and so on. The user identifier obtaining method provided by the embodiment of the invention can comprise the following steps:
when a target APP meets a preset user identifier acquisition condition, detecting whether the target APP is authorized by a target user and the operation authority of a reserved area is related; the reserved area is a storage area which is reserved for an operating system of the terminal equipment where the target APP runs and allows any APP to operate after the APP is authorized;
when the target APP is detected to be authorized by a target user and the operation right of the reserved area is obtained, whether the reserved area has a storage position related to the target APP is identified, and an identification result is obtained;
if the identification result is yes, inquiring a random code conforming to a specified text format from the storage position of the target APP in the retention area, and determining the inquired random code as the user identifier of the target user; the inquired random code is generated in advance by the target APP and is written into the storage position of the target APP;
if the recognition result is negative, generating a random code conforming to the specified text format to obtain the user identification of the target user.
According to the user identifier obtaining method provided by the embodiment of the invention, when the target APP meets the preset user identifier obtaining condition, whether the target APP is authorized by the target user and has the operation authority about the retention region or not can be detected firstly, when the operation authority exists, whether the storage position about the target APP exists in the retention region or not can be identified, if the identification result is yes, the random code conforming to the specified text format can be inquired directly from the storage position about the target APP in the retention region, and the obtained random code is used as the user identifier of the target user; if the recognition result is negative, a random code conforming to the specified text format can be generated, so that the user identification of the target user is obtained. The user identifier obtaining method provided by the invention does not need to obtain hardware equipment information of user equipment, but identifies the target user based on the random code generated by the target APP used by the user, specifically, when the storage position of the target APP exists in the retention area, the random code in the specified text format can be directly obtained as the user identifier, and when the storage position of the target APP does not exist in the retention area, the random code in the specified text format can be generated as the user identifier of the target user. Therefore, the user can be identified when the hardware equipment information cannot be collected and the privacy of the user is not invaded through the scheme.
A user identifier obtaining method provided in an embodiment of the present invention is described in detail below with reference to the accompanying drawings.
As shown in fig. 1, a method for obtaining a user identifier according to an embodiment of the present invention may include the following steps:
s101: when a target APP meets a preset user identifier acquisition condition, detecting whether the target APP is authorized by a target user and the operation authority of a reserved area is related;
the reserved area is a storage area which is reserved for an operating system of the terminal equipment where the target APP runs and allows any APP to operate after the APP is authorized; illustratively, the operating system may be an android system or an iOS (iPhone OS) system or the like.
The user identifier obtaining method provided by the embodiment of the invention can obtain the identifier of the user on the software level, namely the user identifier of the APP used by the user, so that when the target APP meets the preset user identifier obtaining condition, whether the target APP is authorized by the target user to have the authority about the reserved area is firstly detected, and the user identifier of the target user is obtained by executing the subsequent steps.
It should be noted that, for example, the predetermined user identifier obtaining condition may be the target APP start, and of course, the predetermined user identifier obtaining condition may be any condition that needs to distinguish the target user identity through the user identifier, and may also be any condition that needs to obtain the user identifier, which is not limited herein. The target APP can be any APP used by a target user, and the reserved region is a storage region which is reserved for an operating system of the terminal equipment where the target APP operates and allows any APP to operate after the APP is authorized; in order to solve the technical problem, in the scheme, the retention area can be used for storing the content representing the user identifier, namely the random code which accords with the specified text format in the following text, so that when the target APP needs to obtain the user identifier, whether the target APP is authorized by the target user about the operation authority of the retention area can be detected firstly, and subsequent steps are executed when the target APP has the operation authority, so that the user identifier of the target user is obtained. In addition, the retention area may store user identifiers of multiple APPs used by any target user, that is, the user identifiers of different APPs used by any user are different.
In addition, there are various ways to detect whether the target APP is authorized by the target user for the operation permission of the persistent region, which is not limited herein. For example, in an implementation manner, whether a target APP is authorized by a target user for operation permission of a retention region may be verified in a permission string manner, where the permission string is a character string with a specified number of digits, each digit represents a class of permission, each digit may have two values, one value represents that the permission is present, and the other value represents that the permission is not present, and at this time, when the permission string is used for verification, a target digit representing permission of the retention region may be determined first, and then a value of the target digit is determined, so as to verify whether the permission of the retention region is present. For example: a certain permission string of the target APP is 101, wherein each bit represents a type of permission, for the value of each bit, 1 represents that the type of permission is provided, and 0 represents that the type of permission is not provided; if the authority type represented by the character string is: and if the permission of using the reserved area, the permission of using the camera and the permission of using the address book are used, 101 represents that the target APP has the permission of using the reserved area and the permission of using the address book.
It should be noted that, the above description of the manner of detecting whether the target APP is authorized by the target user about the operation permission of the reserved area is merely an example, and for any target APP, the permission verification manner of the operating system of the terminal device in which the target APP runs may be utilized to perform permission verification of the reserved area, so as to achieve detection of whether the target APP is authorized by the target user about the operation permission of the reserved area, which is not limited herein.
S102: when the target APP is detected to be authorized by a target user and the operation right of the reserved area is obtained, whether the reserved area has a storage position related to the target APP is identified, and an identification result is obtained;
when the operation right of the target APP about the retention region authorized by the target user is detected, the target APP can operate the retention region, and for the target APP, the content of the user identification representing the target user can be stored in the retention region, so that whether the retention region has a storage position about the target APP or not can be further identified, an identification result is obtained, and then subsequent steps are executed to obtain the content of the user identification representing the target user. The storage position of the target APP is a position which is applied by the target APP and used for storing the content.
For example, in one implementation, the storage location related to any APP is a storage location with a packet name of the APP as a path;
the identifying whether the retention area has a storage position related to the target APP or not to obtain an identification result includes:
and identifying whether a storage position with the packet name of the target APP as a path exists in the retention area to obtain an identification result.
It should be noted that the storage location of any APP may be a storage location using the packet name of the APP as a path, that is, the packet name path of the APP may indicate the storage location of the APP in the retention area, for example: the retention region comprises a plurality of storage positions distinguished by packet names of the APPs, and for any APP, the packet name can be used for identifying the corresponding storage position of the APP to obtain an identification result, and the identification result can be used for identifying the storage position corresponding to the APP or not identifying the storage position corresponding to the APP. The above description of the manner of identifying whether the storage location of the target APP exists in the persistent region is merely an example, and should not be construed as a limitation to the present invention.
In some scenarios, the target APP may not be authorized by the target user for operating the persistent region, and the method further comprises:
if the target APP is not detected to be authorized by the target user and the operation authority of the reserved area is not detected, the authorization of the target user is requested by utilizing the authority authentication mode of the reserved area of the operating system;
and if the authorization of the target user is requested successfully, executing the step of identifying whether the storage position of the target APP exists in the retention area or not to obtain an identification result.
It can be understood that, regarding the operation authority of the persistent region, since it is not necessary to obtain information about the user and user equipment information, etc., and user privacy is not violated, the user usually authorizes, and when it is detected that the target APP is not authorized by the target user, the target user authorization may be requested, so as to perform the step of identifying whether the persistent region has a storage location about the target APP, and obtaining an identification result.
For example, in an implementation manner, the permission authentication manner of the persistent region of the operating system may be a manner of acquiring a user permission through a popup window, for example: through the mode of popup window 'whether the APP is allowed to use the permission of the reserved area', the target user can authorize the permission of the reserved area through clicking a determined mode.
It should be noted that, the above description of the permission authentication method for the persistent region of the operating system is only an example, and for any target APP, the permission authentication method of the operating system of the terminal device in which the target APP runs may be used to obtain the authorization of the target user for the persistent region, which is not limited herein.
S103: if the identification result is yes, inquiring a random code which accords with a specified text format from the storage position of the target APP in the retention area, and determining the inquired random code as the user identifier of the target user;
the inquired random code is generated in advance by the target APP and is written into the storage position of the target APP;
if the identification result is yes, namely the storage position of the target APP in the retention area is identified, the random code which conforms to the specified text format can be stored in the storage position, the random code which conforms to the specified text format can be inquired from the storage position of the target APP, and the inquired random code is used as the user identifier of the target user.
It should be noted that the storage location may be used only for storing a random code conforming to a specified text format for serving as a user identifier of a target user, and may also store other information, which is not limited herein. When the storage position is only used for storing the random code, whether content is stored at the storage position of the target APP can be inquired, and when the content is stored at the storage position, the stored content can be used as the random code conforming to the specified text format, and the inquired random code is determined as the user identification of the target user, namely the random code conforming to the specified text format is inquired by inquiring whether the storage position of the target APP stores the content; when the random code and other information are stored in the storage location, whether the random code conforming to the specified text format exists can be inquired from the content stored in the storage location, and if so, the random code is used as the user identification of the target user.
It should be noted that the random code in the specified text format may be a preset random code for identifying the user, and the specified text format may be any preset format, which is not limited herein.
Illustratively, in one implementation, the method further comprises:
and when the target APP is unloaded, reserving the user identification of the target user in the storage position of the target APP in the retention region.
It should be noted that the target user may uninstall the target APP, and certainly may reinstall the target APP, and in order to ensure that the user identifier of the target user of the target APP is unchanged after the uninstallation and reinstallation of the target APP, the user identifier of the target user in the storage location of the target APP in the retention region may be reserved.
S104: if the recognition result is negative, generating a random code conforming to the specified text format to obtain the user identification of the target user;
if the recognition result is negative, that is, the storage position of the target APP in the retention area is not recognized, the random code conforming to the specified text format does not exist in the retention area, and at this time, the random code conforming to the specified text format can be directly generated to serve as the user identifier of the target user.
It should be noted that the random code conforming to the specified text format may be generated by using a character string, and for example, the random code conforming to the specified text format may be a random code having a predetermined length of a character string and containing numbers and letters. The random code of the designated text format may be a preset random code for identifying the user, and the designated text format may be any preset format, which is not limited herein.
According to the user identifier obtaining method provided by the embodiment of the invention, when the target APP meets the preset user identifier obtaining condition, whether the target APP is authorized by the target user and the operation authority of the reserved area is obtained or not can be detected, when the operation authority exists, whether the reserved area has the storage position of the target APP or not can be identified, if the identification result is yes, the random code which accords with the specified text format can be directly inquired from the storage position of the target APP in the reserved area, and the obtained random code is used as the user identifier of the target user; if the recognition result is negative, a random code conforming to the specified text format can be generated, so that the user identification of the target user is obtained. The user identifier obtaining method provided by the invention does not need to obtain hardware equipment information of user equipment, but identifies the target user based on the random code generated by the target APP used by the user, specifically, when the storage position of the target APP exists in the retention area, the random code in the specified text format can be directly obtained as the user identifier, and when the storage position of the target APP does not exist in the retention area, the random code in the specified text format can be generated as the user identifier of the target user. Therefore, the user can be identified when the hardware equipment information cannot be collected and the privacy of the user is not invaded through the scheme.
Optionally, in another embodiment, if the recognition result is negative, a random code conforming to the specified text format is generated, and after the user identifier of the target user is obtained, the method further includes:
requesting a storage position of the target APP in the retention region from the operating system, so that the operating system allocates the storage position of the retention region to the target APP to obtain the storage position of the target APP;
and storing the generated random code which conforms to the specified text format into the retention area by using the obtained storage position of the target APP.
If the recognition result is no, namely the storage position of the target APP does not exist in the reserved area, the scheme can generate a random code which accords with the specified text format and is used as the user identifier of the target user. After the user identifier is obtained, in order to facilitate the target APP to acquire the user identifier of the target user next time, the storage position of the retention region about the target APP can be requested to the operating system, the operating system can allocate the storage position in the retention region for the target APP, and then the generated random code conforming to the specified text format can be stored to the retention region by using the allocated storage position about the target APP, and the user identifier of the target user can be acquired from the retention region about the storage position of the target APP subsequently.
It should be noted that, when allocating a storage location in the retention area for the target APP, the storage location related to the target APP may be allocated by using the packet name of the target APP as a path, so that when subsequently acquiring the user identifier of the target user from the storage location, the storage location related to the target APP may be determined by using the packet name of the target APP as a path.
By means of allocating the storage position in the retention area for the target APP, the generated random code in the specified text format can be stored in the retention area, when the user identification of the target user needs to be acquired by the subsequent target APP, the user identification of the target user can be directly acquired from the storage position, and the user identification acquisition efficiency can be improved.
Optionally, in another embodiment, the method further comprises:
if the random code conforming to the specified text format is not inquired from the storage position of the target APP in the retention area, generating the random code conforming to the specified text format to obtain the user identifier of the target user.
It should be noted that, the retention area may store a storage location related to the target APP, and the storage location may not store the random code in the specified text format, and at this time, the random code conforming to the specified text format may be generated as the user identifier of the target user.
For example, in an implementation manner, if a random code conforming to a specified text format is not queried from the storage location of the target APP in the persistent region, the method further includes, after obtaining the user identifier of the target user, generating a random code conforming to the specified text format:
and storing the generated random code which accords with the specified text format to the retention area by using the storage position of the target APP.
Since the storage location of the target APP may not store the random code in the specified text format, after the random code in the specified text format is generated, in order to facilitate next and subsequent acquisition of the user identifier of the target user, the generated random code may be stored in the retention area by using the storage location of the target APP.
According to the user identifier acquisition method provided by the invention, when the random code in the specified text format does not exist in the storage position of the target APP, the random code conforming to the specified text format can be generated to obtain the user identifier of the target user, and the generated random code can be stored in the reserved area by utilizing the storage position of the target APP, so that the user identifier of the target user aiming at the target APP can be inquired later, and the user identifier acquisition efficiency can be improved.
With reference to fig. 2, an android system is taken as an example to exemplarily introduce a user identifier obtaining method provided by the embodiment of the present invention.
As shown in fig. 2, the method for obtaining a user identifier according to an embodiment of the present invention may include the following steps:
s201: starting a target APP; the embodiment of the invention is to obtain the user identifier of the target user aiming at the target APP, and before obtaining the user identifier, the target APP can be started firstly, namely the preset user identifier obtaining condition, so that the user identifier is obtained by executing the subsequent steps.
S202: reading a target APP information retention area through a system method; after the target APP is started, the information of the target APP information retention region can be read by using a method of an operating system (such as an android system) of the terminal device in which the target APP runs, and the target APP information retention region is the retention region. The detailed description of step S202 will be described later, and will not be described herein.
S203: returning whether the content has a random code; that is, whether the content of the read target APP information retention area includes a random code, i.e., the random code conforming to the specified text format is identified, if so, step S204 is executed, and if not, step S205 is executed.
S204: as a software device identification; that is, the returned content includes a random code, and the obtained random code may be used as a software device identifier, where the software device identifier is, for the target APP, an identity of the user, and corresponds to the user identifier of the target user for the target APP. And inquiring a random code conforming to a specified text format at the storage position of the target APP in the retention area, and determining the inquired random code as the user identifier of the target user.
S205: generating a random code; that is, the returned content does not contain the random code, and the random code can be generated and used as the software device identifier. And correspondingly generating a random code which accords with the specified text format to obtain the user identification of the target user.
S206: writing in a target APP information retention area through a system method; when the returned content has no random code, the generated random code can be written into the target APP information retention area by using the method of the operating system (such as an android system) of the terminal equipment in which the target APP operates; the detailed description of step S206 will be described later, and will not be described herein.
Through this scheme, the content in target APP information retention region can be read to target APP, if acquire random code, then directly regard as software equipment sign to use, if do not acquire random code, can generate random code as software equipment sign to write in the convenient follow-up use of target APP information retention region. The method realizes that the target APP uses the software equipment identifier as the unique identifier, the target APP can generate a random code as the software equipment identifier, an authorization mechanism for accessing the APP information retention area is set, the APP produces and maintains the software equipment identifier information, the user privacy is protected, and the user can be identified when the hardware equipment information cannot be acquired and the user privacy is not invaded.
In addition, when the APP is unloaded, the android system does not clear the storage information in the packet name path of the APP information retention area.
Through the mechanism of permanent storage of the APP information retention area, even if the APP is uninstalled and reinstalled, the user does not change the software equipment identification of the APP, and the requirements of identifying the equipment used by the user and carrying out follow-up statistics on the user using behavior of the APP are met.
The above step S202 will be described in detail with reference to fig. 3.
As shown in fig. 3, the step of reading the target APP information retention region by calling the system method by the target APP includes the following steps:
s301: whether or not there is a right; detecting whether the target APP has the operation authority of the reserved area or not by using an authority verification method provided by the system, if so, executing a step S302, and if not, executing a step S303; and correspondingly detecting whether the target APP is authorized by the target user or not and the operation permission of the reserved area is obtained.
S302: whether the retention area has a target APP packet name path or not; when the target APP is detected to have the operation authority of the reserved area, whether the reserved area has a target APP packet name path or not can be further identified, if the identification result is yes, step S305 is executed, and if the identification result is no, step S304 is executed; and correspondingly identifying whether a storage position taking the packet name of the target APP as a path exists in the retention area or not, and obtaining an identification result.
S303: returning to empty; the target APP does not have the operation authority of the reserved area, the authority acquisition method provided by the system can be used for requesting the user for authorization, if the authorization fails, the information of the information reserved area of the target APP cannot be read, and the returned result is blank; if the authorization is successful, step S302 may be performed.
S304: returning to empty; namely, the reserved region has no target APP packet name path, namely, the reserved region has no storage position of the target APP, at this time, the information of the target APP information reserved region cannot be read, and then the return result is blank.
S305: returning storage information under a path corresponding to the packet name in the reserved area; when the retention region has a target APP packet name path, the storage information can be read from the target APP packet name path, and the storage information in the path corresponding to the packet name of the retention region is returned; corresponding to the storage location of the target APP in the retention area, a random code conforming to a specified text format is queried, and the queried random code may be determined as the user identifier of the target user subsequently.
The target APP can read the storage information of the target APP information retention region by calling a system method, whether the target APP has the permission of the retention region can be detected firstly, the storage position which takes the target APP packet name as a path in the retention region is determined, the corresponding storage information can be read from the storage position, the storage information of the target APP information retention region can be read by the system method, and therefore the follow-up user identification of the target user for the target APP can be determined.
The above step S206 will be described in detail with reference to fig. 4.
As shown in fig. 4, the target APP writes in the target APP information retention area by a system method, which includes the following steps;
s401: whether or not there is a right; detecting whether a target APP has the operation authority of a reserved area or not by using an authority verification method provided by the system, if so, executing a step S402, and if not, executing a step S403; and correspondingly detecting whether the target APP is authorized by the target user or not and the operation permission of the reserved area is obtained. Of course, this step can be omitted if the operating right of the existence of the reserved region is already authenticated.
S402: whether a target APP packet name path exists in the reserved area or not; when the target APP is detected to have the operation authority of the reserved area, whether the reserved area has the target APP packet name path or not can be further identified, if the identification result is yes, step S405 is executed, and if the identification result is no, step S404 is executed; and correspondingly identifying whether a storage position taking the packet name of the target APP as a path exists in the retention area or not, and obtaining an identification result.
S403: ending; the target APP does not have the authority of the reserved area, the authority obtaining method provided by the system can be used for requesting the user to authorize, and if the authorization fails, the user cannot be identified at the moment, and the result can be finished or returned to be blank; if the authorization is successful, the process continues to step S402. If the authorization still fails, the user unloads the target APP and reinstalls the target APP, the user can be identified as a new user, at this time, if the authorization of the user is requested to be successful, a random code can be generated to serve as the software equipment identifier of the user, and the random code can be stored in a reserved area to be convenient for subsequent use.
S404: the system creates a path corresponding to the target APP packet name in the retention area; if the retention region does not have the target APP packet name path, the operating system may be requested to create a path corresponding to the target APP packet name in the retention region, and the operating system may be requested to the storage location of the target APP in the retention region, so that the operating system allocates the storage location of the retention region to the target APP to obtain the storage location of the target APP.
S405: writing the storage area under the path corresponding to the packet name in the reserved area; when the retention region has a target APP packet name path or the system creates the target APP packet name path in the retention region, the generated random code can be written into the storage region under the path corresponding to the packet name in the retention region, and the generated random code conforming to the specified text format is stored into the retention region by using the storage position corresponding to the target APP.
The target APP can write the random code into the target APP information retention area by calling a system method, whether the target APP has the permission of the retention area can be detected firstly, the storage position taking the target APP packet name as a path in the retention area is determined, the generated random code can be written into the target APP information retention area by using the storage position, the random code can be written into the target APP information retention area by calling the system method through the scheme, and therefore the random code can be obtained from the retention area subsequently, and the user identification of a target user for the target APP is determined.
Based on the above method for obtaining a user identifier, an embodiment of the present invention further provides a device for obtaining a user identifier, where as shown in fig. 5, the device includes:
a detecting module 510, configured to detect, when a target APP meets a predetermined user identifier obtaining condition, whether the target APP is authorized by a target user for an operation permission of a leave region; the reserved area is a storage area which is reserved for an operating system of the terminal equipment where the target APP runs and allows any APP to operate after the APP is authorized;
the identifying module 520 is configured to identify whether the storage location of the target APP exists in the persistent region or not to obtain an identification result when it is detected that the target APP is authorized by the target user and the operation right of the persistent region is detected;
a query module 530, configured to query, if the identification result is yes, a random code that conforms to a specified text format from the storage location of the target APP in the retention area, and determine the queried random code as the user identifier of the target user; the inquired random code is generated in advance by the target APP and is written into the storage position of the target APP;
and the generating module 540 is configured to generate a random code conforming to the specified text format if the recognition result is negative, so as to obtain the user identifier of the target user.
According to the user identifier obtaining device provided by the embodiment of the invention, when the target APP meets the preset user identifier obtaining condition, whether the target APP is authorized by the target user and has the operation authority about the retention region or not can be detected firstly, when the operation authority exists, whether the storage position about the target APP exists in the retention region or not can be identified, if the identification result is yes, the random code conforming to the specified text format can be inquired directly from the storage position about the target APP in the retention region, and the obtained random code is used as the user identifier of the target user; if the recognition result is negative, a random code conforming to the specified text format can be generated, so that the user identification of the target user is obtained. The user identifier obtaining method provided by the invention does not need to obtain hardware equipment information of user equipment, but identifies the target user based on the random code generated by the target APP used by the user, specifically, when the storage position of the target APP exists in the retention area, the random code in the specified text format can be directly obtained as the user identifier, and when the storage position of the target APP does not exist in the retention area, the random code in the specified text format can be generated as the user identifier of the target user. Therefore, the user can be identified when the hardware equipment information cannot be collected and the privacy of the user is not invaded through the scheme.
Optionally, the generating module is further configured to:
if a random code conforming to a specified text format is not inquired from the storage position of the target APP in the retention area, generating a random code conforming to the specified text format to obtain the user identifier of the target user.
Optionally, the apparatus further comprises:
and the storage module is used for storing the generated random code which accords with the specified text format to the retention area by utilizing the storage position of the target APP.
Optionally, the apparatus further comprises:
a first request module, configured to request, from the operating system, a storage location of the target APP in the persistent region, so that the operating system allocates the storage location of the persistent region to the target APP, to obtain the storage location of the target APP; and storing the generated random code which conforms to the specified text format into the retention area by using the obtained storage position of the target APP.
Optionally, the storage location of any APP is a storage location with the packet name of the APP as a path;
the identification module is specifically configured to:
and identifying whether a storage position with the packet name of the target APP as a path exists in the retention area to obtain an identification result.
Optionally, the apparatus further comprises:
the second request module is used for requesting the authorization of the target user by utilizing an authority authentication mode of the retention region of the operating system if the operation authority of the target APP, which is authorized by the target user, on the retention region is not detected; and if the authorization of the target user is successfully requested, executing the step of identifying whether the storage position of the target APP exists in the retention area or not to obtain an identification result.
Optionally, the apparatus further comprises:
and the reservation module is used for reserving the user identifier of the target user in the storage position of the target APP in the retention region when the target APP is unloaded.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to implement any user identifier obtaining method when executing the program stored in the memory 603.
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 is not intended to represent only one bus or 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. Alternatively, the memory may 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.
In another embodiment of the present invention, a computer-readable storage medium is further provided, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements any one of the above-mentioned user identifier obtaining methods.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the user identification acquisition methods of 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 phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like 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, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
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 (10)

1. A method for obtaining user identification is characterized in that the method comprises the following steps:
when a target APP meets a preset user identifier acquisition condition, detecting whether the target APP is authorized by a target user and the operation authority of a reserved area is related; the reserved area is a storage area which is reserved for an operating system of the terminal equipment where the target APP runs and allows any APP to operate after the APP is authorized;
when the target APP is detected to be authorized by a target user and the operation right of the reserved area is obtained, whether the reserved area has a storage position related to the target APP is identified, and an identification result is obtained;
if the identification result is yes, inquiring a random code conforming to a specified text format from the storage position of the target APP in the retention area, and determining the inquired random code as the user identifier of the target user; the inquired random code is generated in advance by the target APP and is written into the storage position of the target APP;
if the recognition result is negative, generating a random code which accords with the specified text format to obtain the user identification of the target user.
2. The method of claim 1, further comprising:
if the random code conforming to the specified text format is not inquired from the storage position of the target APP in the retention area, generating the random code conforming to the specified text format to obtain the user identifier of the target user.
3. The method of claim 2, wherein if a random number conforming to a specified text format is not queried from the storage location of the target APP in the persistent region, generating a random number conforming to the specified text format, and after obtaining the user identifier of the target user, the method further comprises:
and storing the generated random code which accords with the specified text format to the retention area by using the storage position of the target APP.
4. The method of claim 1, wherein if the recognition result is negative, then generating a random code conforming to the specified text format, and after obtaining the user identifier of the target user, the method further comprises:
requesting a storage position of the target APP in the retention region from the operating system, so that the operating system allocates the storage position of the retention region to the target APP to obtain the storage position of the target APP;
and storing the generated random code which conforms to the specified text format into the retention area by using the obtained storage position of the target APP.
5. The method of claim 1, wherein the storage location for any APP is a storage location with the packet name of the APP as a path;
the identifying whether the storage position of the target APP exists in the retention area or not to obtain an identification result, including:
and identifying whether a storage position taking the packet name of the target APP as a path exists in the retention area to obtain an identification result.
6. The method of claim 1, further comprising:
if the operation authority of the target APP authorized by the target user about the retention region is not detected, requesting the authorization of the target user by using an authority authentication mode of the retention region of the operating system;
and if the authorization of the target user is requested successfully, executing the step of identifying whether the storage position of the target APP exists in the retention area or not to obtain an identification result.
7. The method according to any one of claims 1-6, further comprising:
and when the target APP is unloaded, reserving the user identification of the target user in the storage position of the target APP in the retention region.
8. An apparatus for obtaining a subscriber identity, the apparatus comprising:
the device comprises a detection module, a storage module and a processing module, wherein the detection module is used for detecting whether a target APP is authorized by a target user to have operation authority about a reserved area when the target APP meets a preset user identification acquisition condition; the reserved region is a storage region which is reserved for an operating system of the terminal equipment where the target APP operates and allows any APP to operate after the APP is authorized;
the identification module is used for identifying whether the storage position of the target APP exists in the retention area or not when the target APP is detected to be authorized by a target user and the operation right of the retention area is obtained;
the query module is used for querying a random code which accords with a specified text format from the storage position of the target APP in the retention area if the identification result is yes, and determining the queried random code as the user identifier of the target user; the inquired random code is generated in advance by the target APP and is written into the storage position of the target APP;
and the generating module is used for generating a random code which accords with the specified text format if the recognition result is negative, so as to obtain the user identification of the target user.
9. 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 subscriber identity acquisition method according to any one of claims 1 to 7 when executing a program stored in a memory.
10. 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, implements the subscriber identity acquisition method according to any one of claims 1 to 7.
CN202211240871.1A 2022-10-11 2022-10-11 User identifier acquisition method and device, electronic equipment and storage medium Pending CN115563594A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211240871.1A CN115563594A (en) 2022-10-11 2022-10-11 User identifier acquisition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211240871.1A CN115563594A (en) 2022-10-11 2022-10-11 User identifier acquisition method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115563594A true CN115563594A (en) 2023-01-03

Family

ID=84744695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211240871.1A Pending CN115563594A (en) 2022-10-11 2022-10-11 User identifier acquisition method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115563594A (en)

Similar Documents

Publication Publication Date Title
WO2015043420A1 (en) Permission control method and device
CN108763951B (en) Data protection method and device
CN110008758B (en) ID obtaining method and device, electronic equipment and storage medium
CN106155596B (en) Data writing method and device
CN110908865A (en) Memory leakage monitoring method and device and electronic equipment
CN108804938B (en) Authority detection method and device, electronic equipment and readable storage medium
CN110727941B (en) Privacy data protection method and device, terminal equipment and storage medium
CN110138767B (en) Transaction request processing method, device, equipment and storage medium
CN111931160B (en) Authority verification method, authority verification device, terminal and storage medium
CN115374481B (en) Data desensitization processing method and device, storage medium and electronic equipment
CN111460496A (en) Permission configuration method based on user role, electronic device and storage medium
CN108616361B (en) Method and device for identifying uniqueness of equipment
CN111310137B (en) Block chain associated data evidence storing method and device and electronic equipment
CN110535962B (en) Data synchronization method, device, equipment and storage medium based on authentication equipment
CN106796644B (en) Access control system and access control method
US10162488B1 (en) Browser-based media scan
CN108241732B (en) Electronic device, information processing method, and storage medium
CN115563594A (en) User identifier acquisition method and device, electronic equipment and storage medium
CN110674050A (en) Memory out-of-range detection method and device, electronic equipment and computer storage medium
CN105354506A (en) File hiding method and apparatus
CN117413267A (en) Firmware policy enforcement via secure processor
KR100899638B1 (en) Method for providing service using device identity information, system thereof and computer-readable medium recoded the program for executing the method
CN114338115A (en) Remote login method and device for unmanned equipment
CN113110806A (en) Data clearing detection method and device
WO2015081834A1 (en) Method and apparatus for distinguishing software types

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