ID generation method and device, storage medium and electronic device

By generating strictly monotonous identity identification generation functions for third-party applications and generating OpenID for users, the problems of waste space, complex operations and rangeless length during OpenID generation in the prior art are solved, and an efficient and concise OpenID generation process is achieved.

CN113392369BActive Publication Date: 2025-05-16BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110571190.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-25
Publication Date
2025-05-16
Estimated Expiration
2041-05-25

AI Technical Summary

Technical Problem

In the prior art, when generating user OpenIDs, there are problems such as wasting space, complex computing, and the generated OpenID length has no range, which occupies network IO.

Method used

By obtaining the application information of a third-party application, a strict monotonic identity generation function corresponding to the application is generated, and the corresponding OpenID is generated for the user using this function. This function has a unique inverse function, which avoids the need to save the mapping relationship between user identity information and OpenID, simplifies operations and shortens the length of OpenID.

Benefits of technology

It realizes saving system storage space, simplifying computing and shortening OpenID length, thereby improving efficiency and saving computer resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113392369B_ABST
    Figure CN113392369B_ABST
Patent Text Reader

Abstract

The present disclosure provides an identity generation method and device, an electronic device, and a computer-readable storage medium, which relate to the field of computer technology. The identity generation method comprises: obtaining application information of a third-party application, and generating an identity generation function corresponding to the third-party application based on the application information, wherein the identity generation function is a strictly monotonic function, and the identity generation function corresponds one-to-one with the third-party application; obtaining the identity information of the user, and generating a corresponding identity for the user based on the identity information and the identity generation function. The present disclosure utilizes a strictly monotonic function to generate the identity of the user, thereby achieving the effects of saving system storage space and eliminating the need for a large number of calculations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to an identity identification generation method, an identity identification generation device, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the continuous development of computer and network communication technology, various application software have emerged, which greatly enriched and facilitated people's daily life and work. In many cases, users of internal systems often need to access external third-party applications. In this access process, a unique identity is a necessary guarantee for system security. For example, openId is the unique identifier of internal users of the system that all open platforms feed back to external ISVs (independent software developers) after authorization based on oauth2.0.

[0003] In the related technology, the corresponding user o is mainly generated for the third-party application through the hash algorithm (hash algorithm) or the symmetric encryption and decryption algorithm. p However, the above method has problems such as wasting space, complex calculation, no range for the length of the generated openId, and occupying network IO (input and output).

[0004] Therefore, in order to solve the above problems, it is necessary to provide an identity identification generation method to save system storage space, simplify calculations and shorten the length of the generated user openId.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] The purpose of the embodiments of the present disclosure is to provide an identity generation method, an identity generation device, an electronic device and a computer-readable storage medium, thereby solving the problems existing in the related technologies such as space waste, complex calculations, no range for the length of the generated identity, and occupation of network IO (input and output) to a certain extent.

[0007] According to a first aspect of the present disclosure, there is provided a method for generating an identity, comprising:

[0008] Acquire application information of a third-party application, and generate an identity generation function corresponding to the third-party application according to the application information, wherein the identity generation function is a strictly monotonic function, and the identity generation function corresponds to the third-party application in a one-to-one manner;

[0009] The user's identity information is obtained, and a corresponding identity identifier is generated for the user according to the identity information and the identity identifier generation function.

[0010] In an exemplary embodiment of the present disclosure, the method further includes:

[0011] Calculating the inverse function of the identity generation function;

[0012] The user identity identifier is obtained, and the identity information of the user is obtained according to the user identity identifier and the inverse function.

[0013] In an exemplary embodiment of the present disclosure, the identity identifier is an OpenID, and the identity identifier generation function is an OpenID generation function;

[0014] The obtaining of application information of a third-party application and generating an identity generation function corresponding to the third-party application according to the application information includes:

[0015] Acquire application information of a third-party application, and generate an OpenID generation function corresponding to the third-party application according to the application information;

[0016] The obtaining of the identity information of the user and generating a corresponding identity identifier for the user according to the identity information and the identity identifier generation function includes:

[0017] The user's identity information is obtained, and a corresponding OpenID is generated for the user according to the identity information and the OpenID generation function.

[0018] In an exemplary embodiment of the present disclosure, the method further includes:

[0019] Calculating an inverse function of the OpenID generation function;

[0020] The OpenID corresponding to the user is obtained, and the identity information of the user is obtained according to the OpenID and the inverse function.

