ID generation method, device, related nodes and medium

By deploying an identity management contract on a blockchain node, centralized management and maintenance problems caused by the contract writer's custom generation of identity identifiers are solved, and the uniqueness of identity identification and development efficiency are improved.

CN110910143BActive Publication Date: 2025-02-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201911149679.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-21
Publication Date
2025-02-18
Estimated Expiration
2040-03-28

AI Technical Summary

Technical Problem

When writing smart contracts, contract writers need to customize the generation of identity identifiers, which will lead to the inability to implement centralized management and maintenance, which may lead to duplication of identity identifiers and low development efficiency.

Method used

By deploying an identity management contract on a blockchain node, receiving an identity generation request, selecting a target generator, and generating an identity identifier according to its generation mechanism, centralized management and maintenance of identity identifiers are achieved.

Benefits of technology

It ensures the uniqueness of the identity of different objects in the blockchain system and improves the development efficiency of R&D personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110910143B_ABST
    Figure CN110910143B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides an identity generation method, device, related nodes and readable storage medium, wherein the method comprises: obtaining an identity generation request, the identity generation request is used to request to configure a corresponding identity for a target object; in response to the identity generation request, selecting a target generator from the at least one identity generator; and generating a corresponding identity for the target object according to the identity generation mechanism adopted by the target generator. By implementing the present invention, centralized management and maintenance of identity can be achieved, ensuring the uniqueness of identity of different objects in the blockchain system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to an identity generation method, device, related nodes and readable storage medium. Background Art

[0002] Smart contracts are computer protocols designed to propagate, verify or execute contracts in an information-based manner, allowing trusted transactions without a third party. In specific implementation, the Ethereum platform executes the contract code customized by any contract writer through the Ethereum virtual machine to implement smart contracts.

[0003] At present, when writing smart contracts, contract writers need to add unsigned numeric type variables to the contract code to realize the function of generating identity documents (ID). However, the identity documents generated by contract writers cannot be centrally managed and maintained, which may lead to duplicate identity documents between different objects; and each time an identity document is needed, the identity document generation method must be customized, resulting in low development efficiency. Summary of the invention

[0004] The embodiment of the present invention discloses an identity generation method, device, related nodes and readable storage medium. By deploying an identity management contract in a blockchain node, centralized management and maintenance of the identity is achieved, thereby ensuring the uniqueness of the identity of different objects in the blockchain system.

[0005] In a first aspect, an embodiment of the present invention provides an identity generation method, an apparatus, related nodes and a readable storage medium, the identity generation method comprising: receiving an identity generation request, the identity generation request being used to request configuration of a corresponding identity for a target object; responding to the identity generation request, selecting a target generator from at least one identity generator; and generating a corresponding identity for the target object according to the identity generation mechanism adopted by the target generator.

[0006] In one implementation, the identity generation request carries security attributes of a target object, and selecting a target generator from at least one identity generator includes: selecting a target generator that matches the security attributes from at least one identity generator based on attribute information of the target object; wherein the security attributes of the target object are used to indicate the target object's requirements for information security.

[0007] In one implementation, at least one identity generator includes a digital generator and a string generator, and the information security requirement corresponding to the digital generator is lower than the information security requirement corresponding to the string generator; according to the attribute information of the target object, selecting a target generator matching the security attribute from at least one identity generator includes: if the security attribute of the target object is a first attribute, selecting a string generator as the target generator from at least one identity generator; if the security attribute of the target object is a second attribute, selecting a digital generator as the target generator from at least one identity generator; wherein the information security requirement corresponding to the first attribute is higher than the information security requirement corresponding to the second attribute.

[0008] In one implementation, the identity generation request carries an identity type, and in response to the identity generation request, selecting a target generator from at least one identity generator includes: selecting a target generator that matches the identity type from at least one identity generator according to the identity type; wherein the identity generators correspond one-to-one to the identity types.

[0009] In one implementation, generating a corresponding identity for a target object according to an identity generation mechanism adopted by a target generator includes: obtaining generation parameters required by the target generator; and generating a corresponding identity for the target object using the generation parameters according to the identity generation mechanism adopted by the target generator.

[0010] In one implementation, the generation parameters are carried in the identity generation request, and / or the generation parameters are recorded in the identity manager.

[0011] In one implementation, the generation parameters include at least one of the following: an identification name, an identification type, a prefix, a starting number, an increment, a random number, a length, an address, a number of transactions, a block height, and a transaction index.

[0012] In a second aspect, an embodiment of the present invention provides a blockchain node, the blockchain node comprising:

[0013] a memory including computer-readable instructions;

[0014] A processor connected to the memory, the processor is used to execute the computer-readable instructions, so that the computer device executes the method described in the first aspect or any possible implementation of the first aspect.

