CN108933950B - Terminal identification determining method and device, computer equipment and storage medium - Google Patents

Terminal identification determining method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN108933950B
CN108933950B CN201810972892.XA CN201810972892A CN108933950B CN 108933950 B CN108933950 B CN 108933950B CN 201810972892 A CN201810972892 A CN 201810972892A CN 108933950 B CN108933950 B CN 108933950B
Authority
CN
China
Prior art keywords
hash value
terminal
hash
public key
unique identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810972892.XA
Other languages
Chinese (zh)
Other versions
CN108933950A (en
Inventor
艾立超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810972892.XA priority Critical patent/CN108933950B/en
Publication of CN108933950A publication Critical patent/CN108933950A/en
Application granted granted Critical
Publication of CN108933950B publication Critical patent/CN108933950B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/258Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
    • H04N21/25808Management of client data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/258Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
    • H04N21/25808Management of client data
    • H04N21/25816Management of client data involving client authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/4508Management of client data or end-user data
    • H04N21/4516Management of client data or end-user data involving client characteristics, e.g. Set-Top-Box type, software version or amount of memory available

Abstract

A terminal identification determining method and device, computer equipment and storage medium are provided, wherein the terminal identification determining method comprises the following steps: receiving a global unique identifier request sent by a terminal; responding the global unique identifier request, and generating a unique private key corresponding to the terminal; determining a public key corresponding to the unique private key according to the unique private key; and generating a corresponding globally unique identifier of the terminal based on the public key. By adopting the method, the unique global identifier corresponding to the terminal can be ensured to uniquely correspond to one terminal.

Description

Terminal identification determining method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for determining a terminal identifier, a computer device, and a storage medium.
Background
With the continuous development of computer technology, a large number of applications emerge, and after the terminal is installed with the applications, a user can use the functions provided by the applications, so that various requirements are met, and a lot of convenience is provided for the user. For example, the advent of smart televisions provides many conveniences for video viewing by users. The video application and the like can be installed on the television terminal, the video application is operated, and a user can select the video provided by the video application to play.
Taking a television terminal as an example, in order to facilitate statistics of application use conditions of users on the television terminal, statistics of the number of active users on the day of the application and the like, after the user installs and runs the application for the first time on the television terminal, an identifier can be allocated to the application background to identify the identity of the application. Currently, in the process of determining the identifier, the background needs to utilize information uploaded by the television terminal, for example, a television terminal serial number (i.e., a television equipment serial number), a television terminal MAC address, a manufacturer identifier, a television terminal CPU, television terminal memory information, and the like. The existing process for determining the identifier depends on information uploaded by a client, but in order to reduce cost, different television terminals use the same equipment serial number, MAC address and the like, and the information uploaded to a server by different television terminals is the same, so that the situation that the identifiers corresponding to different television terminals are the same can occur, and further, a plurality of television terminals can correspond to the same identifier, that is, one identifier cannot correspond to a unique television terminal, and further, it cannot be ensured that the identifier of the television terminal uniquely marks one television terminal, and then, during subsequent statistical work, accurate statistical data cannot be obtained, that is, deviation exists between the number of the identifiers to be counted and the number of actual television terminals.
Disclosure of Invention
Therefore, it is necessary to provide a terminal identifier determining method and apparatus, a computer device, and a storage medium, for solving the problem that it is not possible to ensure that one identifier corresponds to a unique terminal.
A terminal identification determining method comprises the following steps:
receiving a global unique identifier request sent by a terminal;
responding the global unique identifier request, and generating a unique private key corresponding to the terminal;
and generating a globally unique identifier corresponding to the terminal based on the unique private key.
A terminal identification determination apparatus comprising:
the receiving module is used for receiving a global unique identifier request sent by a terminal;
the private key determining module is used for responding to the global unique identifier request and generating a unique private key corresponding to the terminal;
and the terminal identification generating module is used for generating a global unique identifier corresponding to the terminal based on the unique private key.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the above method when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method.
In the process of determining the terminal identification, when a global unique identifier request sent by the terminal is received, the unique private key corresponding to the terminal can be generated in response to the global unique identifier request, namely the unique private key is uniquely corresponding to the terminal. Due to the uniqueness of the private key, the uniqueness of the public key obtained based on the unique private key can be ensured, and further, the globally unique identifier corresponding to the terminal is generated on the basis of the public key, namely, the uniqueness of the globally unique identifier corresponding to the terminal can be ensured, namely, the globally unique identifier corresponding to the terminal can be ensured to uniquely correspond to one terminal.
Drawings
Fig. 1 is a schematic diagram of an application environment of a terminal identifier determination method in one embodiment;
fig. 2 is a flowchart illustrating a method for determining a terminal identifier according to an embodiment;
fig. 3 is a flowchart illustrating a step of generating a globally unique identifier corresponding to a terminal based on a public key in a terminal identifier determining method in another embodiment;
fig. 4 is a flowchart illustrating a terminal determination method in another embodiment;
FIG. 5 is a schematic diagram of a method of terminal determination in another embodiment;
FIG. 6 is a schematic diagram of the interaction between a video application and a background on a television terminal;
fig. 7 is a block diagram of a terminal identification determining apparatus in one embodiment;
FIG. 8 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the detailed description and specific examples, while indicating the scope of the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.
The terminal identification determining method of the embodiments provided in the present application may be applied to an application environment as shown in fig. 1, where the application environment includes a terminal 10 and a server 20, and the terminal 10 may communicate with the server 20 through a network. Specifically, an application (e.g., a video application) may be installed on the terminal 10, and when the application is first run on the terminal 10, the terminal 10 may send a globally unique identifier request to the server 20, and the server 20 may be a background server corresponding to the application, and the server 20 may be configured to respond to the globally unique identifier request and interact and communicate with the terminal 10 where the application is located. That is, after receiving the global unique identifier request sent by the terminal 10 and responding, the server 20 may determine the unique private key corresponding to the terminal 10, determine the corresponding public key based on the unique private key, generate the global unique identifier corresponding to the terminal on the basis of the public key, that is, the global unique identifier serves as a terminal identifier, and the global unique identifier that may be determined through the above process may uniquely identify the terminal.
The server 20 may be implemented as a stand-alone server or as a server cluster comprising a plurality of servers. The terminal 10 may be any device capable of implementing intelligent input and output and installing and running applications, for example, the terminal may be a television terminal, a smart phone, a tablet computer, a vehicle-mounted computer, a wearable smart device, and the like.
In one embodiment, as shown in fig. 2, a terminal identification determination method is provided. The method is exemplified by being applied to the server 20 in fig. 1, and includes the following steps S210 to S230.
S210: receiving a globally unique identifier request sent by a terminal.
The globally Unique identifier, i.e. guid (global Unique identifier), is a kind of generated identifier, and can be used to uniquely identify the object. In this embodiment, to distinguish different terminals, a unique identifier may be created for a terminal by an algorithm, the GUID may be the unique identifier, each terminal has its own unique identifier, and the global unique identifier of the terminal may uniquely identify the terminal.
In an example, the terminal may be a television terminal, and taking the terminal as a television terminal as an example, the terminal identifier determining method is a television terminal identifier determining method, where the television terminal may be a smart television or a television box.
The terminal can be provided with applications, such as video applications, and users can operate and control the video applications on the terminal, so that video playing and the like can be realized. When the terminal starts the application for the first time, a global unique identifier request can be sent to a background corresponding to the application, namely the server, so as to request the global unique identifier. The terminal can receive the globally unique identifier returned by the server, and any request sent to the server subsequently carries the globally unique identifier. And when the server receives the global unique identifier request sent by the terminal, responding to the request to execute the corresponding global unique identifier generation process.
S220: and responding to the request of the global unique identifier to generate a unique private key corresponding to the terminal.
The server receives the global unique identifier request and then responds, firstly, the unique private key corresponding to the terminal needs to be generated, namely, the unique private key uniquely corresponds to the terminal, and the condition that the same private key corresponds to a plurality of terminals can be avoided.
In an example, the generating of the unique private key corresponding to the terminal may be randomly generating the unique private key corresponding to the terminal, that is, the private key may be randomly generated. In one example, the private key may be a 32-byte number, the private key is private, poorly identifiable, and highly secure.
S230: and determining a public key corresponding to the unique private key according to the unique private key.
The private key and the public key are paired, and after the private key is determined, the corresponding public key can also be determined, and the public key is public. In particular, the private key may be processed through an encryption algorithm to determine the corresponding public key. Namely, the public key can be determined through the private key, but the private key cannot be obtained through reverse calculation of the public key, so that the data security is improved.
The unique private key can uniquely correspond to the terminal and has uniqueness, so that the uniqueness of the public key determined based on the unique private key can be ensured.
S240: and generating a corresponding globally unique identifier of the terminal based on the public key.
After the public key is determined, a global unique identifier corresponding to the terminal can be generated based on the public key, that is, a terminal identifier (the global unique identifier serves as the terminal identifier) is generated, the terminal identifier is determined, the terminal can be uniquely marked through the global unique identifier, and the situation that the terminal identifiers are the same can be avoided.
In the terminal identification determining method, in the process of determining the terminal identification, when a global unique identifier request sent by the terminal is received, a unique private key corresponding to the terminal can be generated in response to the global unique identifier request, namely, the unique private key is uniquely corresponding to the terminal. Due to the uniqueness of the private key, the uniqueness of the public key obtained based on the unique private key can be ensured, and further, on the basis of the public key, the global unique identifier corresponding to the terminal is generated, that is, the uniqueness of the global unique identifier corresponding to the terminal can be ensured, that is, the global unique identifier corresponding to the terminal can be ensured to uniquely correspond to one terminal.
In an embodiment, after generating the globally unique identifier corresponding to the terminal based on the public key, the method may further include: and counting the global unique identifiers corresponding to the terminals to obtain the quantity of the global unique identifiers.
In the server, every time a global unique identifier request sent by a terminal is received to perform a global unique identifier generation process, a global unique identifier corresponding to the terminal is correspondingly obtained. After obtaining the global unique identifier corresponding to a terminal, the global unique identifier corresponding to the terminal can be recorded. The global unique identifier corresponding to each terminal obtained in the server can be counted subsequently, and the number of the global unique identifiers is obtained. Because the globally unique identifier has uniqueness, duplication is avoided, and therefore, the accuracy of the number of the globally unique identifiers can be improved. Moreover, the number of the globally unique identifiers corresponds to the number of the terminals, i.e. the number of users using the application can be accurately determined by the number of the globally unique identifiers.
As shown in fig. 3, in one embodiment, the globally unique identifier request carries an application attribute information value, i.e., an application corresponding attribute information value. When the application is started for the first time, the terminal can send a global unique identifier request to the background, and the global unique identifier request carries the application attribute information value to be used as a data basis for the server to generate the global unique identifier.
The step S240 of generating the globally unique identifier corresponding to the terminal based on the public key includes steps S341 to S344.
S341: and carrying out hash processing on the public key to determine an initial hash value of the public key.
Hashing refers to the transformation of an input into a fixed length output, which is a hash value, and may also be referred to as a hash value, by a hashing algorithm, which may be understood as a kind of compression mapping. In the process of generating the globally unique identifier corresponding to the terminal based on the public key, the public key is subjected to hash processing to determine an initial hash value, wherein the input of the hash processing is the public key, and the output is the initial hash value.
S342: an intermediate hash value is determined based on the application attribute information value and the initial hash value of the public key.
And processing the initial hash value by using the application attribute information value to obtain an intermediate hash value. On one hand, the information quantity of the intermediate hash value is ensured, and the uniqueness is enhanced. And on the other hand, the relevance of the intermediate hash value to the application attribute information and the initial hash value respectively is ensured.
In one example, an intermediate hash value may be obtained by adding the application attribute information value to the initial hash value of the public key before the application attribute information value, i.e., combining the application attribute information value and the initial hash value to obtain the intermediate hash value, and the determined intermediate hash value may include both the initial hash value and the application attribute information value before the initial hash value.
For example, the initial hash value is 0x010866776006953D5567439E5E39F86A0D273be, and the application attribute information value is 0x00, where 0x in the initial hash value and the application attribute information value represents 16 systems, and the actual value is a number after 0x, then the resulting intermediate hash value is 0x00010866776006953D5567439E5E39F86A0D273 be. In one example, the application attribute information value may be an application version number (the application version number is a numeric value).
S343: and carrying out hash processing on the intermediate hash value to determine a target hash value.
After the intermediate hash value is obtained, in order to further improve the security and the uniqueness, hash processing needs to be performed on the intermediate hash value to obtain a target hash value. Here, the input of the hash process is an intermediate hash value, and the output is a target hash value.
S344: and generating a globally unique identifier corresponding to the terminal based on the intermediate hash value and the target hash value.
In this embodiment, the determination of the globally unique identifier is performed in conjunction with the intermediate hash value and the target hash value, i.e. the determination of the globally unique identifier is related to both the intermediate hash value and the target hash value, to ensure the security and uniqueness thereof.
In one embodiment, the step S341 of performing a hash process on the public key and determining an initial hash value of the public key includes: performing hash processing on the public key based on a first hash algorithm to determine an original hash value; and carrying out hash processing on the original hash value based on a second hash algorithm to determine an initial hash value.
And respectively carrying out hash processing on the public key and the original hash value by adopting different hash algorithms to obtain a processed hash value. In one example, the first hash algorithm may be a SHA-256 hash algorithm and the second hash algorithm may be a RIPEMD-160 hash algorithm.
In one embodiment, the step S343 of performing hash processing on the intermediate hash value to determine a target hash value includes: performing hash processing on the intermediate hash value based on a third hash algorithm to determine a processed intermediate hash value; and performing hash processing on the processed intermediate hash value based on a third hash algorithm to determine a target hash value.
And performing hash processing on the intermediate hash value twice by adopting the same hash algorithm, namely performing hash processing on the intermediate hash value once by adopting a third hash algorithm, and performing hash processing on the processed intermediate hash value once by utilizing the third hash algorithm to obtain a target hash value. In one example, the third hash algorithm may be the same as the first hash algorithm described above, and the third hash algorithm may be a SHA-256 hash algorithm.
In one embodiment, the step S344 of generating the globally unique identifier corresponding to the terminal based on the intermediate hash value and the target hash value includes: selecting a preset number of bytes from the target hash value, adding the bytes into the intermediate hash value, and obtaining a hash value to be processed; and encoding the hash value to be processed, and determining the global unique identifier corresponding to the terminal.
Namely, a preset number of bytes in the target hash value are selected and combined with the intermediate hash value to obtain a hash value to be processed, and the preset number of bytes in the target hash value is selected behind the intermediate hash value. In this way, the intermediate hash value is further transformed by using at least part of data in the target hash value, so that the obtained hash value to be processed is safer, and the uniqueness of the hash value is enhanced. Which is subsequently encoded to determine the globally unique identifier.
In one embodiment, the hash value to be processed is obtained after a preset number of bytes are arbitrarily selected from the target hash value and added to the intermediate hash value, i.e., the bytes after the intermediate hash value of the added value are arbitrarily selected from the target hash value. Therefore, the diversity of the hash values to be processed can be improved.
In one example, the hash value to be processed may be obtained after a preset number of bytes are selected from the target hash value and added to the intermediate hash value. For example, the target hash value is 0xE61967F63C7DD183914A4AE452C9F6AD5F462CE3D277798075B107615C1A8A3E, the intermediate hash value is 0x00010866776006953D5567439E5E39F86A0D273be, after the first preset number of bytes in the target hash value (the preset number may be 4 in one example, then the first preset number of bytes in the target hash value is the first four bytes, i.e., E61967F6) is added to the intermediate hash value, the hash value to be processed is 0x00010866776006953D5567439E5E39F86A0D273be 61967F 6.
In one embodiment, the BASE58 encoding algorithm may be used to encode the hash value to be processed to determine the globally unique identifier corresponding to the terminal.
In one embodiment, determining the public key corresponding to the unique private key according to the unique private key includes: and encrypting the unique private key based on a preset encryption algorithm to determine a public key.
On the basis of determining the unique private key, the private key can be encrypted through an encryption algorithm to obtain a public key, and the private key cannot be reversely calculated through the public key, so that the information safety can be ensured. It will be appreciated that the public key is unique, thus ensuring the uniqueness of the globally unique identifier that is subsequently derived.
In one embodiment, the predetermined encryption algorithm may be an asymmetric encryption algorithm.
In the symmetric encryption algorithm, a data sender processes a plaintext (original data) and an encryption key together through a special encryption algorithm, and then the plaintext and the encryption key are changed into a complex encryption ciphertext to be sent out. After the receiver receives the ciphertext, if the receiver wants to decode the original text, the receiver needs to decrypt the ciphertext by using the key used for encryption and the inverse algorithm of the same algorithm so as to recover the ciphertext into readable plaintext. In the symmetric encryption algorithm, only one key is used, both the sender and the receiver use the key to encrypt and decrypt data, and the decryptor needs to know the encryption key in advance, so that the security is insufficient. The asymmetric encryption algorithm requires two keys: public key (publickey) and private key (privatekey). The public key and the private key are a pair, and if the public key is used for encrypting data, the corresponding private key is needed for decryption; if the private key is used to encrypt data, the corresponding public key is needed to decrypt the data. Two different keys are used for encryption and decryption, so that the security can be improved.
In one example, the asymmetric encryption algorithm may employ an elliptic curve encryption algorithm (secp256k 1).
In one embodiment, generating a unique private key corresponding to the terminal includes: generating a unique random number corresponding to the terminal at random by a random number generator; and taking the unique random number as a unique private key corresponding to the terminal.
The private key is randomly generated and is unique, the private keys generated by the server are unique for different terminals, and the unique private keys can uniquely correspond to the terminals. In the embodiment, a unique random number is randomly generated by the random number generator to serve as a unique private key, so that the method is fast and accurate.
In one embodiment, after generating the globally unique identifier corresponding to the terminal, the method further includes: the globally unique identifier is returned to the terminal.
After the server generates the globally unique identifier corresponding to the terminal, the server can return the globally unique identifier to the corresponding terminal. The terminal receives the global unique identifier, and any request sent to the server subsequently can carry the corresponding global unique identifier so as to facilitate server statistics and recording.
The following describes a procedure of the above terminal identifier determining method in a specific embodiment. With the invention of digital encryption currency such as bitcoin, a brand new decentralized distributed infrastructure called as a block chain and a data operation mode are gradually developed. Decentralization, distribution, programmability, high security and reliability are remarkable characteristics of the block chain technology, and are particularly suitable for the fields of macroscopic systems such as data storage, financial transactions and the like. The block chain is a bottom layer technology derived from a bitcoin, is a chain data structure formed by combining data blocks in a sequential connection mode according to a time sequence, and is guaranteed to be non-falsifiable and non-counterfeitable in a cryptographic mode to realize a decentralized distributed account book. The above terminal identity determination process may be understood as a process of determining a terminal identity based on a block chain.
Taking a television terminal as an example, as shown in fig. 4 and 5, firstly, a user may install a video application (i.e., a video APP) at the television terminal, and when the user starts the video application on the television terminal for the first time, the video application may send a GUID request (a globally unique identifier request) to a background of the video application through the terminal, where the GUID request may carry a version number corresponding to the video application. The video application on the terminal has a corresponding cache, and in the use process of the video application, cache information, such as information of pictures, videos and the like, can be generated in the cache. If the video application is operated for the first time, the cache information is not stored in the cache, whether the video application is started for the first time or not can be judged by detecting whether the cache information exists in the cache, if not, the video application represents the first start and sends a GUID request to the next day, otherwise, the video application represents the non-first start and does not need to send the GUID request.
Then, the background of the video application responds to the global unique identifier request, a 32-byte unique random number corresponding to the television terminal is randomly generated through a random number generator, and the unique random number is used as a unique private key corresponding to the television terminal, as shown in fig. 6. For example, the unique private key generated may be 0x28FD4A7B6a307F426a94F8114701E7C8E774E7E9a47E2C2035DB23a 206321726.
Secondly, a public key corresponding to the unique private key is determined based on an elliptic curve encryption algorithm (secp256k 1). For example, the public key determined based on the unique private key described above may be 0x0460863AD64a87AE8D2FE83C1AF1a8403CB53F53E486D8511DAD8a04887E5B23522CD470243453a299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BB 7.
And performing hash processing on the public key based on the SHA-256 hash algorithm to determine an original hash value, and performing hash processing on the original hash value based on the RIPEMD-160 hash algorithm to determine an initial hash value. For example, the determined raw hash value may be 0x600FFE422B4E00731a59557A5CCA46CC183944191006324a447BDB2D98D4B 408. The initial hash value determined based on the original hash value may be: 0x010866776006953D5567439E5E39F86A0D273 BEE.
And then, before adding the application version number to the initial hash value of the public key, determining an intermediate hash value. As shown in fig. 6, the application version number may be 0x00(0x identifies 16 th, and its specific value is 00), and when it is added before the initial hash value, the determined intermediate hash value is 0x00010866776006953D5567439E5E39F86A0D273 BEE. And performing hash processing on the intermediate hash value by using an SHA-256 hash algorithm to determine a processed intermediate hash value, and performing hash processing on the processed intermediate hash value based on the SHA-256 hash algorithm to determine a target hash value. Namely, SHA-256 hash processing is carried out on the intermediate hash value for 2 times to obtain a target hash value. The obtained target hash value is 0xE61967F63C7DD183914A4AE452C9F6AD5F462CE3D277798075B107615C1A8 A3E.
And thirdly, after the first four bytes in the target hash value are added to the intermediate hash value, obtaining the hash value to be processed, wherein the four bytes can be used for verification. The first four bytes in the selected target hash value are E61967F6, and after the first four bytes are added to the intermediate hash value, the obtained hash value to be processed is 0x00010866776006953D5567439E5E39F86A0D273BEEE61967F 6.
And coding the hash value to be processed based on a BASE58 coding algorithm, and determining the GUID corresponding to the television terminal, wherein the GUID corresponding to the television terminal is used as the television terminal identifier. The globally unique identifier corresponding to the determined television terminal may be 16UwLL9Risc3 qfpqbuvbkofhbmq 7 wMtjvM. The terminal where the video application is located can be uniquely identified through the globally unique identifier. And finally, returning the obtained globally unique identifier to the television terminal.
In this way, the embodiment of the application does not rely on the parameters uploaded by the television terminal to determine the identifier, but determines the globally unique identifier through the above process, so as to ensure the uniqueness of the television terminal identifier. Based on the characteristics of non-tampering and uniqueness of the block chain, the process of determining the television terminal identification can effectively solve the problems that a plurality of television terminals correspond to the same GUID and a single user cannot correspond to the single GUID.
It should be understood that although the various steps in the flow charts of fig. 2-5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-5 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
As shown in fig. 7, a terminal identifier determining apparatus according to an embodiment is provided, where the apparatus may be the server 20 in fig. 1, and may also be disposed in the server 20 in fig. 1, and the apparatus includes:
a request receiving module 710, configured to receive a globally unique identifier request sent by a terminal;
the private key generating module 720 is configured to respond to the global unique identifier request and generate a unique private key corresponding to the terminal;
the public key determining module 730 is configured to determine, according to the unique private key, a public key corresponding to the unique private key;
and an identification determining module 740, configured to generate a globally unique identifier corresponding to the terminal based on the public key.
In one embodiment, the globally unique identifier request carries an application attribute information value.
The terminal identification determining device can respond to the global unique identifier request to generate the unique private key corresponding to the terminal when receiving the global unique identifier request sent by the terminal in the process of determining the terminal identification, namely the unique private key is uniquely corresponding to the terminal. Due to the uniqueness of the private key, the uniqueness of the public key obtained based on the unique private key can be ensured, and further, on the basis of the public key, the global unique identifier corresponding to the terminal is generated, that is, the uniqueness of the global unique identifier corresponding to the terminal can be ensured, that is, the global unique identifier corresponding to the terminal can be ensured to uniquely correspond to one terminal.
In one example, the private key generation module 720 can be used to randomly generate a unique private key corresponding to the terminal, i.e., the private key can be randomly generated.
In this embodiment, the identifier determining module 740 includes: the device comprises an initial hashing module, an adding module, a target determining module and an identification generating module.
The initial hash module is used for carrying out hash processing on the public key and determining an initial hash value of the public key;
the intermediate hash module is used for determining an intermediate hash value based on the application attribute information value and the initial hash value of the public key;
the target determining module is used for carrying out hash processing on the intermediate hash value to determine a target hash value;
and the identification generation module is used for generating the global unique identifier corresponding to the terminal based on the intermediate hash value and the target hash value.
In one embodiment, the intermediate hash module is configured to determine the intermediate hash value prior to adding the application attribute information value to the initial hash value of the public key.
In one embodiment, the initial hashing module includes:
the first hash module is used for carrying out hash processing on the public key based on a first hash algorithm to determine an original hash value;
and the second hash module is used for carrying out hash processing on the original hash value based on a second hash algorithm to determine an initial hash value.
In one embodiment, the goal determination module includes:
the third hash module is used for carrying out hash processing on the intermediate hash value based on a third hash algorithm and determining the processed intermediate hash value;
and the target hash value determining module is used for carrying out hash processing on the processed intermediate hash value based on a third hash algorithm to determine a target hash value.
In one embodiment, the identity generation module includes:
the numerical value adding module is used for selecting a preset number of bytes from the target hash value and adding the bytes to the intermediate hash value to obtain a hash value to be processed;
and the global unique identifier generating module is used for encoding the hash value to be processed and determining the global unique identifier corresponding to the terminal.
In an embodiment, the value adding module may be configured to arbitrarily select a preset number of bytes from the target hash value and add the selected preset number of bytes to the intermediate hash value, so as to obtain the hash value to be processed.
In an example, the value adding module may be configured to obtain the hash value to be processed after a preset number of bytes are selected from the target hash value and added to the intermediate hash value.
In one embodiment, the public key determining module is configured to perform encryption processing on the unique private key based on a preset encryption algorithm to determine the public key.
In one embodiment, the predetermined encryption algorithm is an asymmetric encryption algorithm.
In one embodiment, a private key generation module comprises:
the random number generation module is used for randomly generating a unique random number corresponding to the terminal through a random number generator;
and the private key determining module is used for taking the unique random number as a unique private key corresponding to the terminal.
In one embodiment, the above apparatus further comprises:
and the sending module is used for returning the globally unique identifier to the terminal.
For the specific definition of the terminal identifier determining apparatus, see the above definition of the terminal identifier determining method, which is not described herein again. The respective modules in the terminal identification determination device described above may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be the server 20 in fig. 1, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. Which computer program is executed by a processor to carry out the steps of the embodiments of the methods described above.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory storing a computer program and a processor implementing the steps of the above method when the processor executes the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (20)

1. A method for determining a terminal identifier, comprising the steps of:
receiving a global unique identifier request sent by a terminal;
responding the global unique identifier request, and generating a unique private key corresponding to the terminal;
determining a public key corresponding to the unique private key according to the unique private key;
generating a globally unique identifier corresponding to the terminal based on the public key;
and counting the global unique identifiers corresponding to the terminals to obtain the quantity of the global unique identifiers.
2. The method of claim 1, wherein the globally unique identifier request carries an application attribute information value;
the generating of the globally unique identifier corresponding to the terminal based on the public key includes:
carrying out Hash processing on the public key to determine an initial Hash value of the public key;
determining an intermediate hash value based on the application attribute information value and an initial hash value of the public key;
performing hash processing on the intermediate hash value to determine a target hash value;
and generating a globally unique identifier corresponding to the terminal based on the intermediate hash value and the target hash value.
3. The method of claim 2, wherein the hashing the public key to determine an initial hash value of the public key comprises:
performing hash processing on the public key based on a first hash algorithm to determine an original hash value;
and carrying out hash processing on the original hash value based on a second hash algorithm to determine the initial hash value.
4. The method of claim 2, wherein the hashing the intermediate hash value to determine a target hash value comprises:
performing hash processing on the intermediate hash value based on a third hash algorithm to determine a processed intermediate hash value;
and carrying out hash processing on the processed intermediate hash value based on the third hash algorithm, and determining the target hash value.
5. The method of claim 2, wherein generating the globally unique identifier corresponding to the terminal based on the intermediate hash value and the target hash value comprises:
selecting a preset number of bytes from the target hash value and adding the bytes to the intermediate hash value to obtain a hash value to be processed;
and encoding the hash value to be processed, and determining a globally unique identifier corresponding to the terminal.
6. The method of claim 1, wherein determining the public key corresponding to the unique private key according to the unique private key comprises:
and encrypting the unique private key based on a preset encryption algorithm to determine the public key.
7. The method of claim 6, wherein the predetermined encryption algorithm is an asymmetric encryption algorithm.
8. The method according to claim 1, wherein the generating a unique private key corresponding to the terminal comprises:
generating a unique random number corresponding to the terminal at random through a random number generator;
and taking the unique random number as a unique private key corresponding to the terminal.
9. The method according to any one of claims 1-8, wherein after generating the globally unique identifier corresponding to the terminal, further comprising:
returning the globally unique identifier to the terminal.
10. A terminal identification determining apparatus, comprising:
the request receiving module is used for receiving a global unique identifier request sent by a terminal;
the private key generating module is used for responding to the global unique identifier request and generating a unique private key corresponding to the terminal;
the public key determining module is used for determining a public key corresponding to the unique private key according to the unique private key;
the identification determining module is used for generating a globally unique identifier corresponding to the terminal based on the public key; and counting the global unique identifiers corresponding to the terminals to obtain the quantity of the global unique identifiers.
11. The apparatus of claim 10, wherein the globally unique identifier request carries an application attribute information value;
the identification determination module comprises:
the initial hash module is used for carrying out hash processing on the public key and determining an initial hash value of the public key;
the intermediate hash module is used for determining an intermediate hash value based on the application attribute information value and the initial hash value of the public key;
the target determining module is used for carrying out hash processing on the intermediate hash value to determine a target hash value;
and the identification generation module is used for generating the globally unique identifier corresponding to the terminal based on the intermediate hash value and the target hash value.
12. The apparatus of claim 11, wherein the initial hashing module comprises:
the first hash module is used for carrying out hash processing on the public key based on a first hash algorithm to determine an original hash value;
and the second hash module is used for carrying out hash processing on the original hash value based on a second hash algorithm to determine the initial hash value.
13. The apparatus of claim 11, wherein the goal determination module comprises:
the third hash module is used for carrying out hash processing on the intermediate hash value based on a third hash algorithm and determining the processed intermediate hash value;
and the target hash determining module is used for carrying out hash processing on the processed intermediate hash value based on the third hash algorithm to determine the target hash value.
14. The apparatus of claim 11, wherein the identity generation module comprises:
the numerical value adding module is used for selecting a preset number of bytes from the target hash value and adding the bytes to the intermediate hash value to obtain a hash value to be processed;
and the global unique identifier generating module is used for encoding the hash value to be processed and determining the global unique identifier corresponding to the terminal.
15. The apparatus of claim 10,
the public key determining module is further used for encrypting the unique private key based on a preset encryption algorithm to determine a public key.
16. The apparatus of claim 15, wherein the predetermined encryption algorithm is an asymmetric encryption algorithm.
17. The apparatus of claim 10, wherein the private key generation module comprises:
the random number generation module is used for generating a unique random number corresponding to the terminal at random through a random number generator;
and the private key determining module is used for taking the unique random number as a unique private key corresponding to the terminal.
18. The apparatus of any one of claims 10-17, further comprising:
a sending module, configured to return the globally unique identifier to the terminal.
19. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method according to any of claims 1-9.
20. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 9.
CN201810972892.XA 2018-08-24 2018-08-24 Terminal identification determining method and device, computer equipment and storage medium Active CN108933950B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810972892.XA CN108933950B (en) 2018-08-24 2018-08-24 Terminal identification determining method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810972892.XA CN108933950B (en) 2018-08-24 2018-08-24 Terminal identification determining method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108933950A CN108933950A (en) 2018-12-04
CN108933950B true CN108933950B (en) 2020-06-05

Family

ID=64445903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810972892.XA Active CN108933950B (en) 2018-08-24 2018-08-24 Terminal identification determining method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108933950B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112668061B (en) * 2021-01-13 2022-08-12 海信视像科技股份有限公司 Electronic equipment and equipment code reporting method thereof

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103780379B (en) * 2012-10-19 2017-09-19 阿里巴巴集团控股有限公司 Cipher encrypting method and system and cryptographic check method and system
US10015017B2 (en) * 2015-04-09 2018-07-03 Qualcomm Incorporated Proof of work based user identification system
CN112019503B (en) * 2018-03-01 2023-11-07 北京华为数字技术有限公司 Method for obtaining equipment identifier, communication entity, communication system and storage medium

Also Published As

Publication number Publication date
CN108933950A (en) 2018-12-04

Similar Documents

Publication Publication Date Title
CN112637166B (en) Data transmission method, device, terminal and storage medium
US11196745B2 (en) Blockchain-based account management
CN111107073B (en) Application automatic login method and device, computer equipment and storage medium
CN111191294B (en) Single-node accounting method, system, equipment and storage medium based on block chain
CN111200641A (en) Data cross-chain sharing method and system, computer equipment and storage medium
CN110727949B (en) Data storage method and device, computer equipment and storage medium
CN110690956B (en) Bidirectional authentication method and system, server and terminal
CN110781140B (en) Method, device, computer equipment and storage medium for signing data in blockchain
CN109347813B (en) Internet of things equipment login method and system, computer equipment and storage medium
CN111294203A (en) Information transmission method
CN111131336A (en) Resource access method, device, equipment and storage medium under multi-party authorization scene
CN112800393A (en) Authorization authentication method, software development kit generation method, device and electronic equipment
CN109088729B (en) Key storage method and device
CN111259428A (en) Data processing method and device based on block chain, node equipment and storage medium
CN108933950B (en) Terminal identification determining method and device, computer equipment and storage medium
CN113438205A (en) Block chain data access control method, node and system
CN112152802A (en) Data encryption method, electronic device and computer storage medium
CN115001864B (en) Communication authentication method and device for intelligent furniture, computer equipment and storage medium
CN115361198A (en) Decryption method, encryption method, device, computer equipment and storage medium
CN110765147B (en) Content updating method based on block chain encrypted storage, user node and medium
CN109561093B (en) Unauthorized behavior detection method and device, computer equipment and storage medium
CN114691759B (en) Data query statistical method, device, computer equipment and storage medium
CN114143108B (en) Session encryption method, device, equipment and storage medium
CN114338152B (en) Data processing method and device
CN116070250B (en) Password algorithm evaluation method and device for android system application program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant