CN108834130B - Identification distribution method, device, terminal and computer readable storage medium - Google Patents

Identification distribution method, device, terminal and computer readable storage medium Download PDF

Info

Publication number
CN108834130B
CN108834130B CN201810561682.1A CN201810561682A CN108834130B CN 108834130 B CN108834130 B CN 108834130B CN 201810561682 A CN201810561682 A CN 201810561682A CN 108834130 B CN108834130 B CN 108834130B
Authority
CN
China
Prior art keywords
identifier
terminal
request
random
identified
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
CN201810561682.1A
Other languages
Chinese (zh)
Other versions
CN108834130A (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.)
Shenzhen Hongdian Technologies Corp
Original Assignee
Shenzhen Hongdian Technologies Corp
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 Shenzhen Hongdian Technologies Corp filed Critical Shenzhen Hongdian Technologies Corp
Priority to CN201810561682.1A priority Critical patent/CN108834130B/en
Publication of CN108834130A publication Critical patent/CN108834130A/en
Application granted granted Critical
Publication of CN108834130B publication Critical patent/CN108834130B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/22Processing or transfer of terminal data, e.g. status or physical capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/22Processing or transfer of terminal data, e.g. status or physical capabilities
    • H04W8/24Transfer of terminal data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention belongs to the technical field of communication, and particularly relates to an identifier distribution method, an identifier distribution device, a terminal and a computer readable storage medium, wherein the identifier distribution method comprises the following steps: receiving a first identifier acquisition request sent by a terminal to be identified, wherein the first identifier acquisition request carries a first random identifier and a first request frequency generated by the terminal to be identified; determining whether the first identifier acquisition request is valid or not according to the first random identifier and the first request times; if the first identifier obtaining request is valid, returning a terminal identifier for uniquely identifying the terminal to be identified to the terminal to be identified, thereby effectively solving the technical problems that a terminal identification method in the prior art needs to consume a large amount of server resources and the terminal identifier is not unique.

Description

Identification distribution method, device, terminal and computer readable storage medium
Technical Field
The present invention belongs to the field of communications technologies, and in particular, to a method, an apparatus, a terminal, and a computer-readable storage medium for allocating identifiers.
Background
Typically, a terminal, such as a computer or a mobile phone, is assigned one or more terminal identifications for uniquely identifying the terminal. In practical applications, the International Mobile Subscriber identity Number (IMSI), the International Mobile Equipment International identity Number (IMEI), the Media Access Control (MAC) address, the Internet Protocol (IP) address, the terminal serial Number, and other identifiers may be used as the terminal identifier. Through the terminal identification, the network can identify and manage different terminals, and the service operation of the whole network is realized. For example, in a local area network, a server can identify a terminal performing a service request through a terminal identifier in the terminal service request, and perform a service response to the terminal; or, the server may also identify and count all terminals in the network according to the terminal identifier, and perform whole network upgrade or whole network scanning on the terminals in the network according to the statistical result.
It follows that the uniqueness of the terminal identification plays a crucial role for the terminal identification. Currently, the terminal identifier is generally set during the production of the terminal, and registration authorization is performed on the management server at the time of use of the terminal. However, in the application system of the internet of things, when a large number of terminal nodes of the internet of things are connected, this terminal identification method needs to consume a large amount of server resources, and there may be a case where the terminal identifications are not unique, for example, a case where the terminal identifications of two terminals are the same occurs.
Disclosure of Invention
Embodiments of the present invention provide an identifier allocation method, an identifier allocation device, a terminal, and a computer-readable storage medium, which can solve the technical problems that a terminal identification method in the prior art needs to consume a large amount of server resources and a terminal identifier is not unique.
A first aspect of an embodiment of the present invention provides an identifier allocation method, which is applied to a server, and includes: receiving a first identifier acquisition request sent by a terminal to be identified, wherein the first identifier acquisition request carries a first random identifier and a first request frequency generated by the terminal to be identified; determining whether the first identifier acquisition request is valid or not according to the first random identifier and the first request times; and if the first identification obtaining request is valid, returning a terminal identification for uniquely identifying the terminal to be identified to the terminal to be identified.
Optionally, determining whether the first identifier obtaining request is valid according to the first random identifier and the first request number includes: detecting whether at least two first identifier acquisition requests with the same first request times exist in first identifier acquisition requests with the same first random identifier; if at least two first identifier acquisition requests with the same first request times exist in the first identifier acquisition requests with the same first random identifier, determining that the first identifier acquisition requests are invalid; and if the first identifier acquisition requests with the same first random identifier do not have the first identifier acquisition requests with the same first request times, determining that the first identifier acquisition requests are valid.
Optionally, if the first identifier obtaining request is valid, returning a terminal identifier for uniquely identifying the terminal to be identified to the terminal to be identified, where the method includes: and if the first identification obtaining request is valid, returning a terminal medium access control address MAC for uniquely identifying the terminal to be identified to the terminal to be identified.
Optionally, after determining whether the first identifier obtaining request is valid according to the first random identifier and the first request number, the method includes: if the first identifier obtaining request is invalid, returning a regenerated identifier obtaining request instruction to the terminal to be identified, so that the terminal to be identified generates a second identifier obtaining request according to the regenerated identifier obtaining request instruction, wherein the second identifier obtaining request carries a second random identifier and a second request frequency.
A second aspect of the embodiments of the present invention provides an identifier allocation method, which is applied to a terminal to be identified, and includes: generating a first random identifier, and sending a first identifier acquisition request to a server, wherein the first identifier acquisition request carries the first random identifier and a first request frequency N, and the initial value of the N is 1; and in a set time interval, if a terminal identifier which is returned by the server and is used for uniquely identifying the terminal to be identified is not received, updating the first request times N carried in the first identifier obtaining request to be N +1, sending the updated first identifier obtaining request to the server again, and entering the next set time interval until the terminal identifier returned by the server is received.
Optionally, the identifier allocation method further includes: receiving a regeneration identification acquisition request instruction sent by a server; generating a second identifier acquisition request according to the identifier re-generation acquisition request instruction, wherein the second identifier acquisition request carries a second random identifier and a second request frequency M, and the initial value of M is 1; and in a set time interval, if a terminal identifier which is returned by the server and is used for uniquely identifying the terminal to be identified is not received, updating the request times M carried in the second identifier obtaining request to be M +1, re-sending the updated second identifier obtaining request to the server, and entering the next set time interval until the terminal identifier returned by the server is received.
A third aspect of the embodiments of the present invention provides an identifier assigning apparatus, configured in a server, including: the receiving module is used for receiving a first identifier obtaining request sent by a terminal to be identified, wherein the first identifier obtaining request carries a first random identifier and a first request frequency generated by the terminal to be identified; the determining module is used for determining whether the first identifier acquisition request is valid according to the first random identifier and the first request times; and the identification module is used for returning a terminal identification for uniquely identifying the terminal to be identified to the terminal to be identified if the first identification acquisition request is valid.
A fourth aspect of the present invention provides an identifier allocating apparatus, configured to a terminal to be identified, including: the generation module is used for generating a first random identifier and sending a first identifier acquisition request to a server, wherein the first identifier acquisition request carries the first random identifier and a first request frequency N, and the initial value of the N is 1; and the identification module is used for updating the first request times N carried in the first identifier acquisition request to be N +1 if the terminal identifier which is returned by the server and is used for uniquely identifying the terminal to be identified is not received within the set time interval, re-sending the updated first identifier acquisition request to the server, and entering the next set time interval until the terminal identifier returned by the server is received.
A fifth aspect of an embodiment of the present invention provides a terminal, including: comprising a memory, a processor and a computer program stored in said memory and executable on said processor, said processor implementing the steps of the method of the first or second aspect when executing said computer program.
A sixth aspect of the present invention provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the method according to the first or second aspect.
In the embodiment of the invention, when the terminal is produced, the terminal identifier is not distributed, but when the terminal is used, the terminal sends the first identifier acquisition request to the server, so that the server distributes the terminal identifier to the terminal according to the first identifier acquisition request, and the terminal identifier can be directly registered and authorized after being distributed to the terminal, thereby effectively reducing the resource consumed by the server and improving the efficiency of the terminal identifier. In addition, whether the first identification acquisition request is effective is determined according to the first random identification and the first request times; and when the first identification acquisition request is effective, returning a terminal identification for uniquely identifying the terminal to be identified to the terminal to be identified instead of directly returning the terminal identification to the terminal to be identified according to the first identification acquisition request, thereby solving the technical problem that the terminal identification is not unique in the prior art.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments or the prior art will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and that for a person skilled in the art, other relevant drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a schematic flowchart of a first implementation of an identifier allocation method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a second implementation of an identifier allocation method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a third implementation of a method for allocating identifiers according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a first structure of an identification distribution device according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a second structure of an identifier distribution apparatus according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, a first implementation flow diagram of an identifier allocation method provided in an embodiment of the present invention is shown, where the method is applicable to a situation where identifier allocation is performed on a terminal, and may be executed by a server, and includes steps 101 to 103. The server comprises a cloud server and a local data server which can be used for identification distribution.
In step 101, a first identifier obtaining request sent by a terminal to be identified is received, where the first identifier obtaining request carries a first random identifier and a first request frequency generated by the terminal to be identified.
The terminal to be identified can be a mobile phone, a computer, an intelligent watch, an air conditioner, a washing machine and other terminals needing terminal identification distribution.
In the embodiment of the invention, when the terminal is produced, the terminal identification is not distributed, but when the terminal is used, the terminal sends the first identification acquisition request to the server, so that the server distributes the terminal identification to the terminal according to the first identification acquisition request and registers the authorization.
The first identifier obtaining request carrying a first random identifier generated by the terminal to be identified and the first request times means: when a terminal to be identified communicates with a server, firstly, a random identifier is randomly generated and used for the server to identify the terminal to be identified; in addition, in order to avoid random collision, when sending the first identifier obtaining request to the server, the first identifier obtaining request needs to carry the first request times for identifying the sending times of the first identifier obtaining request.
It should be noted that, the more terminal nodes in the network, the larger the amount of data received by the server. In order to accurately receive a first identifier obtaining request sent by a terminal to be identified to a server, the terminal to be identified needs to send the first identifier obtaining request to the server again at set time intervals under the condition that a terminal identifier returned by the server is not obtained, and therefore, a plurality of first identifier obtaining requests with the same first random identifier exist in the first identifier obtaining request received by the server, and in order to distinguish the plurality of first identifier obtaining requests with the same first random identifier, and to avoid random collision, each first identifier obtaining request also needs to carry request times, and each time the terminal sends the first identifier obtaining request to the server again, the request times carried in the first identifier obtaining request are increased once.
The random collision is a situation that at least two first identifier acquisition requests with the same first random identifier number of times exist in the first identifier acquisition requests with the same first random identifier.
For example, the terminal a and the terminal B generate the same first random identifier 0001, at this time, the terminal a and the terminal B send first identifier obtaining requests carrying the first random identifier 0001 and having a request frequency of 1 to the server, and when the server receives the first identifier obtaining requests sent by the terminal a and the terminal B, because the first identifier obtaining requests sent by the terminal a and the terminal B are completely the same, the server cannot identify which first identifier obtaining request is sent by the terminal a and which first identifier obtaining request is sent by the terminal B, which is called that the terminal a and the terminal B have a random collision. When a random collision occurs, the server may return the same terminal identifier to the terminal a and the terminal B simultaneously according to the same first identifier obtaining request, that is, the terminal identifier is not unique, and therefore, the request times need to be carried in the first identifier obtaining request to determine whether a random collision occurs between the terminals to be identified, and when a random collision occurs, the server returns the same terminal identifier to different terminals simultaneously according to the same first identifier obtaining request.
In the embodiment of the present invention, the random identifier may be a terminal identifier generated by the terminal to be identified within a fixed numerical range.
For example, if the terminal identifier is a 48-byte MAC address and a manufacturer of the terminal purchases 100 ten thousand MAC addresses, 1 ten thousand consecutive MAC addresses may be taken out as the random identifier, and one of the 1 ten thousand consecutive MAC addresses is randomly generated as the random identifier when the terminal to be identified sends the first identifier obtaining request to the server, so that the server can identify the terminal to be identified.
In the embodiment of the present invention, the terminal identifier may be not only a MAC address, but also a terminal identifier that uniquely identifies a terminal, such as an IMSI, an IMEI, an IP address, a terminal serial number, and the like.
In step 102, it is determined whether the first identifier obtaining request is valid according to the first random identifier and the first request times.
In order to avoid random collision, after receiving a first identifier acquisition request sent by a terminal to be identified, a server needs to determine whether the first identifier acquisition request is valid according to a first random identifier and a first request frequency in the first identifier acquisition request.
Determining whether the first identifier obtaining request is valid according to the first random identifier and the first request times includes: detecting whether at least two first identifier acquisition requests with the same first request times exist in first identifier acquisition requests with the same first random identifier; if at least two first identifier acquisition requests with the same first request times exist in the first identifier acquisition requests with the same first random identifier, determining that the first identifier acquisition requests are invalid; and if the first identifier acquisition requests with the same first random identifier do not have the first identifier acquisition requests with the same first request times, determining that the first identifier acquisition requests are valid.
That is, when two or more identical first identifier obtaining requests are detected, it is determined that the sent first identifier obtaining requests are invalid, otherwise, the first identifier obtaining requests are valid.
It should be noted that, each first identifier obtaining request received by the server carries a sending timestamp, and therefore, when determining whether the first identifier obtaining request is valid according to the first random identifier and the first request times, only the first identifier obtaining request sent within a terminal setting time period to which the terminal identifier has not been allocated is detected, and the first identifier obtaining request sent outside the setting time period is detected in the next allocation cycle.
Optionally, the terminal to be identified is prohibited from sending the first identifier acquisition request in the time interval between each set time period, so as to avoid non-uniqueness of the terminal identifier caused by random collision. And the duration of the set time period is greater than the set time interval.
In step 103, if the first identifier obtaining request is valid, a terminal identifier for uniquely identifying the terminal to be identified is returned to the terminal to be identified.
For example, if the first identifier obtaining request is valid, returning a terminal identifier, such as an MAC address, an IMSI, an IMEI, an IP address, a terminal serial number, etc., for uniquely identifying the terminal to be identified to the terminal to be identified.
In some embodiments of the present application, after determining whether the first identifier obtaining request is valid according to the random identifier and the first request number, the method includes: if the first identifier obtaining request is invalid, returning a regenerated identifier obtaining request instruction to the terminal to be identified, so that the terminal to be identified generates a second identifier obtaining request according to the regenerated identifier obtaining request instruction, wherein the second identifier obtaining request carries a second random identifier and a second request frequency.
That is to say, when the random collision occurs, the server may enable the terminal to be identified to regenerate the second identifier obtaining request by returning a regenerated identifier obtaining request instruction to the terminal to be identified. The second identifier acquisition request carries a second random identifier and a second request frequency M, and the initial value of M is 1; and in a set time interval, if the terminal to be identified does not receive the terminal identifier which is returned by the server and is used for uniquely identifying the terminal to be identified, updating the request times M carried in the second identifier acquisition request to be M +1, re-sending the updated second identifier acquisition request to the server, and entering the next set time interval until the terminal identifier returned by the server is received.
Fig. 2 shows a second implementation flow diagram of an identifier allocation method provided in an embodiment of the present invention, where the method is executed by a terminal to be identified, and is suitable for a situation where a terminal identifier needs to be obtained from a server, and includes steps 201 to 202. The terminal to be identified can be a mobile phone, a computer, an intelligent watch, an air conditioner, a washing machine and other terminals needing terminal identification distribution.
In step 201, generating a first random identifier, and sending a first identifier obtaining request to a server, where the first identifier obtaining request carries the first random identifier and a first request number N, and an initial value of N is 1;
in step 202, within a set time interval, if a terminal identifier for uniquely identifying the terminal to be identified, which is returned by the server, is not received, the first request frequency N carried in the first identifier obtaining request is updated to be N +1, the updated first identifier obtaining request is sent to the server again, and the next set time interval is entered until the terminal identifier returned by the server is received.
In the embodiment of the invention, when the terminal is produced, the terminal identification is not distributed, but when the terminal is used, the terminal sends the first identification acquisition request to the server, so that the server distributes the terminal identification to the terminal according to the first identification acquisition request.
The first identifier obtaining request carrying a first random identifier generated by the terminal to be identified and the first request times means that: when a terminal to be identified communicates with a server, firstly, a random identifier is randomly generated and used for the server to identify the terminal to be identified; in addition, in order to avoid random collision, when sending the first identifier obtaining request to the server, the first identifier obtaining request needs to carry the first request times for identifying the sending times of the first identifier obtaining request.
It should be noted that, as the number of terminal nodes in the network increases, the amount of data received by the server increases. In order to avoid that a first identifier acquisition request sent by a terminal to a server can be accurately received by the server, the terminal to be identified needs to send the first identifier acquisition request to the server again at set time intervals under the condition that a terminal identifier returned by the server is not acquired, so that a plurality of first identifier acquisition requests with the same first random identifier exist in the first identifier acquisition request received by the server, and therefore, in order to distinguish the plurality of first identifier acquisition requests with the same first random identifier, and to avoid random collision, each first identifier acquisition request also needs to carry request times, and each time the terminal sends the first identifier acquisition request to the server again, the request times carried in the first identifier acquisition request are increased once.
The random collision is a situation that at least two first identifier acquisition requests with the same first random identifier number of times exist in the first identifier acquisition requests with the same first random identifier.
For example, the terminal a and the terminal B generate the same first random identifier 0001, at this time, the terminal a and the terminal B send first identifier obtaining requests carrying the first random identifier 0001 and having a request frequency of 1 to the server, and when the server receives the first identifier obtaining requests sent by the terminal a and the terminal B, because the first identifier obtaining requests sent by the terminal a and the terminal B are completely the same, the server cannot identify which first identifier obtaining request is sent by the terminal a and which first identifier obtaining request is sent by the terminal B, which is called that the terminal a and the terminal B have a random collision. When a random collision occurs, the server may return the same terminal identifier to the terminal a and the terminal B simultaneously according to the same first identifier obtaining request, that is, the terminal identifier is not unique, and therefore, the request times need to be carried in the first identifier obtaining request to determine whether a random collision occurs between the terminals to be identified, and when a random collision occurs, the server returns the same terminal identifier to different terminals simultaneously according to the same first identifier obtaining request.
In the embodiment of the present invention, the random identifier may be a terminal identifier generated by the terminal to be identified within a fixed numerical range.
For example, if the terminal identifier is a 48-byte MAC address and a manufacturer of the terminal purchases 100 ten thousand MAC addresses, 1 ten thousand consecutive MAC addresses may be taken out as a random identifier, and one of the 1 ten thousand consecutive MAC addresses is randomly generated as the random identifier when the terminal to be identified sends the first identifier obtaining request to the server, so that the server can identify the terminal to be identified.
In the embodiment of the present invention, the terminal identifier may be not only a MAC address, but also a terminal identifier that uniquely identifies a terminal, such as an IMSI, an IMEI, an IP address, a terminal serial number, and the like.
Optionally, as shown in fig. 3, a third implementation flow diagram of an identifier allocation method provided in the embodiment of the present application is shown, where the method further defines how to obtain a terminal identifier when a random collision occurs on the basis of the method described in fig. 2. The identification assignment method includes steps 301 to 304.
In step 301, a first random identifier is generated, and a first identifier obtaining request is sent to a server, where the first identifier obtaining request carries the first random identifier and a first request number N, and an initial value of N is 1.
In step 302, a regenerated identifier obtaining request instruction sent by the server is received.
In step 303, a second identifier obtaining request is generated according to the regenerated identifier obtaining request instruction, where the second identifier obtaining request carries a second random identifier and a second request number M, and an initial value of M is 1.
In step 304, within a set time interval, if a terminal identifier for uniquely identifying the terminal to be identified, which is returned by the server, is not received, the request frequency M carried in the second identifier obtaining request is updated to M +1, the updated second identifier obtaining request is sent to the server again, and the next set time interval is entered until the terminal identifier returned by the server is received.
That is to say, when the random collision occurs, the server returns a regenerated identifier acquisition request instruction to the terminal to be identified, so that the terminal to be identified can regenerate the second identifier acquisition request to re-acquire the terminal identifier.
It should be understood that, the size of each serial number in the foregoing embodiment does not mean the execution sequence, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present invention.
As shown in fig. 4, which is a schematic view of a first structure of an identifier assigning apparatus provided in an embodiment of the present invention, the identifier assigning apparatus 40 is configured in a server, and can be implemented by software, hardware, or a combination of software and hardware, and includes: a receiving module 41, a determining module 42 and an identifying module 43.
A receiving module 41, configured to receive a first identifier obtaining request sent by a terminal to be identified, where the first identifier obtaining request carries a first random identifier and a first request frequency generated by the terminal to be identified;
a determining module 42, configured to determine whether the first identifier obtaining request is valid according to the first random identifier and the first request frequency;
an identification module 43, configured to return a terminal identifier for uniquely identifying the terminal to be identified to the terminal to be identified if the first identifier obtaining request is valid.
The determining module 42 is specifically configured to detect whether there are at least two first identifier obtaining requests with the same first random identifier and the same first request times; if at least two first identifier acquisition requests with the same first request times exist in the first identifier acquisition requests with the same first random identifier, determining that the first identifier acquisition requests are invalid; and if the first identifier acquisition requests with the same first random identifier do not have the first identifier acquisition requests with the same first request times, determining that the first identifier acquisition requests are valid.
The identification module 43 is specifically configured to, if the first identifier obtaining request is valid, return a terminal medium access control address MAC for uniquely identifying the terminal to be identified to the terminal to be identified.
The identifier allocating apparatus 40 may further include an instruction sending unit, configured to return a regenerated identifier obtaining request instruction to the terminal to be identified if the first identifier obtaining request is invalid, so that the terminal to be identified generates a second identifier obtaining request according to the regenerated identifier obtaining request instruction, where the second identifier obtaining request carries a second random identifier and a second request number.
It should be noted that, for the specific working process of the identifier allocating apparatus 40, reference may be made to the corresponding process of the identifier allocating method shown in fig. 1, which is not described herein again.
As shown in fig. 5, which is a second schematic structural diagram of an identifier allocating apparatus provided in an embodiment of the present invention, the identifier allocating apparatus 50 is configured in a terminal to be identified, and may be implemented by software, hardware, or a combination of software and hardware, and includes: a generation module 51 and an identification module 52.
A generating module 51, configured to generate a random identifier, and send a first identifier obtaining request to a server, where the first identifier obtaining request carries the first random identifier and a first request number N, and an initial value of N is 1;
and the identification module 52 is configured to, within a set time interval, if a terminal identifier returned by the server and used for uniquely identifying the terminal to be identified is not received, update the first request frequency N carried in the first identifier obtaining request to be N +1, resend the updated first identifier obtaining request to the server, and enter a next set time interval until the terminal identifier returned by the server is received.
Optionally, the identifier allocating apparatus 50 further includes an identifier sub-module, configured to receive a regenerated identifier obtaining request instruction sent by the server; generating a second identifier acquisition request according to the identifier re-generation acquisition request instruction, wherein the second identifier acquisition request carries a second random identifier and a second request frequency M, and the initial value of M is 1; and in a set time interval, if a terminal identifier which is returned by the server and is used for uniquely identifying the terminal to be identified is not received, updating the request times M carried in the second identifier obtaining request to be M +1, re-sending the updated second identifier obtaining request to the server, and entering the next set time interval until the terminal identifier returned by the server is received.
It should be noted that, for the specific working process of the identifier allocating apparatus 50, reference may be made to the corresponding processes of the identifier allocating methods shown in fig. 2 to fig. 3, which are not described herein again.
Fig. 6 is a schematic diagram of a terminal according to an embodiment of the present invention. The terminal 60 includes: a processor 61, a memory 62 and a computer program 63, e.g. an identity assignment program, stored in said memory 62 and executable on said processor 61. The processor 61, when executing the computer program 63, implements the functions of the various modules/units in the various device embodiments described above, such as the functions of the modules 41 to 43 shown in fig. 4.
The computer program may be divided into one or more modules/units, which are stored in the memory 62 and executed by the processor 61 to accomplish the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the terminal. For example, the computer program may be partitioned into a receiving module, a determining module, and an identifying module. The specific functions of each module are as follows: the receiving module is used for receiving a first identifier obtaining request sent by a terminal to be identified, wherein the first identifier obtaining request carries a first random identifier and a first request frequency generated by the terminal to be identified; a determining module, configured to determine whether the first identifier obtaining request is valid according to the first random identifier and the first request frequency; and the identification module is used for returning a terminal identification for uniquely identifying the terminal to be identified to the terminal to be identified if the first identification acquisition request is valid.
The terminal may be the above-described terminal to be identified, or may be the above-described server. The terminal may include, but is not limited to, a processor 61, a memory 62. Those skilled in the art will appreciate that fig. 6 is only an example of a terminal and is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or different components, e.g., the terminal may also include input-output devices, network access devices, buses, etc.
The Processor 61 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 62 may be an internal storage unit of the terminal, such as a hard disk or a memory of the terminal. The memory 62 may also be an external storage device of the terminal, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal. Further, the memory 62 may also include both an internal storage unit and an external storage device of the terminal. The memory 62 is used for storing the computer program and other programs and data required by the terminal. The memory 62 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal and method may be implemented in other ways. For example, the above-described apparatus/terminal embodiments are merely illustrative, and for example, the division of the modules or units is only one type of logical function division, and other division manners may exist in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (8)

1. An identifier allocation method applied to a server is characterized by comprising the following steps:
receiving a first identifier acquisition request sent by a terminal to be identified, wherein the first identifier acquisition request carries a first random identifier and a first request frequency generated by the terminal to be identified;
determining whether the first identifier acquisition request is valid or not according to the first random identifier and the first request times;
if the first identification obtaining request is effective, returning a terminal identification for uniquely identifying the terminal to be identified to the terminal to be identified; the determining whether the first identifier obtaining request is valid according to the first random identifier and the first request times includes:
detecting whether at least two first identifier acquisition requests with the same first request times exist in first identifier acquisition requests with the same first random identifier;
if at least two first identifier acquisition requests with the same first request times exist in the first identifier acquisition requests with the same first random identifier, determining that the first identifier acquisition requests are invalid;
and if the first identifier acquisition requests with the same first random identifier do not have the first identifier acquisition requests with the same first request times, determining that the first identifier acquisition requests are valid.
2. The identifier allocation method according to claim 1, wherein if the first identifier obtaining request is valid, returning a terminal identifier for uniquely identifying the terminal to be identified to the terminal to be identified, includes:
and if the first identification obtaining request is valid, returning a terminal medium access control address MAC for uniquely identifying the terminal to be identified to the terminal to be identified.
3. The method for allocating identities according to claim 1 or 2, wherein, after determining whether the first identity obtaining request is valid according to the first random identity and the first number of requests, the method comprises:
if the first identifier obtaining request is invalid, returning a regenerated identifier obtaining request instruction to the terminal to be identified, so that the terminal to be identified generates a second identifier obtaining request according to the regenerated identifier obtaining request instruction, wherein the second identifier obtaining request carries a second random identifier and a second request frequency.
4. An identifier allocation method is applied to a terminal to be identified, and is characterized by comprising the following steps:
generating a first random identifier, and sending a first identifier acquisition request to a server, wherein the first identifier acquisition request carries the first random identifier and a first request frequency N, and the initial value of the N is 1;
within a set time interval, if a terminal identifier which is returned by a server and is used for uniquely identifying the terminal to be identified is not received, updating the first request times N carried in the first identifier obtaining request to be N +1, sending the updated first identifier obtaining request to the server again, and entering the next set time interval until the terminal identifier returned by the server is received;
the identification allocation method further comprises the following steps:
receiving a regenerated identifier acquisition request instruction sent by a server when the first identifier acquisition request is determined to be valid; wherein the server, in determining whether the first identifier obtaining request is valid, comprises: detecting whether at least two first identifier acquisition requests with the same first request times exist in first identifier acquisition requests with the same first random identifier; if at least two first identifier acquisition requests with the same first request times exist in the first identifier acquisition requests with the same first random identifier, determining that the first identifier acquisition requests are invalid; if first identification acquisition requests with the same first random identification do not exist in the first identification acquisition requests with the same first request times, determining that the first identification acquisition requests are valid;
generating a second identifier acquisition request according to the regenerated identifier acquisition request instruction, wherein the second identifier acquisition request carries a second random identifier and a second request frequency M, and the initial value of M is 1;
and in a set time interval, if a terminal identifier which is returned by the server and is used for uniquely identifying the terminal to be identified is not received, updating the request times M carried in the second identifier obtaining request to be M +1, re-sending the updated second identifier obtaining request to the server, and entering the next set time interval until the terminal identifier returned by the server is received.
5. An identifier assigning apparatus configured to a server, comprising:
the receiving module is used for receiving a first identifier obtaining request sent by a terminal to be identified, wherein the first identifier obtaining request carries a first random identifier and a first request frequency generated by the terminal to be identified;
a determining module, configured to determine whether the first identifier obtaining request is valid according to the first random identifier and the first request frequency; wherein, the determining whether the first identifier obtaining request is valid according to the first random identifier and the first request times includes: detecting whether at least two first identifier acquisition requests with the same first request times exist in first identifier acquisition requests with the same first random identifier; if at least two first identifier acquisition requests with the same first request times exist in the first identifier acquisition requests with the same first random identifier, determining that the first identifier acquisition requests are invalid; if the first identifier obtaining requests with the same first random identifier do not have the first identifier obtaining requests with the same first request times, determining a valid identifier module of the first identifier obtaining requests, and returning a terminal identifier for uniquely identifying the terminal to be identified to the terminal to be identified if the first identifier obtaining requests are valid.
6. An identifier assigning apparatus configured to a terminal to be identified, comprising:
the generation module is used for generating a first random identifier and sending a first identifier acquisition request to a server, wherein the first identifier acquisition request carries the first random identifier and a first request frequency N, and the initial value of the N is 1;
the identification module is used for updating the first request times N carried in the first identifier acquisition request to be N +1 if a terminal identifier which is returned by the server and is used for uniquely identifying the terminal to be identified is not received within a set time interval, re-sending the updated first identifier acquisition request to the server, and entering the next set time interval until the terminal identifier returned by the server is received;
the identifier distribution device further comprises an identifier submodule used for receiving a regenerated identifier acquisition request instruction sent by the server when the first identifier acquisition request is determined to be valid; generating a second identifier acquisition request according to the identifier re-generation acquisition request instruction, wherein the second identifier acquisition request carries a second random identifier and a second request frequency M, and the initial value of M is 1; within a set time interval, if a terminal identifier which is returned by the server and is used for uniquely identifying the terminal to be identified is not received, updating the request times M carried in the second identifier obtaining request to be M +1, sending the updated second identifier obtaining request to the server again, and entering the next set time interval until the terminal identifier returned by the server is received;
wherein the server, in determining whether the first identifier obtaining request is valid, comprises: detecting whether at least two first identifier acquisition requests with the same first request times exist in first identifier acquisition requests with the same first random identifier; if at least two first identifier acquisition requests with the same first request times exist in the first identifier acquisition requests with the same first random identifier, determining that the first identifier acquisition requests are invalid; and if the first identifier acquisition requests with the same first random identifier do not have the first identifier acquisition requests with the same first request times, determining that the first identifier acquisition requests are valid.
7. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1-4 when executing the computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a method according to any one of claims 1 to 4.
CN201810561682.1A 2018-05-31 2018-05-31 Identification distribution method, device, terminal and computer readable storage medium Active CN108834130B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810561682.1A CN108834130B (en) 2018-05-31 2018-05-31 Identification distribution method, device, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810561682.1A CN108834130B (en) 2018-05-31 2018-05-31 Identification distribution method, device, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108834130A CN108834130A (en) 2018-11-16
CN108834130B true CN108834130B (en) 2022-09-02

Family

ID=64143408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810561682.1A Active CN108834130B (en) 2018-05-31 2018-05-31 Identification distribution method, device, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108834130B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111935726B (en) * 2020-07-10 2022-06-21 展讯半导体(成都)有限公司 Communication processing method, master node, slave node, storage medium and system
CN111935728B (en) * 2020-07-10 2022-08-19 展讯半导体(成都)有限公司 Handshaking method, device, related equipment, storage medium and system
CN114301869A (en) * 2021-12-17 2022-04-08 珠海迈科智能科技股份有限公司 Method, system and storage medium for dynamically allocating equipment ID

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043401A (en) * 2006-03-23 2007-09-26 华为技术有限公司 Method for distributing and updating network service flow identification
CN101166129A (en) * 2006-10-20 2008-04-23 华为技术有限公司 Method, terminal, device and system for obtaining application server identifier information
CN101510808A (en) * 2009-02-20 2009-08-19 北大方正集团有限公司 Method and device for determining multimedia file identification
CN104468207A (en) * 2014-11-28 2015-03-25 北京奇虎科技有限公司 Terminal management method, device and system
CN104954468A (en) * 2015-06-18 2015-09-30 小米科技有限责任公司 Resource allocation method and resource allocation device
CN105915510A (en) * 2016-04-12 2016-08-31 北京小米移动软件有限公司 Method and device for controlling service traffic
CN106708553A (en) * 2016-06-20 2017-05-24 腾讯科技(深圳)有限公司 Identifier generation method, device and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4176655B2 (en) * 2004-02-24 2008-11-05 株式会社エヌ・ティ・ティ・ドコモ Address dynamic allocation system, relay apparatus, and address dynamic allocation method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043401A (en) * 2006-03-23 2007-09-26 华为技术有限公司 Method for distributing and updating network service flow identification
CN101166129A (en) * 2006-10-20 2008-04-23 华为技术有限公司 Method, terminal, device and system for obtaining application server identifier information
CN101510808A (en) * 2009-02-20 2009-08-19 北大方正集团有限公司 Method and device for determining multimedia file identification
CN104468207A (en) * 2014-11-28 2015-03-25 北京奇虎科技有限公司 Terminal management method, device and system
CN104954468A (en) * 2015-06-18 2015-09-30 小米科技有限责任公司 Resource allocation method and resource allocation device
CN105915510A (en) * 2016-04-12 2016-08-31 北京小米移动软件有限公司 Method and device for controlling service traffic
CN106708553A (en) * 2016-06-20 2017-05-24 腾讯科技(深圳)有限公司 Identifier generation method, device and system

Also Published As

Publication number Publication date
CN108834130A (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN111371638B (en) Intelligent equipment testing method and device, server and storage medium
CN108834130B (en) Identification distribution method, device, terminal and computer readable storage medium
CN107980241B (en) Gateway multi-connection method and device
CN111683118B (en) Block chain-based consensus method and device, master node equipment and slave node equipment
CN106789498B (en) Network address allocation method of Modbus communication network, slave node equipment and communication system
CN111182659B (en) Mode switching method and mode switching device of Mesh equipment and Mesh equipment
CN105991363B (en) Monitoring processing method and device
CN104113435A (en) Method and device for generating identifier
CN103813481A (en) Intelligent terminal device and business processing method thereof
CN111510326A (en) Master-slave equipment configuration information synchronization method, system, terminal equipment and storage medium
CN111065090A (en) Method for establishing network connection and wireless routing equipment
CN112737845A (en) Binding method and device of intelligent equipment, storage medium and electronic device
CN110708400B (en) Network address allocation method, device, node equipment and storage medium
EP3128715A1 (en) Resource creation method and apparatus
CN113179338A (en) Communication method, electronic device, and storage medium
CN109981813A (en) Message processing method and device
CN113660353B (en) Method, device, equipment and medium for managing Provisioner address based on Bluetooth Mesh
CN112995900B (en) SIM card distribution method, device, server and computer readable storage medium
CN112688870B (en) Routing method, routing device and node equipment
CN104298596A (en) Random distribution method and device for test scheme and server
CN104219258A (en) Method and system of real-time query of number attribution as well as terminal and server
CN111866122A (en) Micro-service processing method and device and client terminal
CN111679909A (en) Data processing method and device and terminal equipment
CN113676985A (en) Terminal access control method, device, system, terminal and electronic equipment
CN115174525B (en) Equipment IP address allocation method and device

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