[0015] In a third aspect, an embodiment of the present invention provides an identity generation device, the identity generation device comprising:

[0016] Receiving unit: used to receive an identity generation request, where the identity generation request is used to request to configure a corresponding identity for a target object;

[0017] A response unit: used to respond to an identity generation request and select a target generator from at least one identity generator;

[0018] Generation unit: used to generate a corresponding identity for the target object according to the identity generation mechanism adopted by the target generator.

[0019] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and executing the method described in the first aspect or any possible implementation of the first aspect.

[0020] In the implementation of the present invention, the blockchain node is deployed with an identity management contract, the blockchain node obtains an identity generation request, the identity generation request is used to request the configuration of a corresponding identity for the target object; the blockchain node responds to the identity generation request and selects a target generator from at least one identity generator; the blockchain node generates a corresponding identity for the target object according to the identity generation mechanism adopted by the target generator. By implementing the present invention, centralized management and maintenance of identity can be achieved, the uniqueness of the identity of different objects in the blockchain system can be guaranteed, and centralized management and maintenance of identity generation can improve the development efficiency of R&D personnel. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0022] Figure 1 It is a structural diagram of a distributed blockchain system provided by an embodiment of the present invention;

[0023] Figure 2 This is an identity management contract architecture diagram provided by an embodiment of the present invention;

[0024] Figure 3 It is a flow chart of a method for generating an identity provided by an embodiment of the present invention;

[0025] Figure 4 This is a schematic diagram of the classification of an identity generator provided by an embodiment of the present invention;

[0026] Figure 5It is a schematic diagram of the structure of an identity identification generating device provided by an embodiment of the present invention;

[0027] Figure 6 This is a schematic diagram of a blockchain node structure provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. In addition, the following embodiments and features in the embodiments can be combined with each other without conflict.

[0029] The system involved in the embodiment of the present invention may be a distributed system formed by connecting a client and multiple nodes (computing devices of any form in an access network, such as a server and a user terminal) through network communication.

[0030] Take the distributed system as the blockchain system as an example, see Figure 1 , Figure 1 This is an optional structural diagram of the distributed system 100 provided by the embodiment of the present invention applied to the blockchain system, which is formed by multiple nodes 102 (any form of computing devices in the access network, such as servers, user terminals) and clients, and a peer-to-peer (P2P) network is formed between the nodes 102. The P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP) protocol. In the distributed system, any machine such as a server or a terminal can join and become a node 102.

[0031] See also Figure 1 The functions of each node in the blockchain system shown include:

[0032] 1) Routing: a basic function of a node, used to support communication between nodes.

[0033] In addition to the routing function, the node can also have the following functions:

[0034] 2) Applications are deployed in the blockchain to implement specific businesses based on actual business needs, record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system for other nodes to add the record data to a temporary block when they successfully verify the source and integrity of the record data.

[0035] For example, the services implemented by the application include wallets, shared ledgers, and smart contracts. Among them, smart contracts are computerized protocols that can execute the terms of a contract. They are implemented through codes deployed on shared ledgers for execution when certain conditions are met. According to actual business needs, the codes are used to complete automated transactions, such as querying the logistics status of the goods purchased by the buyer, and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods; of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.

[0036] 3) Blockchain, including a series of blocks that are connected to each other in the order of their generation. Once a new block is added to the blockchain, it will not be removed. The block records the record data submitted by the nodes in the blockchain system.

[0037] Based on the above blockchain system, the embodiment of the present invention proposes an identity generation scheme. The following takes the identity generation scheme as an example mainly applied in the blockchain system to explain in detail. Figure 2 , Figure 2 This is an architecture diagram of an identity management contract provided by an embodiment of the present invention. As shown in the figure, at least one identity generator 2001 (ID generator) and an identity manager 2002 (ID manager) are deployed in the identity management contract 200. The identity management contract can be deployed on a blockchain node in the form of a smart contract and run through an Ethereum virtual machine. The blockchain node is any node 102 in the blockchain system. Among them, the identity management contract 200 provides the function of generating an identity for the target object, which can realize the centralized management of the identities of all objects and ensure the uniqueness of the identity. Specifically, the identity generator 2001 is used to generate an identity for the target object; the identity manager 2002 is used to manage the identity generator (such as the registration, management and attribute maintenance of the identity generator) and authority control. Based on the identity management contract 200, an embodiment of the present invention proposes an identity generation scheme. At least one application 202 sends a request to register an identity generator, and the identity manager 2002 receives the identity generator request and records the generation parameters carried by the identity generator request and the identity of the application 202. Further, the application 202 sends an identity generation request, which is used to request to configure a corresponding identity for the target object in the application 202; the identity management contract 200 receives the identity generation request, responds to the identity generation request, selects a target generator from at least one identity generator; and generates a corresponding identity for the target object according to the identity generation mechanism adopted by the target generator.