[0021] In an exemplary embodiment of the present disclosure, after generating a corresponding OpenID for the user according to the identity information and the OpenID generation function, the method further includes:

[0022] Encode the OpenID corresponding to the user; and

[0023] After obtaining the OpenID corresponding to the user, the method further includes:

[0024] Obtain the encoded user OpenID and decode it.

[0025] In an exemplary embodiment of the present disclosure, the obtaining application information of a third-party application and generating an OpenID generation function corresponding to the third-party application according to the application information includes:

[0026] Acquire application identification information of the third-party application from the application information;

[0027] A non-zero slope a is randomly generated for the third-party application, and the application identification information is used as an offset b to generate the OpenID generation function: y=ax+b.

[0028] In an exemplary embodiment of the present disclosure, the generating a corresponding OpenID for the user according to the identity information and the OpenID generation function includes:

[0029] Obtaining an independent variable x of the OpenID generation function based on the identity information of the user;

[0030] Input the independent variable x into the OpenID generation function y =ax+b, and we get the dependent variable y The dependent variable y is encoded to obtain the OpenID corresponding to the user.

[0031] In an exemplary embodiment of the present disclosure, the method further includes:

[0032] The calculating the inverse function of the OpenID generation function includes:

[0033] Calculate the OpenID generation function y = inverse function of ax+b y =(xb) / a;

[0034] The obtaining the identity information of the user according to the user OpenID and the inverse function includes:

[0035] Obtain the OpenID corresponding to the user and decode it, and input the decoded OpenID corresponding to the user into the inverse function y =(xb) / a, and obtain the identity information of the user.

[0036] According to a second aspect of the present disclosure, there is provided an identity generating device, comprising:

[0037] A generation function determination module, used to obtain application information of a third-party application, and generate an identity generation function corresponding to the third-party application according to the application information, wherein the identity generation function is a strictly monotonic function, and the identity generation function corresponds to the third-party application one-to-one;

[0038] The identity generation module is used to obtain the identity information of the user and generate a corresponding identity for the user according to the identity information and the identity generation function.

[0039] In an exemplary embodiment of the present disclosure, the device further includes:

[0040] An inverse function calculation module, used to calculate the inverse function of the identity generation function;

[0041] The user identity determination module is used to obtain the user identity identifier and obtain the user's identity information according to the user identity identifier and the inverse function.

[0042] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned methods by executing the executable instructions.

[0043] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, any one of the methods described above is implemented.

[0044] The exemplary embodiments of the present disclosure may have some or all of the following beneficial effects:

[0045] In the identity generation method provided in the example implementation of the present disclosure, the application information of the third-party application is obtained, and an identity generation function corresponding to the third-party application is generated based on the obtained application information, wherein the identity generation function is a strictly monotonic function, and the identity generation function corresponds to the third-party application one by one; the identity information of the user is obtained, and a corresponding identity is generated for the user based on the user's identity information and the identity generation function. On the one hand, the identity generation method provided in the example implementation generates a corresponding user identity for the third-party application through the user's identity information and the strictly monotonic function as the identity generation function. Since the strictly monotonic function has a unique inverse function, the user identity generated by the strictly monotonic function and the user identity information can be inferred from each other through the function. Therefore, there is no need to save the mapping relationship between the user identity information and the user identity, and the length of the generated user identity is shorter, saving the storage space of the system. On the other hand, compared with the hash algorithm or the encryption and decryption algorithm, the calculation is simple, the efficiency is improved, and the computer resources are saved.

[0046] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0048] Figure 1 A schematic diagram showing an exemplary system architecture of a user behavior prediction method and device to which the embodiments of the present disclosure can be applied;

[0049] Figure 2 A schematic diagram showing the structure of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure is shown;

[0050] Figure 3 The following is a schematic diagram showing a flow chart of a method for generating an identity according to an embodiment of the present disclosure;

[0051] Figure 4 The following schematically shows a flow chart of generating a strictly monotonic function (OpenID generation function) in a method for generating an identity according to an embodiment of the present disclosure;

[0052] Figure 5 The following schematically shows a flow chart of generating an OpenID in a method for generating an identity according to an embodiment of the present disclosure;

[0053] Figure 6 The following schematically shows a flow chart of determining user identity information in a method for generating an identity marker according to an embodiment of the present disclosure;

