Method, system, device, and readable storage medium for generating and verifying identification

By generating and verifying the device's unique identifier, using universal unique identifiers and snowflake unique identifiers, combined with ECDH and HMAC algorithms, the problem that the device's unique identifier is easily leaked or forged is solved, and safe, stable and cross-platform compatible device identifier management is achieved. , which improves the user experience.

CN118250691BActive Publication Date: 2024-09-17BEIJING SOHU NEW MOMENTUM INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410666334.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2024-09-17
Estimated Expiration
2044-05-27

AI Technical Summary

Technical Problem

Existing device unique identifiers can easily be leaked or forged, causing security and privacy threats. They are also unstable and unreliable, affecting application functions and performance, and lack cross-platform compatibility.

Method used

Generate device identification by obtaining device information and preset time, use universal unique identifier, hash value and snowflake unique identification to splice to generate device identification, and verify it on the server side, use ECDH and HMAC algorithms to generate signatures to ensure the security of the identification and uniqueness.

Benefits of technology

It achieves the security and stability of the device's unique identification, prevents leakage and forgery, improves the uniqueness and persistence of the identification, supports multi-platform use, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118250691B
    Figure CN118250691B
Patent Text Reader

Abstract

The present disclosure provides an identification generation verification method, system, device, and readable storage medium. The identification generation verification method includes: obtaining device information and preset time to generate a device identification; sending the device identification to a server to verify whether it exists in the database of the server; if the device identification does not exist in the database of the server, generating a client signature and a server signature respectively; judging whether the client signature and the server signature are the same, if they are the same, the verification passes. The present disclosure can realize the generation of a unique device identification that is both secure and stable, and effectively encrypt and sign it to ensure its security and privacy, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of terminal security, and in particular to an identification generation and verification method, system, device, and readable storage medium. Background Art

[0002] A device unique identifier is an identifier used to distinguish different devices. It is widely used in the field of mobile Internet, such as user behavior analysis, advertising push, security verification, etc. Common device unique identifiers include IMEI, Serial, MAC address, IDFA, etc.

[0003] However, device unique identifiers such as IMEI and Serial are fixed and can be easily obtained or copied, so that malicious third parties can use device unique identifiers to track, defraud or attack, which will cause the device unique identifier to be leaked or forged, thereby threatening the user's security and privacy. Device unique identifiers such as MAC addresses and IDFA are variable and can be modified or reset at will, so that normal third parties cannot accurately identify or verify the identity or status of the device, which will cause errors, failures or conflicts in the application, which will cause the device unique identifier to be unstable or unreliable, thereby affecting the function and performance of the application. Device unique identifiers such as IDFA are platform or system related and can only be used or accessed in specific environments, so that different platforms or systems cannot communicate or interconnect, thereby reducing the coverage of the application and user experience. This will cause the device unique identifier to be incompatible across platforms or systems, thereby limiting the development and expansion of applications.

[0004] The above technical problems existing in the prior art have greatly affected the user experience. Summary of the invention

[0005] The present disclosure is completed to solve the above-mentioned problems, and its purpose is to provide an identification generation and verification method, system, device, and readable storage medium that can generate a unique device identification that is both secure and stable, and effectively encrypt and sign it to ensure its security and privacy.

[0006] The present disclosure provides this summary of the invention to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. This summary of the invention is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to be used to limit the scope of the technical solution claimed for protection.

[0007] In order to solve the above technical problems, the present disclosure provides an identification generation verification method, which adopts the following technical solution, including:

[0008] Obtain device information and preset time to generate device identification;

[0009] Sending the device identification to a server to verify whether it exists in a database of the server;

[0010] If the device identification does not exist in the database of the server, generating a client signature and a server signature respectively;

[0011] Determine whether the client signature and the server signature are the same, if they are the same, the verification passes;

[0012] The device identifier is obtained by concatenating a universal unique identifier, a hash value and a snowflake unique identifier, and the hash value is generated by the device information and the preset time.

[0013] In order to solve the above technical problems, the embodiment of the present disclosure further provides an identification generation and verification system, which is used to implement the above method, and adopts the following technical solutions, including:

[0014] The client is used to obtain device information and preset time to generate a device identification; send the device identification to the server to verify whether it exists in the database of the server;

[0015] The server is used to determine if the device identifier does not exist in the database of the server, then generate a client signature and a server signature respectively; and determine whether the client signature and the server signature are the same, if they are the same, the verification passes;

[0016] The device identifier is obtained by concatenating a universal unique identifier, a hash value and a snowflake unique identifier, and the hash value is generated by the device information and the preset time.

[0017] In order to solve the above technical problems, the embodiments of the present disclosure further provide a computer device, which adopts the technical solution described below, including: a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in any of the preceding items is implemented.

[0018] In order to solve the above technical problems, the embodiment of the present disclosure also provides a computer-readable storage medium, which adopts the technical solution described below, including: a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the method described in any of the previous items.

[0019] According to the technical solution disclosed in the present disclosure, compared with the prior art, it is possible to achieve (1) by generating a secure and stable device unique identifier, and effectively encrypting and signing it to ensure its security and privacy, and prevent the device unique identifier from being leaked or forged; (2) the stability and reliability of the device unique identifier can be improved. By using two generation algorithms, the snowflake algorithm and the universal unique identifier, the uniqueness and persistence of the device unique identifier are guaranteed, and the change or loss of the device unique identifier is avoided; (3) the compatibility and scalability of the device unique identifier can be improved, supporting multiple platforms and systems, and being suitable for various mobile smart terminals and mobile Internet applications. The device unique identifier can also be persistently stored on various platforms, avoiding the loss of the device unique identifier after uninstalling or reinstalling the application, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a schematic diagram of an embodiment of a system architecture according to the present disclosure;

[0021] Figure 2 is a flow chart of an embodiment of a method for generating and verifying an identifier according to the present disclosure;

[0022] Figure 3 is a schematic diagram of an embodiment of a system for generating and verifying an identifier according to the present disclosure;

[0023] Figure 4 is a schematic diagram of one embodiment of a computer device according to the present disclosure.

[0024] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale. DETAILED DESCRIPTION

[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present disclosure belongs; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure; the terms "including" and "having" and any variations thereof in the specification and claims of the present disclosure and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present disclosure or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0026] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present disclosure. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0027] In order to enable those skilled in the art to better understand the solution of the present disclosure, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0028] [System Structure]

[0029] First, the structure of a system according to an embodiment of the present disclosure is described. Figure 1 As shown, the system structure 100 may include terminal devices 101, 102, 103, 104, a network 105 and a server 106. The network 105 is used to provide a medium for communication links between the terminal devices 101, 102, 103, 104 and the server 106.

[0030] In this embodiment, the electronic device (e.g. Figure 1 The terminal devices 101, 102, 103 or 104 shown in the figure can transmit various information through the network 105. The network 105 can include various connection types, such as wired, wireless communication links or optical fiber cables, etc. It should be noted that the above-mentioned wireless connection methods may include but are not limited to 3G / 4G / 5G connections, Wi-Fi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB connections, local area networks ("LAN"), wide area networks ("WAN"), Internet (e.g., the Internet) and peer-to-peer networks (e.g., ad hoc peer-to-peer networks) and other network connection methods currently known or developed in the future. The network 105 can communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and can be interconnected with digital data communications (e.g., communication networks) of any form or medium.

[0031] The user can use the terminal devices 101, 102, 103, 104 to interact with the server 106 through the network 105 to receive or send messages, etc. Various client applications can be installed on the terminal devices 101, 102, 103 or 104, such as video live broadcast and playback applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0032] The terminal devices 101, 102, 103 or 104 can be various electronic devices with a touch display and / or support for web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 (Moving Picture Experts Compressed Standard Audio Layer 3) players, MP4 (Moving Picture Experts Compressed Standard Audio Layer 4) players, head-mounted display devices, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., as well as mobile terminals such as digital TVs, desktop computers, etc.

[0033] The server 106 may be a server that provides various services, such as a background server that provides support for pages displayed on the terminal device 101 , 102 , 103 or 104 or data transmitted.

[0034] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0035] Here, the terminal device can independently or in cooperation with other electronic terminal devices run various operating systems such as applications in the Android system to implement the embodiment method of the present disclosure, and can also run applications in other operating systems to implement the embodiment method of the present disclosure.

[0036] [Logo generation verification method]

[0037] refer to Figure 2 , shows a flow chart of an embodiment of a method for generating and verifying an identifier according to the present disclosure. The method for generating and verifying an identifier includes:

[0038] S21, obtaining device information and preset time to generate a device identification;

[0039] Here, the client collects as much device information as possible, including IMEI, Serial, MAC address, IDFA, IP address, etc., to increase the complexity and randomness of the device's unique identification. Since a lot of device information involves user permission settings, as much device information as possible should be collected within the legal authorization authority. The preset time is, for example, to obtain the current time as the first installation time, etc. After assembling the collected device information and the first installation time into a string, an md5 hash operation is performed to obtain a hash value (devicePart), which has the characteristics of irreversibility and anti-collision, and can be used as an important part of the device's unique identification. And generate a universal unique identifier string (UUID) consisting of 32 hexadecimal digits, which has the characteristics of global uniqueness and randomness, and can be used as an important part of the device's unique identification.

[0040] Here, the first installation time is sent to the server. The server uses the machine code serial number and service code to generate a snowflake unique identifier (Snowflake = first installation time + machine code + service code) through the snowflake algorithm. It has global uniqueness and time sequence. The snowflake unique identifier is efficient, distributed, orderly and traceable, and can be used as an important component of the device's unique identifier.

[0041] Here, the device identifier is, for example, a final device identifier (finalDeviceId), which is obtained by concatenating the universal unique identifier UUID, the hash value devicePart and the snowflake unique identifier Snowflake, for example, by concatenating them with “-” to obtain the final device identifier finalDeviceId (finalDeviceId=UUID-devicePart-Snowflake).

[0042] In one or more embodiments, the identification generation and verification method disclosed in the present invention also includes, for example, the server predetermines the elliptic curve name (curveName) before going online, generates an ECDH server public key (serverPublicKey) and a server private key (serverPrivateKey) pair through the elliptic curve Diffie-Hellman (ECDH) algorithm, and a hash operation message authentication code Hmac algorithm name (hmacName).

[0043] When the client application starts, it obtains the elliptic curve name, server public key, hash operation message authentication code algorithm name, device identification and other related information from the local. If the relevant information does not exist locally, the device identification generation and device identification verification steps are performed. If the relevant information exists locally, the relevant information is obtained and the device identification verification step is performed.

[0044] S22, sending the device identification to the server to verify whether it exists in the server's database to check for duplicate device identification. After the client generates the device identification for the first time, it will send the device identification to the server to verify whether the device identification exists in the database.

[0045] In one or more embodiments, for example, if the device identifier does not exist in the database, the ECDH server public key serverPublicKey, the elliptic curve name curveName, and the Hmac algorithm name hmacName are returned to the client to prepare for the client to generate a signature.

[0046] In one or more embodiments, for example, if the device identification already exists in the database, the device information and the preset time are re-acquired to generate the device identification.

[0047] S23, if the device identification does not exist in the server database, a client signature and a server signature are generated respectively.

[0048] In one or more embodiments, generating a client signature includes, for example:

[0049] The client generates an ECDH client public key clientPublicKey and client private key clientPrivateKey pair;

[0050] The client generates the first shared key sharedKey through the ECDH client private key clientPrivateKey, the ECDH server public key serverPublicKey and the elliptic curve name curveName:

[0051] (sharedKey=ECDH

[0052] (clientPrivateKey+serverPublicKey+curveName)).