[0038] The blockchain node of the present invention can specifically be a terminal device, which includes but is not limited to a mobile phone, a tablet computer (table personal computer), a personal digital assistant (PDA), a mobile internet device (mobile internet device, MID), a wearable device (wearable device), a vehicle-mounted device, and other devices that support network communication.

[0039] Optionally, the blockchain node and the node on which the application 202 is deployed may be the same node or different nodes.

[0040] See also Figure 3 , Figure 3 : is a flow chart of an identity identification generation method provided by an embodiment of the present invention. The identity identification generation method may specifically include steps S301 to S303:

[0041] Step S301: the identity management contract 200 receives an identity generation request, where the identity generation request is used to request configuration of a corresponding identity for a target object.

[0042] Specifically, the identity manager 2002 in the identity management contract 200 receives an identity generation request for generating an identity for the target object. The identity generation request is sent by the application 202 where the target object is located, and is used to request that the corresponding identity be configured for the target object. The target object can be any object that the target user participates in transactions in the blockchain system through the application 202, such as smart contracts, target users, transaction events, and any other objects that need to be identified with an identity; for example, the application can include but is not limited to Tencent Music, Tencent Games, etc., and the target object corresponding to Tencent Music can include but is not limited to the album name, singer name, etc.; the target object corresponding to Tencent Games can include but is not limited to the King of Glory skin name, prop name, etc.

[0043] Furthermore, the identity manager 2002 performs permission control on the identity generation request. The identity generation request carries the identity of the application 202, wherein the identity can be the specific name of the application 202, the address of the terminal device where the application 202 is deployed, etc. The identity manager 2002 implements permission control on the identity generation request sent by the application 202 by verifying the identity. Specifically, before the application 202 sends the identity generation request for the first time, it first sends a registration identity generator request, which carries the identity of the application 202. The identity manager 2002 receives the identity generator request and saves the identity of the application 202. In order to prevent the identity of the application 202 from being tampered with, the identity is signed and carried in the identity generation request. After receiving the identity generation request, the identity manager 2002 decrypts the signed identity to obtain the identity of the application 202, and compares it with the identity of the application 202 saved in the identity manager 2002. If the identification information of application 202 is correct, it means that application 202 has the authority to request identity identification.

[0044] Step S302: the identity management contract 200 responds to the identity generation request and selects a target generator from at least one identity generator.

[0045] The identity manager 2002 in the identity management contract 200 responds to the identity generation request and selects a target generator from at least one identity generator. The identity generator is deployed in the identity management contract, and its type and number are not limited, and may include but not limited to at least one of a digital generator and a string generator. The specific implementation method of selecting the target generator is not limited, and two possible implementation methods are described below.

[0046] In one embodiment, the identity generation request carries the security attribute of the target object. Therefore, the identity manager 2002 selects the target generator from at least one identity generator, and can select the target generator matching the security attribute from at least one identity generator according to the attribute information of the target object. The security attribute of the target object is used to indicate the target object's demand for information security. Specifically, the demand for information security corresponding to the digital generator is lower than the demand for information security corresponding to the string generator. If the security attribute of the target object is the first attribute, a string generator is selected from at least one identity generator as the target generator; if the security attribute of the target object is the second attribute, a digital generator is selected from at least one identity generator as the target generator; wherein the demand for information security corresponding to the first attribute is higher than the demand for information security corresponding to the second attribute. For example, if the target object is a user participating in a transaction, the identity is used to identify different users. In order to facilitate traversing the specific details of the users participating in the transaction, the demand for information security is low. Therefore, the security attribute of the user participating in the transaction is the second attribute, and the digital generator is selected as the target generator. For example, if the target object is a transaction, the identity identifier is used to identify transactions generated at different time points. In order to prevent the specific information of the transaction from being maliciously traversed, the demand for information security is high. Therefore, the security attribute of the transaction is the first attribute, and a string generator is selected as the target generator.

[0047] In another embodiment, the identity generation request carries the identity type, so the identity manager 2002 selects a target generator from at least one identity generator, and can select a target generator that matches the identity type from at least one identity generator according to the identity type; wherein the identity generator corresponds to the identity type one-to-one. For example, a digital generator is represented by S, and a string generator is represented by Z; then the identity generation request can carry the identity type S, and according to the identity type S, a digital generator that matches the identity type is selected from at least one identity generator.

[0048] Furthermore, the identity generator may adopt different identity generation mechanisms. The types of identity generation mechanisms are not limited, and the embodiment of the present invention exemplarily provides five different identity generation mechanisms. Therefore, the identity generator can be divided into five categories according to the different identity generation mechanisms. Figure 4 As shown, the digital generators are divided into two categories according to different identity generation mechanisms, and the string generators are divided into three categories according to different identity generation mechanisms. As shown in Table 1, Table 1 is a classification table of identity generation mechanisms provided by an embodiment of the present invention.

[0049] Table 1 Classification of identity generation mechanisms

[0050]

[0051] As shown in Table 1, T1 represents the identity generation mechanism adopted by the first type of digital generator, which uses a fixed-length number as the identity of the target object; T2 represents the identity generation mechanism adopted by the second type of digital generator, which uses a specified prefix and a fixed-length number as the identity of the target object; T3 represents the identity generation mechanism adopted by the first type of string generator, which uses the hash value obtained by hashing the address and the number of transactions as the identity of the target object; T4 represents the identity generation mechanism adopted by the second type of string generator, which uses the hash value obtained by hashing the address, the number of transactions and the random number as the identity of the target object; T5 represents the identity generation mechanism adopted by the third type of string generator, which uses the hash value obtained by hashing the address, the block height and the transaction index as the identity of the target object. Therefore, in the identity management contract, the above five types of identity generators are provided.

[0052] Optionally, each identity generation mechanism may correspond to a security attribute, that is, each identity generator may correspond to a security attribute. The first type of digital generator corresponds to security attribute 1; the second type of digital generator corresponds to security attribute 2; the first type of string generator corresponds to security attribute 3; the second type of string generator corresponds to security attribute 4; the third type of string generator corresponds to security attribute 5. The information security requirements indicated by security attributes 1-5 increase in sequence. Therefore, the target object can select a target generator that matches the security attribute from at least one identity generator according to the attribute information.

[0053] Optionally, the identity manager can manage the identity generator, such as deleting, freezing and enabling the identity generator. When the identity generator is frozen, an identity cannot be allocated to the target user who registers the application 202, so the target user cannot register the application 202.

[0054] Step S303: the identity management contract 200 generates a corresponding identity for the target object according to the identity generation mechanism adopted by the target generator.

[0055] The identity management contract deploys the five identity generators in step S202 above. The five identity generators can use different identity generation mechanisms, and each identity generator corresponds to an identity generation mechanism. The identity management contract 200 generates a corresponding identity for the target object according to the identity generation mechanism used by the target generator.

[0056] Specifically, the identity management contract 200 obtains the generation parameters required by the target generator, and uses the generation parameters to generate the corresponding identity for the target object according to the identity generation mechanism adopted by the target generator. Among them, the generation parameters are not limited, and include at least one of the following: identity name (Name), identity type (IDType), prefix (prefix), starting number (start), increment (increment), length (length), counter (counter), random number (salt), address (address), number of transactions (nonce), block height (Block height), transaction index (Transaction index). Among them:

[0057] The identity name indicates the name of the identity; for example, the identity of the external account of smart contract A can be named AE, and the identity of the contract account can be named AC.

[0058] The identity type indicates the type of identity generation mechanism; such as T1, T2, etc.

[0059] The prefix is ​​the prefix field included in the identity of the target object; it can be customized by the system.

[0060] The starting number indicates the starting number for the identity identifier generated by the digital generator for the target object; it can be customized by the system, such as the default value of 0.

[0061] The increment represents the increment of the fixed-length number generated by the digital generator; if the increment is 1, the identity of the next target object is 1 plus the identity of the current target object.

[0062] The length indicates the length of the fixed-length number generated by the digital generator; it can be customized, such as the default value of 10. If the field length is not enough, zeros can be automatically padded on the left or right.

[0063] The counter is used to record the number of identity tags generated by the digital generator; for example, each time an identity tag is generated for a target object of the same type, the counter is incremented by 1.

[0064] The salt represents a randomly generated number; it can be randomly generated by the identity management contract 200 or carried in the identity generation request.

[0065] The address represents the address of the target object; for example, after a smart contract is deployed, a contract address will be generated.

[0066] The number of transactions indicates the number of transactions that have occurred with the target object. If the external account of the smart contract includes a nonce field, the nonce field increases by 1 for each new transaction in the external account.

[0067] The height of the block indicates the height of the block where the target object is located, that is, the index of the block on the blockchain.

[0068] The transaction index indicates the index of the transaction when the target object is a transaction.

[0069] Each target generator requires different generation parameters, please refer to Table 2 (a)-Table 2 (b), Table 2 (a) is a generation parameter table of a digital generator provided by an embodiment of the present invention; Table 2 (b) is a generation parameter table of a string generator provided by an embodiment of the present invention. In the table, M is a required generation parameter field, O is an optional generation parameter field (the number in the bracket represents the default value), and blank means that the default value of the corresponding generation parameter field type can be filled in. Owner represents the target object that can request an identity, and the owner's authority control is implemented by the identity manager 101. For details, please refer to step S201; by default, all objects can apply for identity.

[0070] Table 2(a) Generation parameters of digital generator

[0071] Name IDType prefix counter length start increment owner T1 M M O(10) O(0) O(1) T2 M M M O(10) O(0) O(1)

[0072] Table 2(b) Generation parameters of string generator

[0073] Name IDType address nonce Block height salt Transaction index owner M M M M M M M M M M M M M M

[0074] As shown in Table 2, the mandatory generation parameter fields of the first type of digital generator include the identity name and the identity type, and the optional generation parameter fields are length, starting number and increment. The identity generator 2001 obtains the above generation parameters and generates a corresponding identity for the target object according to the identity generation mechanism T1 adopted by the first type of digital generator. For example, the length is 10, the starting number is 0, and the increment is 1. Since the length is 10, 0 can be added on the left. Therefore, the identity generated for the first target object can be 0000000000, and the identity generated for the next target object is 0000000001. The counter records the number of generated identity identifiers, and each new identity identifier is increased by 1. Therefore, the identity generated for the 200th target object can be 0000000200.

[0075] The mandatory generation parameter fields of the second type of digital generator include the identity name, identity type and prefix, and the optional generation parameter fields are length, starting number and increment. The identity generator 2001 obtains the above generation parameters and generates a corresponding identity for the target object according to the identity generation mechanism T2 adopted by the second type of digital generator. For example, the length is 10, the starting number is 0, the increment is 1, and the prefix is ​​B. Since the length is 10, 0 can be added on the left. Therefore, the identity generated for the first target object can be B000000000, and similarly, the identity generated for the 200th target object can be B000000200.

[0076] The mandatory generation parameter fields of the first type of string generator include the identity name, identity type, address, and number of transactions. The identity generator 2001 obtains the above generation parameters and generates a corresponding identity for the target object according to the identity generation mechanism T3 adopted by the first type of digital generator. Specifically, the identity generator 2001 uses the hash function SHA3 to perform a hash operation on the address and the number of transactions, and the obtained hash value is the identity of the target object. The hash function is not limited. In practical applications, it can also be any function in the SHA-0, SHA-1, SHA-2, SHA-3 series, etc.

[0077] The mandatory generation parameter fields of the second type of string generator include the identity name, identity type, address, number of transactions and random number. The identity generator 2001 obtains the above generation parameters and generates a corresponding identity for the target object according to the identity generation mechanism T4 adopted by the second type of digital generator. Specifically, the identity generator 2001 uses the hash function SHA3 to perform a hash operation on the address, number of transactions and random number, and the obtained hash value is the identity of the target object. The hash function is not limited. In practical applications, it can also be any function in the SHA-0, SHA-1, SHA-2, SHA-3 series, etc.

[0078] The mandatory generation parameter fields of the third type of string generator include the identity name, identity type, address, block height and transaction index. The identity generator 2001 obtains the above generation parameters and generates a corresponding identity for the target object according to the identity generation mechanism T5 adopted by the third type of digital generator. Specifically, the identity generator 2001 uses the hash function SHA3 to perform hash operations on the address, block height and transaction index, and the obtained hash value is the identity of the target object. The hash function is not limited. In practical applications, it can also be any function in the SHA-0, SHA-1, SHA-2, SHA-3 series, etc. For example, user A calls smart contract B to make a transaction, and the target object is the transaction of user A. To generate an identity for the target object, it is necessary to obtain the address of user A and record the height and transaction index of the target block of user A's transaction. If the address is 172.168.11.1, the height of the target block is 100, and the transaction index is xxx, the identity of the target object is the hash value f8cdb04495ded47615258f9dc6a3f4707fd2405434fefc3cbf4ef4e6.

[0079] Optionally, the method for obtaining the generation parameters is not limited, such as the generation parameters are carried in the identity generation request, and / or the generation parameters are recorded in the identity management contract. For example, the generation parameters required by the string type generator are different according to the target object, so the generation parameters can be carried in the identity generation request of the target object. For another example, for a digital type generator, since the generation parameters do not change greatly according to the target object, the generation parameters can be recorded in the identity management contract 200. Among them, the specific implementation method of recording the generation parameters in the identity management contract 200 is as follows. Application 202 sends a request to register an identity generator, and the request to register an identity generator carries generation parameters, including but not limited to an identity name, an identity type, etc.; the identity manager 2002 receives the identity generator request and records the generation parameters carried by the identity generator request. Therefore, the identity generator 2001 can directly obtain the generation parameters from the identity manager 2002. And the identity type corresponds to the identity generator one by one, so the application 202 can simultaneously request multiple identity generators 2001 to generate identities for the target object. For example, in Tencent Music, the first type of digital generator can generate an identity for the album name; the second type of digital generator can generate an identity for the singer's name.