[0054] Figure 7 A block diagram of an identity generating device according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0055] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0056] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0057] Figure 1 A schematic diagram of a system architecture of an exemplary application environment in which an identity identification generation method and device according to an embodiment of the present disclosure can be applied is shown.

[0058] like Figure 1 As shown, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The terminal devices 101, 102, 103 may be electronic devices with functional computing capabilities, including but not limited to desktop computers, portable computers, smart phones, tablet computers, etc. It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.

[0059] The identity identification generation method provided in the embodiment of the present disclosure can be executed by the terminal devices 101, 102, and 103, and accordingly, the identity identification generation device can also be set in the terminal devices 101, 102, and 103. The identity identification generation method provided in the embodiment of the present disclosure can also be performed by the terminal devices 101, 102, and 103 and the server 105, and accordingly, the identity identification generation device can be set in the terminal devices 101, 102, and 103 and the server 105. In addition, the identity identification generation method provided in the embodiment of the present disclosure can also be performed by the server 105, and accordingly, the identity identification generation device can be set in the server 105, which is not particularly limited in this exemplary embodiment.

[0060] For example, in this example implementation, the above-mentioned identity identification generation method can be jointly executed by the server 105. First, the server 105 obtains the application information of the third-party application, and generates an identity identification generation function corresponding to the third-party application according to the application information, wherein the identity identification generation function is a strictly monotonic function, and the identity identification generation function corresponds to the third-party application one by one; then, the user's identity information is obtained, and a corresponding identity identification is generated for the user according to the obtained user's identity information and the identity identification generation function.

[0061] Figure 2 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure is shown.

[0062] It should be noted that Figure 2 The computer system 200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0063] like Figure 2 As shown, the computer system 200 includes a central processing unit (CPU) 201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 202 or a program loaded from a storage part 208 into a random access memory (RAM) 203. Various programs and data required for system operation are also stored in the RAM 203. The CPU 201, the ROM 202, and the RAM 203 are connected to each other via a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.

[0064] The following components are connected to the I / O interface 205: an input section 206 including a keyboard, a mouse, etc.; an output section 207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 208 including a hard disk, etc.; and a communication section 209 including a network interface card such as a LAN card, a modem, etc. The communication section 209 performs communication processing via a network such as the Internet. A drive 210 is also connected to the I / O interface 205 as needed. A removable medium 211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 210 as needed, so that a computer program read therefrom is installed into the storage section 208 as needed.

[0065] With the continuous development of computer and network communication technology, various application software have emerged, which greatly enriches and facilitates people's daily life and work. In many cases, users of internal systems often need to access external third-party applications. In this access process, a unique identity is a necessary guarantee for system security.

[0066] OpenId is the unique identifier of internal users of the system that all open platforms feed back to external ISVs (independent software developers) after authorization based on oauth2.0 (Internet standard protocol). For each ISV application, OpenId corresponds to the user ID within the system, and each ISV generates different openIds for different IDs within the same system. When ISV passes in user information, it can identify a user through openId. After entering the system, the system converts openId into the system internal ID for real calls. This technology protects user privacy and system security.

[0067] In related technologies, openId is mainly generated by the following two methods:

[0068] The first method is to generate openId based on the hash algorithm. The specific implementation is as follows: First, splice appKe y (used to identify ISV applications) and user ID; then, the concatenated appKey y The combination with the user ID is hashed based on the hash function; finally, the openId is generated through Base64 encoding, and the openId and appKey are saved in the system database. y The corresponding ID information is used to convert openId to ID.

[0069] However, although the above hash algorithm-based method can generate openId, it has the following problems: (1) Due to the irreversibility of the hash algorithm, this method needs to save the mapping from openId to ID in the system database to meet the needs of converting openId to ID, which leads to a waste of system space; (2) The hash algorithm has different IDs and appKe y If the generated openId is the same, data duplication may occur; (3) the algorithm is complex and wastes computer resources; (4) the length of the generated openId has no range and occupies network IO (input and output).

[0070] The second method is to generate openId based on the symmetric encryption and decryption algorithm. The specific implementation is as follows: y Generate a secret key and use it to encrypt the user ID to generate openId. y The generated key is used to decrypt openId to obtain the corresponding user ID information.

[0071] However, the above-mentioned symmetric encryption and decryption algorithm still has the following problems: (1) the algorithm operation is complex, which wastes computer resources; (2) the length of the generated openId has no range, which occupies network IO.

[0072] In order to solve the problems existing in the above method, this example implementation proposes a technical solution, which can solve the problems of system space waste, data duplication, complex calculation and network IO occupation existing in the related technology to a certain extent. The technical solution of the embodiment of the present disclosure is described in detail below:

[0073] This example implementation first provides a method for generating an identity. Figure 3 As shown, the identity generation method specifically includes the following steps:

[0074] Step S310: obtaining application information of a third-party application, and generating an identity generation function corresponding to the third-party application according to the application information, wherein the identity generation function is a strictly monotonic function, and the identity generation function corresponds to the third-party application one-to-one;

[0075] Step S320: Obtain the user's identity information, and generate a corresponding identity for the user based on the identity information and an identity generation function.

[0076] In the identity generation method provided in the example implementation of the present disclosure, on the one hand, the identity generation method provided in the example implementation generates a corresponding user identity for a third-party application through the user's identity information and a strictly monotonic function as an identity generation function. Since the strictly monotonic function has a unique inverse function, the user identity generated by the strictly monotonic function and the user identity information can be derived from each other through the function. Therefore, there is no need to save the mapping relationship between the user identity information and the user identity, and the length of the generated user identity is shorter, saving the storage space of the system. On the other hand, compared with the hash algorithm or the encryption and decryption algorithm, the calculation is simple, the efficiency is improved, and the computer resources are saved.

[0077] Next, in another embodiment, the above steps are described in more detail.

[0078] In step S310, application information of the third-party application is obtained, and an identity generation function corresponding to the third-party application is generated according to the application information, wherein the identity generation function is a strictly monotonic function, and the identity generation function corresponds to the third-party application one-to-one.

[0079] In this example implementation, the third-party application is an external application relative to the system, and the application is an external application developed by an independent software developer (a company or individual that develops applications based on an open platform). For example, a user can log in to a shopping applet developed by an external developer in a social application software, and the shopping applet is a third-party application. It should be noted that the above scenario is only an exemplary description, and the protection scope of this example implementation is not limited to this. For example, the social application software can also be other types of software or systems, and the shopping applet can also be other forms of external applications, and this example implementation does not specifically limit this.

[0080] In this example implementation, when logging into the external third-party application within the system, a unique identifier needs to be generated for the user within the system for the third-party application to identify the user. For example, the unique identifier can be an OpenID generated by an OpenID generation function.

[0081] The identity generation method provided in this example embodiment generates the corresponding OpenID generation function generated by each third-party application as a strictly monotonic function. Based on the basic property that a strictly monotonic function has a unique inverse function, by generating a one-to-one corresponding OpenID generation function for each third-party application, it is possible to prevent the generated OpenID from being the same, resulting in data duplication.

[0082] In the above process, the above OpenID generation function can be generated based on the application information of the third-party application, wherein the application information of the third-party application can include the identification information of the third-party application. For example, when creating a third-party application, the application identification information of the third-party application can be generated to identify the third-party application. Then the above process of generating the OpenID generation function based on the application information of the third-party application can include: obtaining the application information of the third-party application, extracting the application identification information of the third-party application from the application information, and generating a strictly monotonic function as the above OpenID generation function according to the application identification information.

[0083] In the following, in a specific embodiment, the above process is described in detail. Figure 4 As shown, the following process may be included:

[0084] In step S410, a third-party application is created and application information is generated.

[0085] In this step, a third-party application is created and application information related to the third-party application is generated, wherein the application information includes application identification information for identifying the third-party application. For example, the application information of the created third-party application may be as shown in Table 1:

[0086] Table 1:

[0087] ID appkey ... 1 key1 ... 2 key2 ... 3 key3 ...

[0088] The first column in Table 1 above is the application ID, and the application ID of each third-party application is an integer and is globally unique. The second column is the appkey, which corresponds to each third-party application one by one.

[0089] In step S420, a globally unique strictly monotonic function is generated for each third-party application as an OpenID generation function.

[0090] In this step, a globally unique strictly monotonic function is generated for each third-party application. Taking the third-party applications in Table 1 as an example, the process of generating a strictly monotonic function can be implemented as follows: obtaining the application identification information of the third-party application from the application information; randomly generating a non-zero slope a for each third-party application, and using the application identification information as the offset b, to generate a strictly monotonic function: y =ax+b.

[0091] Specifically, the non-zero slope may be 1 or -1, the offset b may be the application ID in Table 1, and the strictly monotonic function generated for each third-party application may be as shown in Table 2:

[0092] Table 2:

[0093] ID appkey ... Strictly monotonic function 1 key1 ... y=x+1 2 key2 ... y=-x+2 3 key3 ... y=x-3

[0094] It should be noted that the above scenario is only an exemplary description, and the protection scope of this exemplary implementation is not limited thereto. For example, the above OpenID generation function is other strictly monotonic functions that meet the definition.

[0095] In step S320, the user's identity information is obtained, and a corresponding identity is generated for the user according to the identity information and the identity generation function.

[0096] In this example implementation, after obtaining the above OpenID generation function, it is also necessary to generate a corresponding user OpenID for the user based on the user identity information and the above OpenID generation function. Specifically, the process can be implemented as follows: based on the user identity information, the input value of the OpenID generation function is obtained, and the output value of the function is used as the user OpenID. The above user identity information can be any information that can be used to identify the user identity, such as a user ID, etc., and this example implementation does not specifically limit this.

[0097] Furthermore, optionally, in this example implementation, after a corresponding user OpenID is generated for a user according to the user's identity information and the OpenID generation function, the obtained OpenID may also be encoded.

[0098] Next, take the above OpenID generation function as y = ax + b as an example, the above process of generating OpenID is described in detail, as follows: Figure 5 As shown, the following steps may be included:

[0099] In step S510, the user's identity information is obtained.

[0100] In this step, the user's identity information is obtained. Because each time an openId is generated, a user within the system authorizes a specific third-party application, the user information and the third-party application information can be clearly determined. The user information can be shown in Table 3 below:

[0101] Table 3:

[0102] ID userName ... 1 name1 ... 2 name2 ... 3 name3 ...

[0103] The first column in Table 3 is the user ID, which is used to indicate the identity information of the user. The second column is the user name of each user.

[0104] In step S520, the user identity information is input into the OpenID generation function.

[0105] In this step, the independent variable x of the OpenID generation function is obtained based on the user's identity information; the independent variable x is input into the OpenID generation function y =ax+b, get the function output value, which is the dependent variable y , recorded as tmp_openId. Specifically, the user ID in Table 3 above can be used as x and input into the OpenID generation function above y =ax+b, and obtain the above-mentioned tmp_openId.

[0106] In step S530, the output value of the above function is encoded to obtain the final OpenID.

[0107] In this step, the tmp_openId obtained in step S520 is encoded to obtain the final OpenID. Specifically, the encoding method may be: taking the absolute value of tmp_openId, and when tmp_openId is less than 0, adding 1 to the absolute value of tmp_openId, otherwise adding 0. For example, if the function output value is -2345, the obtained OpenID is 12345, and if the function output value is 2345, the obtained OpenID is 02345.

[0108] It should be noted that the above scenario is only an exemplary description, and the protection scope of this example implementation is not limited thereto. For example, the above encoding process can be omitted, or other encoding methods can be used.

[0109] In this example implementation, since a strictly monotonic function has a unique inverse function, it is not necessary to store the mapping relationship between the OpenID and the user identity information. After obtaining the OpenID, the user identity information can be obtained by: calculating the inverse function of the above OpenID generation function; obtaining the user OpenID, and obtaining the user identity information according to the user OpenID and the inverse function.

[0110] In addition, when the obtained OpenID is an encoded OpenID, before obtaining the user's identity information according to the user OpenID and the inverse function, it is necessary to perform a corresponding decoding operation on the obtained encoded OpenID.

[0111] Next, take the above OpenID generation function as y = ax + b as an example, the process of obtaining the user identity information is described in detail, as follows: Figure 6 As shown, the following steps may be included:

[0112] In step S610, a user OpenID generated for a third-party application is obtained.

[0113] In this step, the user OpenID generated for the third-party application is obtained. Because each time the user's identity information in the system is obtained from the openId, it is a request from a specific third-party application, so the relevant information of the openId and the third-party application can be clearly determined, and the information may include the OpenID generation function generated for the third-party application.

[0114] In step S620, a corresponding decoding operation is performed on the encoded OpenID.