[0053] Here, the first shared key sharedKey is, for example, a shared key generated by the client and the server through the elliptic curve Diffie-Hellman (ECDH) algorithm, which can only be known by both parties and cannot be stolen or cracked by a third party. The shared key is calculated by the public key and private key pair of both parties (clientPublicKey, clientPrivateKey, serverPublicKey, serverPrivateKey) and a predetermined elliptic curve name (curveName).

[0054] The client performs a hash operation message authentication code Hmac algorithm on the device identifier finalDeviceId through the hash operation message authentication code algorithm name hmacName and the first shared key sharedKey to generate the client signature clientSign.

[0055] hmac=Hmac(hmacName+sharedKey)

[0056] clientSign=hmac(finalDeviceId).

[0057] In one or more embodiments, generating a server signature includes, for example:

[0058] The client sends the client signature clientSign, the client public key clientPublicKey, and the device identifier finalDeviceId to the server;

[0059] The server generates the second shared key sharedKey through the ECDH server private key serverPrivateKey, the ECDH client public key clientPublicKey, and the elliptic curve name curveName:

[0060] (sharedKey=ECDH

[0061] (serverPrivateKey+clientPublicKey+curveName))

[0062] The server uses the hash operation message authentication code algorithm name HmacName and the second shared key sharedKey to perform a hash operation message authentication code Hmac algorithm on the device identifier finalDeviceId to generate the server signature serverSign:

[0063] hmac = Hmac(hmacName + sharedKey)

[0064] serverSign = hmac(finalDeviceId).

[0065] Here, the client signature clientSign and the server signature serverSign are, for example, signatures signed by the client and the server using the Hmac algorithm to sign the unique device identifier finalDeviceId, which can only be generated and verified by the shared key sharedKey and cannot be forged or tampered with by a third party. The signature is obtained by performing an Hmac operation on the unique device identifier finalDeviceId using the shared key sharedKey and the predetermined Hmac algorithm name hmacName.

[0066] S24, determine whether the client signature clientSign and the server signature serverSign are the same, if they are the same, the verification passes.

[0067] In one or more embodiments, for example, it is determined whether the client signature clientSign and the server signature serverSign are the same to verify the legitimacy of the device identification. If the client signature clientSign and the server signature serverSign are the same, the verification is passed, that is, the device identification finalDeviceId is legal, including: storing the device identification finalDeviceId in the database and returning a success response, and the client stores the relevant information such as the ECDH server public key serverPublicKey, the elliptic curve name curveName, the Hmac algorithm name hmacName, the device identification finalDeviceId and other information persistently locally for subsequent use. Here, the persistent storage method is adapted according to different platforms and systems, such as the iOS platform uses Keychain, the Android platform uses AndroidKeystore System, the Windows platform uses Windows Credential Manager, and the Linux platform uses SecretService API.

[0068] In one or more embodiments, for example, it also includes: if the client signature clientSign and the server signature serverSign are not the same, the verification fails, that is, the device identification is illegal, which means that the device identification finalDeviceId has been tampered with and is no longer safe, then the client is notified to regenerate the device identification; and check whether the device identification exists in the database. If the device identification exists, it is deleted, and the device information and preset time are re-acquired to generate the device identification finalDeviceId.

[0069] In one or more embodiments, for example, it also includes providing a secure mechanism to update the identification through remote authentication and encrypted communication when a major change occurs to the device (such as hardware replacement), such as using a certificate or a pre-shared key to remotely authenticate and verify its identity. During and after the authentication process, all communications use encryption to protect the security and integrity of the data from man-in-the-middle attacks and eavesdropping. Once the device passes the remote authentication, it can securely receive a new unique identifier or update the existing identifier, ensuring that the new unique identifier matches the new hardware features of the device and that the old identifier is securely discarded. For example, all identifier updates are recorded in a security log to facilitate future audits and problem tracking. In one or more embodiments, for example, for devices that are no longer in use, ensure that their unique identifiers are securely discarded.

[0070] Through this disclosure, the secure generation and protection of the unique identifier of the device can be achieved, thereby improving the security and reliability of the system. This method can ensure requirements such as global uniqueness, increasing trend or monotonically increasing, and information security, and can prevent attackers from stealing or tampering with the unique identifier of the device. In addition, the method also uses security algorithms such as ECDH algorithm, HMAC and snowflake algorithm to protect the security of the unique identifier of the device. Specifically:

[0071] 1. The present invention can generate a secure and stable device unique identifier, which is composed of multiple different types of unique identifiers and hash values, has high complexity and randomness, and is not easily leaked or forged.

[0072] 2. The present disclosure can effectively encrypt and sign the unique identifier of a device, using two encryption algorithms, ECDH and Hmac, to ensure the security and privacy of the unique identifier of the device and prevent the unique identifier of the device from being tampered with or stolen.

[0073] 3. The present disclosure can improve the stability and reliability of the device unique identifier, and uses two generation algorithms, the snowflake algorithm and the UUID, to ensure the uniqueness and persistence of the device unique identifier and avoid the change or loss of the device unique identifier.

[0074] 4. The present disclosure can improve the compatibility and scalability of the device unique identification, support multiple platforms and systems, and be applicable to various mobile smart terminals and mobile Internet applications.

[0075] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0076] [Logo generation and verification system]

[0077] In order to implement the technical solution in the embodiment of the present disclosure, an embodiment of the present disclosure provides a system for generating and verifying an identifier, such as Figure 3 As shown, it includes, for example, a client 301 and a server 302. Of course, the identification generation and verification system may also include other functional operation modules.

[0078] The client 301 is used to obtain device information and preset time to generate a device identification; and send the device identification to the server to verify whether it exists in the database of the server.

[0079] The device identification is obtained by concatenating the universal unique identifier, the hash value and the snowflake unique identifier, and the hash value is generated by the device information and the preset time. Here, the client 301 can, for example, implement the corresponding functions or technical solutions in steps S21-S24 or other steps in the above method, which will not be repeated here.

[0080] The server 302 is used to determine if the device identification does not exist in the server's database, then generate a client signature and a server signature respectively; and determine whether the client signature and the server signature are the same, if they are the same, the verification is passed.

[0081] Here, the server 302 may, for example, implement steps S21 to S24 in the above method or corresponding functions or technical solutions in other steps, which will not be described in detail here.

[0082] It should be understood that, although each box in the block diagram of the accompanying drawings may represent a module, a part of which contains one or more executable instructions for implementing a specified logical function, these modules are not necessarily executed in sequence. The modules and functional units in the device embodiments disclosed herein may be integrated into a processing module, or each unit may exist physically separately, or two or more modules or functional units may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0083] [Computer equipment]

[0084] Reference below Figure 4 , which shows a schematic diagram of the structure of a computer device suitable for implementing the embodiment of the present disclosure. The computer device in the embodiment of the present disclosure is only an example and should not bring any limitation to the function and scope of use of the embodiment of the present disclosure.

[0085] like Figure 4 As shown, the electronic device 400 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 401 for controlling the overall operation of the electronic device. The processing device may include one or more processors to execute instructions to complete all or part of the steps of the above method. In addition, the processing device 401 may also include one or more modules for processing and interacting with other devices.

[0086] The storage device 402 is used to store various types of data. The storage device 402 may include various types of computer-readable storage media or combinations thereof, such as electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination thereof. 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 thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in conjunction with an instruction execution system, device, or component.

[0087] The sensor device 403 is used to sense the specified measured information and convert it into a usable output signal according to a certain rule, and may include one or more sensors. For example, it may include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor, etc., for detecting changes in the opening / closing state, relative positioning, acceleration / deceleration, temperature, humidity and light of the electronic device.

[0088] The processing device 401 , the storage device 402 , and the sensor device 403 are connected to each other via a bus 404 . An input / output (I / O) interface 405 is also connected to the bus 404 .

[0089] The multimedia device 406 may include input devices such as a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, etc. for receiving input signals from a user. The various input devices may cooperate with the various sensors of the above-mentioned sensor device 403 to complete, for example, gesture operation input, image recognition input, distance detection input, etc. The multimedia device 406 may also include output devices such as a liquid crystal display (LCD), a speaker, a vibrator, etc.

[0090] The power supply device 407 is used to provide power to various devices in the electronic device, and may include a power management system, one or more power supplies, and components for distributing power to other devices.

[0091] The communication device 408 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data.

[0092] The above-mentioned devices can also be connected to the I / O interface 405 to implement the application of the electronic device 400.

[0093] Although the electronic device with various devices is shown in the figure, it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0094] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0095] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.

[0096] It should be noted that the above-mentioned computer-readable medium of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. In the present disclosure, the computer-readable signal medium may include a data signal propagated in the baseband or as part of a carrier wave, which carries a computer-readable program code. 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. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in combination with an instruction execution system, device or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0097] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0098] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0099] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0100] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0101] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0102] According to one or more embodiments of the present disclosure, a method for verifying the generation of an identifier is provided, which adopts the following technical solution, including:

[0103] Obtain device information and preset time to generate device identification;

[0104] Sending the device identification to a server to verify whether it exists in a database of the server;

[0105] If the device identification does not exist in the database of the server, generating a client signature and a server signature respectively;

[0106] Determine whether the client signature and the server signature are the same, if they are the same, the verification passes;

[0107] The device identifier is obtained by concatenating a universal unique identifier, a hash value and a snowflake unique identifier, and the hash value is generated by the device information and the preset time.

[0108] According to one or more embodiments of the present disclosure, a method for verifying the generation of an identifier is provided, which adopts the following technical solution, including:

[0109] The server predetermines the name of the elliptic curve, generates a server public key and a server private key pair, and a hash operation message authentication code algorithm name;

[0110] When the client application is started, the elliptic curve name, the server public key, the hash operation message authentication code algorithm name and the device identifier are obtained locally.

[0111] According to one or more embodiments of the present disclosure, a method for verifying the generation of an identifier is provided, which adopts the following technical solution, including:

[0112] The sending of the device identification to the server to verify whether the device identification exists in a database of the server further includes:

[0113] If it does not exist, the server public key, the elliptic curve name and the hash operation message authentication code algorithm name are returned;

[0114] If it already exists, the device information and preset time are retrieved to generate the device identification.

[0115] According to one or more embodiments of the present disclosure, a method for verifying the generation of an identifier is provided, which adopts the following technical solution, including:

[0116] If the device identification does not exist in the database of the server, respectively generating a client signature and a server signature includes:

[0117] Generate a client public key and client private key pair;

[0118] Generate a first shared key using the client private key, the server public key and the elliptic curve name;

[0119] The client signature is generated by performing a hash operation message authentication code algorithm on the device identification using the hash operation message authentication code algorithm name and the first shared key.

[0120] According to one or more embodiments of the present disclosure, a method for verifying the generation of an identifier is provided, which adopts the following technical solution, including:

[0121] If the device identification does not exist in the database of the server, respectively generating a client signature and a server signature includes:

[0122] Sending the client signature, the client public key, and the device identification to a server;

[0123] Generate a second shared key using the server private key, the client public key, and the elliptic curve name;

[0124] The server signature is generated by performing a hash operation message authentication code algorithm on the device identification using the hash operation message authentication code algorithm name and the second shared key.

[0125] According to one or more embodiments of the present disclosure, a method for verifying the generation of an identifier is provided, which adopts the following technical solution:

[0126] The determining whether the client signature and the server signature are identical and if they are identical, the verification is passed, comprises: storing the device identification in the database and returning a success response.

[0127] According to one or more embodiments of the present disclosure, a method for verifying the generation of an identifier is provided, which adopts the following technical solution:

[0128] The determining whether the client signature and the server signature are identical, and if they are identical, the verification passes, further includes:

[0129] If they are not the same, the verification fails;

[0130] Check whether the device identification exists in the database, delete it if it exists, and re-acquire the device information and preset time to generate the device identification.

[0131] According to one or more embodiments of the present disclosure, a system for generating and verifying an identifier is provided, which is used to implement any of the above methods, and adopts the following technical solution, including:

[0132] The client is used to obtain device information and preset time to generate a device identification; send the device identification to the server to verify whether it exists in the database of the server;

[0133] The server is used to determine if the device identifier does not exist in the database of the server, then generate a client signature and a server signature respectively; and determine whether the client signature and the server signature are the same, if they are the same, the verification passes;

[0134] The device identifier is obtained by concatenating a universal unique identifier, a hash value and a snowflake unique identifier, and the hash value is generated by the device information and the preset time.

[0135] According to one or more embodiments of the present disclosure, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in any of the preceding items is implemented.

[0136] According to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in any of the preceding items is implemented.

[0137] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0138] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0139] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A method for verifying the generation of an identifier, characterized in that: include: Obtain device information and preset time to generate device identification; Sending the device identification to a server to verify whether it exists in a database of the server; If the device identification does not exist in the database of the server, generating a client signature and a server signature respectively; Determine whether the client signature and the server signature are the same, if they are the same, the verification passes; The device identifier is obtained by concatenating a universal unique identifier, a hash value and a snowflake unique identifier, the hash value is generated by the device information and the preset time, and the snowflake unique identifier is generated by the server through the first installation time, the machine code serial number and the service code. The server predetermines the name of the elliptic curve, generates a server public key and a server private key pair, and a hash operation message authentication code algorithm name; When the client application starts, the name of the elliptic curve, the server public key, the hash operation message authentication code algorithm name and the device identifier are obtained from the local persistent storage. The persistent storage method is adapted according to different platforms and systems. If the device identification does not exist in the database of the server, respectively generating a client signature and a server signature includes: Generate a client public key and client private key pair; Generate a first shared key using the client private key, the server public key and the elliptic curve name; The client signature is generated by performing a hash operation message authentication code algorithm on the device identifier using the hash operation message authentication code algorithm name and the first shared key, If the device identification does not exist in the database of the server, respectively generating a client signature and a server signature includes: Sending the client signature, the client public key, and the device identification to a server; Generate a second shared key using the server private key, the client public key, and the elliptic curve name; Performing a hash operation message authentication code algorithm on the device identifier by using the hash operation message authentication code algorithm name and the second shared key to generate the server signature; When a major change occurs to the device, a security mechanism is provided through remote authentication and encrypted communication to update the device identification.

2. The identification generation and verification method according to claim 1, characterized in that: include: The sending of the device identification to the server to verify whether the device identification exists in a database of the server further includes: If it does not exist, the server public key, the elliptic curve name and the hash operation message authentication code algorithm name are returned; If it already exists, the device information and preset time are retrieved to generate the device identification.

3. The identification generation and verification method according to claim 1, characterized in that: The determining whether the client signature and the server signature are identical and if they are identical, the verification is passed, comprises: storing the device identification in the database and returning a success response.

4. The identification generation and verification method according to claim 1, characterized in that: The determining whether the client signature and the server signature are identical, and if they are identical, the verification passes, further includes: If they are not the same, the verification fails; Check whether the device identification exists in the database, delete it if it exists, and re-acquire the device information and preset time to generate the device identification.

5. A system for generating and verifying an identifier, used to implement the method according to any one of claims 1 to 4, characterized in that: include: The client is used to obtain device information and preset time to generate a device identification; Sending the device identification to a server to verify whether it exists in a database of the server; The server is used to determine if the device identifier does not exist in the database of the server, then generate a client signature and a server signature respectively; and determine whether the client signature and the server signature are the same, if they are the same, the verification passes; The device identifier is obtained by concatenating a universal unique identifier, a hash value and a snowflake unique identifier, and the hash value is generated by the device information and the preset time.

6. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.