[0080] Optionally, the identity manager 2002 records the number of times the identity generator is called. When the target generator generates an identity for a new target object in the application 202, the identity manager 2002 saves the mapping relationship between the identity name of the identity and the target generator. If there is a next target object of the same type as the target object, the target generator can be called according to the mapping relationship, and only objects under the same application 202 can call the target generator. In addition, each identity generator provides a method for generating an identity for the next target object; for example, the identity manager 2002 counter records the number of times the number generator is called, and the number generator can generate an identity for the next target object based on the increment and the counter. The following is an example of a method for generating an identity for the next target object in an actual application.

[0081] Next ID(ID id);

[0082] returns(ID newId); / / newId is the ID generated for the target object;

[0083] {switch id.IDType;

[0084] case T1; / / Select the generator corresponding to the T1 generation mechanism according to id type;

[0085] get next T1 id(id); / / Generate a specific ID for the target object according to the T1 generation mechanism

[0086] …

[0087] }

[0088] For example, the target object is the first registered user 1 of application H in the blockchain system. The identity generation request of registered user 1 carries a security attribute. According to the security attribute, the second type of digital generator is selected as the target generator. Assume that the identity generated by the target generator is H000000000, and the identity management contract assigns the identity name SH to the identity. Save the mapping relationship between the identity name SH and the target generator. If the second registered user 2 of application H needs to generate an identity, the identity name can be carried in the identity generation request, the target generator can be selected according to the identity name, and the target generator is called to generate an identity for registered user 2. According to the record of the counter being 1 and the increment being 1, the identity generated by registered user 2 is H000000001. Similarly, if the registered user of application F needs to generate an identity, the same target generator can be selected, but the identity representation name is different, such as the identity name SF for distinction.

[0089] In the implementation of the present invention, the blockchain node is deployed with an identity management contract, the blockchain node obtains an identity generation request, the identity generation request is used to request the configuration of a corresponding identity for the target object; the blockchain node responds to the identity generation request and selects a target generator from at least one identity generator; the blockchain node generates a corresponding identity for the target object according to the identity generation mechanism adopted by the target generator. By implementing the present invention, centralized management and maintenance of identity can be achieved, the uniqueness of the identity of different objects in the blockchain system can be guaranteed, and centralized management and maintenance of identity generation can improve the development efficiency of R&D personnel.

[0090] See also Figure 5 , Figure 5 is a schematic diagram of the structure of an identity generation device provided by an embodiment of the present invention. The identity generation device may be a terminal device deployed with an identity management contract, and is used to execute Figure 3 According to the method steps shown, the identity generation device 50 may include a receiving unit 501, a responding unit 502, and a generating unit 503. Among them:

[0091] Receiving unit 501: used to receive an identity generation request, where the identity generation request is used to request to configure a corresponding identity for a target object;

[0092] Responding unit 502: used to respond to the identity generation request and select a target generator from at least one identity generator;

[0093] Generating unit 503: used to generate a corresponding identity for the target object according to the identity generation mechanism adopted by the target generator.

[0094] In one implementation, the response unit 502 is used to carry the security attribute of the target object in the identity generation request, and when selecting the target generator from at least one identity generator, specifically to:

[0095] According to the attribute information of the target object, a target generator matching the security attribute is selected from at least one identity generator; wherein the security attribute of the target object is used to indicate the target object's requirement for information security.

[0096] In one implementation, at least one identity generator includes a digital generator and a string generator, and the information security requirement corresponding to the digital generator is lower than the information security requirement corresponding to the string generator; the response unit 502 is used to select a target generator matching the security attribute from the at least one identity generator according to the attribute information of the target object, specifically for:

[0097] If the security attribute of the target object is the first attribute, selecting a string generator from at least one identity generator as a target generator;

[0098] If the security attribute of the target object is the second attribute, selecting a digital generator from at least one identity generator as a target generator;

[0099] The information security requirement corresponding to the first attribute is higher than the information security requirement corresponding to the second attribute.

[0100] In one implementation, the identity generation request carries the identity type, and the response unit 502 is used to respond to the identity generation request, and when selecting a target generator from at least one identity generator, is specifically used to:

[0101] According to the identity identification type, a target generator matching the identity identification type is selected from at least one identity identification generator; wherein the identity identification generators correspond to the identity identification types one by one.

[0102] In one implementation, the generating unit 503 is used to generate a corresponding identity for the target object according to the identity generation mechanism adopted by the target generator, specifically to:

[0103] Get the generation parameters required by the target generator;

[0104] According to the identity generation mechanism adopted by the target generator, the generation parameters are used to generate the corresponding identity for the target object.

[0105] In one implementation, the generation parameters are carried in the identity generation request, and / or the generation parameters are recorded in the identity manager.

[0106] In one implementation, the generation parameters include at least one of the following: an identification name, an identification type, a prefix, a starting number, an increment, a random number, a length, an address, a number of transactions, a block height, and a transaction index.