[0115] In this step, if the obtained OpenID is an encoded OpenID, the encoded OpenID is decoded accordingly. Taking the encoding process in the above step S530 as an example, the corresponding decoding process can be implemented as follows: the content starting from the second digit of the openId is converted into an integer, namely tmp_openId; if the first digit of the openId is 1, the obtained tmp_openId is inversely calculated, and if it is 0, no operation is performed.

[0116] In step S630, the OpenID generation function of the third-party application is obtained, and the inverse function is calculated.

[0117] In this step, calculate the O of the third-party application p The inverse function of the enID generation function. Specifically, the above OpenID generation function is calculated y = inverse function of ax+b: y =(xb) / a.

[0118] In step S640, the decoded OpenID is input into the above inverse function, and the user identity information is determined.

[0119] In this step, the decoded user OpenID is input into the above inverse function y=(xb) / a to obtain the user ID of the user, and the user identity information is obtained according to the user ID.

[0120] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0121] Furthermore, in this exemplary embodiment, an identity generating device is also provided, referring to Figure 7As shown, the identity identification generation device 700 may include a generation function determination module 710 and an identity identification generation module 720. Among them:

[0122] The generation function determination module 710 may be used to obtain application information of a third-party application, and generate an identity generation function corresponding to the third-party application according to the application information, wherein the identity generation function is a strictly monotonic function, and the identity generation function corresponds to the third-party application one by one;

[0123] The OpenID generation module 720 may be used to obtain the identity information of the user, and generate a corresponding identity for the user according to the identity information and an identity generation function.

[0124] In an exemplary embodiment of the present disclosure, the above-mentioned device identity generation device also includes an inverse function calculation module and a user identity determination module, wherein: the inverse function calculation module can be used to calculate the inverse function of the identity generation function; the user identity determination module can be used to obtain the identity corresponding to the user, and obtain the user's identity information based on the identity corresponding to the user and the inverse function.

[0125] In an exemplary embodiment of the present disclosure, the inverse function calculation module may calculate the inverse function by executing the following method: calculating the inverse function of the identity generating function; obtaining the user identity, and obtaining the user's identity information according to the user identity and the inverse function.

[0126] In an exemplary embodiment of the present disclosure, the identity identifier is an OpenID, and the identity identifier generation function is an OpenID generation function;

[0127] The above-mentioned obtaining the application information of the third-party application and generating an identity generation function corresponding to the third-party application according to the application information includes:

[0128] Obtain application information of the third-party application, and generate an OpenID generation function corresponding to the third-party application based on the application information;

[0129] The above-mentioned obtaining of the user's identity information and generating a corresponding identity for the user according to the identity information and the identity generation function include:

[0130] Obtain the user's identity information, and generate a corresponding OpenID for the user based on the identity information and the OpenID generation function.

[0131] The inverse function calculation module can calculate the inverse function by executing the following method: calculating the inverse function of the OpenID generation function; obtaining the OpenID corresponding to the user, and obtaining the user's identity information according to the OpenID and the inverse function.

[0132] In an exemplary embodiment of the present disclosure, after generating a corresponding OpenID for a user based on identity information and an OpenID generation function, the above-mentioned identity generation device may further encode the OpenID corresponding to the user; and after obtaining the OpenID corresponding to the user, the above-mentioned identity generation device may further obtain the encoded user OpenID and decode it.

[0133] In an exemplary embodiment of the present disclosure, the generation function determination module can obtain application information of the third-party application and generate an OpenID generation function corresponding to the third-party application according to the application information by executing the following method, including: obtaining application identification information of the third-party application from the application information; randomly generating a non-zero slope a for the third-party application, and using the application identification information as an offset b to generate an OpenID generation function: y =ax+b.

[0134] In an exemplary embodiment of the present disclosure, the identity identification generation module can generate a corresponding OpenID for a user according to the identity information and the OpenID generation function by executing the following method, including: obtaining an independent variable x of the OpenID generation function based on the identity information of the user; inputting the independent variable x into the OpenID generation function; y =ax+b, and we get the dependent variable y And the dependent variable y Encode and get the OpenID corresponding to the user.

[0135] In an exemplary embodiment of the present disclosure, the inverse function calculation module calculates the inverse function of the OpenID generation function by executing the following method: calculating the OpenID generation function y = inverse function of ax+b y =(xb) / a; The user identity determination module can obtain the user's identity information according to the user's OpenID and the inverse function by executing the following method, including: obtaining the OpenID corresponding to the user and decoding it, inputting the decoded OpenID corresponding to the user into the inverse function y =(xb) / a, and obtain the user's identity information.

[0136] The specific details of each module or unit in the above-mentioned identity identification generation device have been described in detail in the corresponding identity identification generation method, so they will not be repeated here.

[0137] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0138] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiment.

[0139] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0140] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for generating an identity, characterized in that: include: Acquire application information of a third-party application, and generate an identity generation function corresponding to the third-party application based on the application information, wherein the identity generation function is a strictly monotonic function, and the identity generation function corresponds to the third-party application one-to-one; the application information includes application identification information for identifying the third-party application; the acquiring application information of the third-party application and generating an identity generation function corresponding to the third-party application based on the application information comprises: acquiring the application identification information of the third-party application from the application information; randomly generating a non-zero slope a for the third-party application, and using the application identification information as an offset b, to generate the identity generation function: y=ax+b, wherein x is the identity information of the user; The user's identity information is obtained, and a corresponding identity identifier is generated for the user according to the identity information and the identity identifier generation function.

2. The identity identification generation method according to claim 1, characterized in that: The method further comprises: Calculating the inverse function of the identity generation function; A user identity identifier is obtained, and the identity information of the user is obtained according to the user identity identifier and the inverse function.

3. The identity identification generation method according to claim 1, characterized in that: The identity identifier is OpenID, and the identity identifier generation function is an OpenID generation function; The obtaining of application information of a third-party application and generating an identity generation function corresponding to the third-party application according to the application information includes: Acquire application information of a third-party application, and generate an OpenID generation function corresponding to the third-party application according to the application information; The obtaining of the identity information of the user and generating a corresponding identity identifier for the user according to the identity information and the identity identifier generation function includes: The user's identity information is obtained, and a corresponding OpenID is generated for the user according to the identity information and the OpenID generation function.

4. The identity identification generation method according to claim 3, characterized in that: The method further comprises: Calculating an inverse function of the OpenID generation function; The OpenID corresponding to the user is obtained, and the identity information of the user is obtained according to the OpenID and the inverse function.

5. The identity identification generation method according to claim 3, characterized in that: After generating a corresponding OpenID for the user according to the identity information and the OpenID generation function, the method further includes: Encode the OpenID corresponding to the user; and After obtaining the OpenID corresponding to the user, the method further includes: Obtain the encoded OpenID corresponding to the user and decode it.

6. The method for generating an identity mark according to claim 3, characterized in that: Generating a corresponding OpenID for the user according to the identity information and the OpenID generation function includes: Obtaining an independent variable x of the OpenID generation function based on the identity information of the user; The independent variable x is input into the OpenID generation function y=ax+b to obtain the dependent variable y and encode the dependent variable y to obtain the OpenID corresponding to the user.

7. The method for generating an identity mark according to claim 6, characterized in that: The method further comprises: Calculating an inverse function of the OpenID generation function includes: Calculate the inverse function y=(xb) / a of the OpenID generation function y=ax+b; Obtaining the identity information of the user according to the OpenID corresponding to the user and the inverse function, including: The OpenID corresponding to the user is obtained and decoded, and the decoded OpenID corresponding to the user is input into the inverse function y=(xb) / a to obtain the identity information of the user.

8. An identity generation device, characterized in that: include: A generation function determination module is used to obtain application information of a third-party application, and generate an identity generation function corresponding to the third-party application based on the application information, wherein the identity generation function is a strictly monotonic function, and the identity generation function corresponds to the third-party application one-to-one; the application information includes application identification information for identifying the third-party application; the generation function determination module is configured to: obtain the application identification information of the third-party application from the application information; randomly generate a non-zero slope a for the third-party application, and use the application identification information as an offset b to generate the identity generation function: y=ax+b, wherein x is the user's identity information; The identity generation module is used to obtain the identity information of the user and generate a corresponding identity for the user according to the identity information and the identity generation function.

9. The identity identification generating device according to claim 8, characterized in that: The device also includes: An inverse function calculation module, used to calculate the inverse function of the identity generation function; The user identity determination module is used to obtain a user identity identifier and obtain the user's identity information according to the user identity identifier and the inverse function.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

11. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.

Citation Information

Patent Citations

  • User authorization method and system and device thereof

    CN101562621A

  • Abnormal behavior analysis method, electronic device and computer program product

    CN109325691A