[0107] According to another embodiment of the present invention, Figure 5The various units in the illustrated identity generation device may be separately or completely combined into one or several other units, or one (or more) of the units may be further divided into multiple functionally smaller units, which may achieve the same operation without affecting the realization of the technical effects of the embodiments of the present invention. The above-mentioned units are divided based on logical functions. In practical applications, the functions of one unit may also be implemented by multiple units, or the functions of multiple units may be implemented by one unit. In other embodiments of the present invention, the device based on the identity generation method may also include other units. In practical applications, these functions may also be implemented with the assistance of other units, and may be implemented by the collaboration of multiple units.

[0108] In the implementation of the present invention, the blockchain node is deployed with an identity management contract, the blockchain node obtains an identity generation request, the identity generation request is used to request the configuration of a corresponding identity for the target object; the blockchain node responds to the identity generation request and selects a target generator from at least one identity generator; the blockchain node generates a corresponding identity for the target object according to the identity generation mechanism adopted by the target generator. By implementing the present invention, centralized management and maintenance of identity can be achieved, the uniqueness of the identity of different objects in the blockchain system can be guaranteed, and centralized management and maintenance of identity generation can improve the development efficiency of R&D personnel.

[0109] Based on the description of the above method embodiment and device embodiment, the present invention also provides a schematic diagram of the structure of a blockchain node. Figure 6 , the blockchain node 60 at least includes a processor 601, an input device 602, an output device 603, and a computer storage medium 604. The processor 601, the input device 602, the output device 603, and the computer storage medium 604 in the blockchain node can be connected via a bus or other means.

[0110] The computer storage medium 604 may be stored in the memory of the blockchain node, the computer storage medium 604 is used to store a computer program, the computer program includes program instructions, and the processor 601 is used to execute the program instructions stored in the computer storage medium 604. The processor 601 (or CPU (Central Processing Unit)) is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function.

[0111] The embodiment of the present invention also provides a computer storage medium (Memory), which is a memory terminal device in the first node for storing programs and data. It is understandable that the computer storage medium here can include both the built-in storage medium in the blockchain node and the extended storage medium supported by the blockchain node. The computer storage medium provides a storage space, which stores the operating system of the blockchain node. In addition, one or more instructions suitable for being loaded and executed by the processor 601 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory, such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.

[0112] In one embodiment, the processor 601 may load and execute one or more instructions stored in a computer storage medium to implement the corresponding steps of the method in the above-mentioned embodiment of the method for generating an identity identifier; in a specific implementation, the processor 601 loads one or more instructions in the computer storage medium and executes the following steps:

[0113] Receive an identity generation request, where the identity generation request is used to request configuration of a corresponding identity for a target object;

[0114] In response to the identity generation request, selecting a target generator from at least one identity generator;

[0115] Generate a corresponding identity for the target object according to the identity generation mechanism adopted by the target generator.

[0116] In one implementation, the identity generation request carries the security attributes of the target object. When a target generator is selected from at least one identity generator, one or more instructions in the computer storage medium are loaded by the processor 601 and the following steps are executed:

[0117] According to the attribute information of the target object, a target generator matching the security attribute is selected from at least one identity generator; wherein the security attribute of the target object is used to indicate the target object's requirement for information security.

[0118] In one implementation, at least one identity generator includes a digital generator and a string generator, and the information security requirement corresponding to the digital generator is lower than the information security requirement corresponding to the string generator; when selecting a target generator matching the security attribute from at least one identity generator according to the attribute information of the target object, one or more instructions in the computer storage medium are loaded by the processor 601 and the following steps are executed:

[0119] If the security attribute of the target object is the first attribute, selecting a string generator from at least one identity generator as a target generator;

[0120] If the security attribute of the target object is the second attribute, selecting a digital generator from at least one identity generator as a target generator;

[0121] The information security requirement corresponding to the first attribute is higher than the information security requirement corresponding to the second attribute.

[0122] In one implementation, the identity generation request carries the identity type. When selecting a target generator from at least one identity generator in response to the identity generation request, one or more instructions in the computer storage medium are loaded by the processor 601 and the following steps are executed:

[0123] According to the identity identification type, a target generator matching the identity identification type is selected from at least one identity identification generator; wherein the identity identification generators correspond to the identity identification types one by one.

[0124] In one implementation, when generating a corresponding identity for a target object according to the identity generation mechanism adopted by the target generator, one or more instructions in the computer storage medium are loaded by the processor 601 and the following steps are executed:

[0125] Get the generation parameters required by the target generator;

[0126] According to the identity generation mechanism adopted by the target generator, the generation parameters are used to generate the corresponding identity for the target object.

[0127] In one implementation, the generation parameters are carried in the identity generation request, and / or the generation parameters are recorded in the identity manager.

[0128] In one implementation, the generation parameters include at least one of the following: an identification name, an identification type, a prefix, a starting number, an increment, a random number, a length, an address, a number of transactions, a block height, and a transaction index.

[0129] In the implementation of the present invention, the blockchain node is deployed with an identity management contract, the blockchain node obtains an identity generation request, the identity generation request is used to request the configuration of a corresponding identity for the target object; the blockchain node responds to the identity generation request and selects a target generator from at least one identity generator; the blockchain node generates a corresponding identity for the target object according to the identity generation mechanism adopted by the target generator. By implementing the present invention, centralized management and maintenance of identity can be achieved, the uniqueness of the identity of different objects in the blockchain system can be guaranteed, and centralized management and maintenance of identity generation can improve the development efficiency of R&D personnel.

[0130] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.

Claims

1. A method for generating an identity, characterized in that: Applied to a blockchain node deployed with an identity management contract, wherein the identity management contract is deployed with at least one identity generator and an identity manager, and the identity manager is used to manage the identity generator and authority control, the method includes: The identity manager receives a registration identity generator request carrying an application identifier, and saves the application identifier; The identity manager receives an identity generation request, the identity generation request carries the security attributes of the target object and the signed application identifier, and is used to request configuration of a corresponding identity for the target object, where the target object is an object for the target user to participate in transactions in the blockchain system through various applications; performs permission control on the identity generation request, decrypts the signed application identifier to obtain the application identifier, and compares it with the saved application identifier to determine whether the target object has permission to request an identity identifier; The identity manager responds to the identity generation request and selects a target generator matching the security attribute from the at least one identity generator according to the attribute information of the target object; wherein the security attribute of the target object is used to indicate the target object's requirement for information security; According to the identity generation mechanism adopted by the target generator, a corresponding identity is generated for the target object.

2. The method according to claim 1, characterized in that The at least one identity generator includes a digital generator and a string generator, and the information security requirement corresponding to the digital generator is lower than the information security requirement corresponding to the string generator; The selecting, according to the attribute information of the target object, a target generator matching the security attribute from the at least one identity generator comprises: If the security attribute of the target object is the first attribute, selecting the string generator from the at least one identity generator as the target generator; If the security attribute of the target object is the second attribute, selecting the digital generator from the at least one identity generator as the target generator; The information security requirement corresponding to the indication of the first attribute is higher than the information security requirement corresponding to the indication of the second attribute.

3. The method according to claim 1, characterized in that The identity identifier generation request carries an identity identifier type, and the responding to the identity identifier generation request and selecting a target generator from the at least one identity identifier generator includes: According to the identity identification type, a target generator matching the identity identification type is selected from the at least one identity identification generator; wherein the identity identification generators correspond to the identity identification types one by one.

4. The method according to claim 1, characterized in that Generating a corresponding identity for the target object according to the identity generation mechanism adopted by the target generator includes: Obtaining generation parameters required by the target generator; According to the identity generation mechanism adopted by the target generator, the generation parameters are used to generate a corresponding identity for the target object.

5. The method according to claim 4, characterized in that The generation parameters are carried in the identity generation request, and / or the generation parameters are recorded in the identity management contract.

6. The method according to claim 4, characterized in that The generation parameters include at least one of the following: an identification name, an identification type, a prefix, a starting number, an increment, a random number, a length, an address, a number of transactions, a block height, and a transaction index.

7. An identity generation device, characterized in that: Applied to a blockchain node deployed with an identity management contract, wherein the identity management contract is deployed with at least one identity generator and an identity manager, wherein the identity manager is used to manage the identity generator and authority control, the device comprises: A receiving unit is used to receive a registration identity generator request carrying an application identifier, and save the application identifier; receive an identity generation request, the identity generation request carries the security attributes of a target object and a signed application identifier, and is used to request that a corresponding identity be configured for the target object, wherein the target object is an object for a target user to participate in transactions in a blockchain system through various applications; perform authority control on the identity generation request, decrypt the signed application identifier to obtain the application identifier, and compare it with the saved application identifier to determine that the target object has authority to request an identity identifier; A response unit, in response to the identity generation request, selects a target generator matching the security attribute from the at least one identity generator according to the attribute information of the target object; wherein the security attribute of the target object is used to indicate the target object's requirement for information security; The generating unit generates a corresponding identity for the target object according to the identity generating mechanism adopted by the target generator.

8. A blockchain node, characterized in that: The blockchain node includes: a memory including computer-readable instructions; A processor connected to the memory, the processor being used to execute the computer-readable instructions, so that the device executes the identity identification generation method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the identity identification generation method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for generating identify label, router data, device and server

    CN108989205A

  • Identity management method and device, communication network and storage medium

    CN110311883A