CN113905014A - Method, server and storage medium for assigning ID number to terminal device - Google Patents

Method, server and storage medium for assigning ID number to terminal device Download PDF

Info

Publication number
CN113905014A
CN113905014A CN202111007918.5A CN202111007918A CN113905014A CN 113905014 A CN113905014 A CN 113905014A CN 202111007918 A CN202111007918 A CN 202111007918A CN 113905014 A CN113905014 A CN 113905014A
Authority
CN
China
Prior art keywords
pool
fetching
record
thread
numbers
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.)
Granted
Application number
CN202111007918.5A
Other languages
Chinese (zh)
Other versions
CN113905014B (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.)
Lakala Payment Co ltd
Original Assignee
Lakala Payment 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 Lakala Payment Co ltd filed Critical Lakala Payment Co ltd
Priority to CN202111007918.5A priority Critical patent/CN113905014B/en
Priority claimed from CN202111007918.5A external-priority patent/CN113905014B/en
Publication of CN113905014A publication Critical patent/CN113905014A/en
Application granted granted Critical
Publication of CN113905014B publication Critical patent/CN113905014B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/30Managing network names, e.g. use of aliases or nicknames
    • H04L61/3015Name registration, generation or assignment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a method, a server and a storage medium for distributing an ID number to terminal equipment, wherein the method comprises the following steps: dividing a preset number of ID numbers to be allocated stored in a first ID number pool into a plurality of ID number groups; respectively assigning different ID number groups in the first ID number pool for each number fetching thread, wherein the number fetching thread is used for fetching ID numbers from the corresponding ID number groups; and responding to a number fetching request of the number fetching thread, and fetching an ID number from the ID number group of the first ID number pool corresponding to the number fetching thread, wherein the fetched ID number is used for being distributed to the terminal equipment.

Description

Method, server and storage medium for assigning ID number to terminal device
Technical Field
The invention relates to the technical field of science and technology finance, in particular to a method, a server and a storage medium for distributing an ID number to terminal equipment.
Background
In a payment service scene, a large number of merchants use POS machines to conduct card swiping or code scanning transactions with consumers, each POS machine device corresponds to at least one terminal ID number, the terminal ID number is used as a unique identification of the associated payment transaction, and information such as specific merchants, legal persons of the merchants and the like can be located according to the terminal ID number. Therefore, the terminal ID number becomes a key terminal resource information in the payment institution. Since the Unionpay stipulates that the terminal ID number can only be 8-digit characters in payment transaction, the terminal ID number becomes a limited resource, is difficult to reproduce and has the characteristic of non-reusability.
In the prior art, a distributed ID number distribution method adopts a Snowflake algorithm (Snowflake), wherein an ID number generated by the Snowflake algorithm consists of a timestamp, a working thread number and a serial number, and the timestamp part has a length of 41 bits and can be accurate to millisecond level; the number part of the working thread is 10bit in length and can be formed by combining a machine room, a machine and a machine thread; the sequence number part is 12bit length, and the self-increasing sequence number is generated in one millisecond in the same working thread. The snowflake algorithm can efficiently generate a globally unique ID number, but due to its algorithmic nature, the generated number segments are not continuous and the number difference between each second is large. On one hand, the length of the ID number generated by the snowflake algorithm does not accord with the rule of Unionpay, and on the other hand, the terminal ID number is a limited resource, each number is a non-renewable resource and the terminal ID number is used according to the principle that one number cannot be wasted. Therefore, the distributed ID number generation scheme, which represents the span discontinuity, using the snowflake algorithm is not suitable for terminal ID number generation.
Another ID number assignment method in the prior art is based on serial numbers of a database, and although this scheme does not waste numbers, once switching of the database is involved, the numbers will be seriously affected, and even complete and smooth migration cannot be performed.
In the prior art, a method for generating a globally unique serial number by using middleware also exists, for example, an INCR command of Redis is used, and a ZooKeeper is used to construct a distributed lock, but a large number of nodes and multiple processes under concurrency are delayed when acquiring a shared lock, so that the method is not efficient in generating the serial number.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, a server, and a storage medium for allocating an ID number to a terminal device, so as to solve the technical problems in the prior art that the ID number is wasted and the number fetching efficiency is low.
According to a first aspect, an embodiment of the present invention provides a method for assigning an ID number to a terminal device, including: dividing a preset number of ID numbers to be allocated stored in a first ID number pool into a plurality of ID number groups; respectively assigning different ID number groups in the first ID number pool for each number fetching thread, wherein the number fetching thread is used for fetching ID numbers from the corresponding ID number groups; and responding to a number fetching request of the number fetching thread, and fetching an ID number from the ID number group of the first ID number pool corresponding to the number fetching thread, wherein the fetched ID number is used for being distributed to the terminal equipment.
Optionally, after the ID number is fetched from the ID number group in the first ID number pool corresponding to the number fetching thread, the method further includes: judging whether the ID number to be distributed still exists in the ID number group of the number to be fetched; and when no ID number to be allocated exists in the numbered ID number group, assigning a new ID number group of the first ID number pool to the number taking thread corresponding to the numbered ID number group.
Optionally, the step of fetching an ID number from the ID number group of the first ID number pool corresponding to the number fetching thread includes: and modifying the state corresponding to the extracted ID number into the allocated state.
Optionally, the method further comprises: when a preset rule is met, the first ID number pool is disabled, and a second ID number pool is enabled; dividing a predetermined number of ID numbers to be allocated stored in a second ID number pool into a plurality of ID number groups; respectively assigning different ID number groups in the second ID number pool for each number fetching thread, wherein the number fetching threads are used for fetching ID numbers from the corresponding ID number groups; and responding to a number fetching request of the number fetching thread, and fetching an ID number from the ID number group of the second ID number pool corresponding to the number fetching thread, wherein the fetched ID number is used for being distributed to the terminal equipment.
Optionally, after the deactivating the first ID number pool, the method further comprises: clearing the allocated ID number in the first ID number pool; and supplementing the first ID number pool with a new ID number to be allocated.
Optionally, after supplementing the first ID number pool with a new ID number to be allocated, the method further includes: and when the preset rule is satisfied again, the second ID number pool is deactivated, and the first ID number pool is activated.
According to a second aspect, an embodiment of the present invention provides a method for assigning an ID number to a terminal device, including: storing a preset number of ID records in a first ID number pool, wherein each ID record comprises an ID number to be distributed and a corresponding serial number, and the serial numbers are continuous; dividing the ID records into a plurality of ID record sequences according to the serial number of each ID record; respectively assigning different ID record sequences in the first ID number pool for each number taking thread, wherein the number taking thread is used for taking out the ID numbers from the corresponding ID record sequences; and responding to a number fetching request of the number fetching thread, sequentially fetching numbers from the ID record sequence of the first ID number pool corresponding to the number fetching thread, wherein the fetched ID numbers are used for being distributed to the terminal equipment.
Optionally, after sequentially fetching numbers from the ID record sequence of the first ID number pool corresponding to the number fetching thread, the method further includes: judging whether the ID record of the number is the last ID record of the ID record sequence according to the serial number of the ID record of the number; and when the numbered ID record is the last ID record of the located ID record sequence, assigning a new ID record sequence of the first ID number pool to the number taking thread corresponding to the numbered ID record.
Optionally, the method further comprises: when a preset rule is met, the first ID number pool is disabled, and a second ID number pool is enabled; dividing a predetermined number of ID records stored in the second ID number pool into a plurality of ID record sequences according to the serial number of each ID record; respectively assigning different ID record sequences in the second ID number pool for each number taking thread, wherein the number taking thread is used for taking out ID numbers from the corresponding ID record sequences; and responding to a number fetching request of the number fetching thread, sequentially fetching numbers from the ID record sequence of the second ID number pool corresponding to the number fetching thread, wherein the fetched ID numbers are used for being distributed to the terminal equipment.
Optionally, the method further comprises: clearing ID records of the assigned ID numbers in the first ID number pool, and numbering the remaining ID records of the ID numbers to be assigned in the first ID number pool again in sequence; and supplementing a new ID record for the first ID number pool, wherein the new ID record comprises a new ID number to be allocated and is a sequence number of the new ID record, and the sequence number of the new ID record is next to the sequence number of the last ID record which is numbered in the first ID number pool in a re-sequence manner.
According to a third aspect, an embodiment of the present invention provides a server, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor performing the method of any of the first and second aspects by executing the computer instructions.
According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the method of any one of the first and second aspects.
According to the method, the server and the storage medium for allocating the ID numbers to the terminal equipment, the ID numbers to be allocated are divided into a plurality of ID number groups, different ID number groups are respectively assigned to each number taking thread, and each number taking thread takes numbers in the assigned ID number groups, so that the number is not wasted compared with the scheme that the ID numbers are generated by the traditional snowflake algorithm; compared with the existing scheme of generating the global unique serial number by utilizing the middleware, the situation that a plurality of number taking threads contend for the same ID number cannot occur, so that the phenomenon of repeated number taking is avoided without adopting a distributed lock, the process of locking and releasing the lock required by the distributed lock is avoided, the number taking can be realized by the plurality of number taking threads, and the number taking efficiency is improved.
According to the method, the server and the storage medium for allocating the ID number to the terminal equipment, the first ID number pool and the second ID number pool which are mutually active and standby are adopted, when the preset rule is met, the number fetching thread is seamlessly switched from the first ID number pool to the second ID number pool for fetching the number, and the number fetching interruption caused by the fact that the ID number in the first ID number pool is completely fetched is avoided. And in the period of the first ID number pool being stopped, the first ID number pool is supplemented with a new ID number to be allocated, so that when the second ID number pool is started to reach the preset rule, the second ID number pool is stopped and the first ID number pool is started, thereby realizing continuous number taking without interruption.
According to the method, the server and the storage medium for allocating the ID numbers to the terminal equipment, the serial numbers of the ID numbers to be allocated are also sequentially numbered, so that the number fetching thread can sequentially fetch the numbers from the corresponding ID recording sequence of the first ID number pool, a system does not need to delete one ID record every time one ID number is fetched, and the state information of the ID numbers in the ID recording sequence does not need to be acquired, thereby further improving the number fetching speed.
Drawings
The features and advantages of the present invention will be more clearly understood by reference to the accompanying drawings, which are illustrative and not to be construed as limiting the invention in any way, and in which:
fig. 1 shows a flow chart of a method for assigning an ID number to a terminal device according to an embodiment of the invention;
FIG. 2 shows a schematic diagram of a table employed in the method shown in FIG. 1;
fig. 3 shows a flow chart of a method for assigning an ID number to a terminal device according to another embodiment of the invention;
FIG. 4 shows a schematic diagram of a table employed in the method shown in FIG. 3;
fig. 5 shows a flow chart of a method for assigning an ID number to a terminal device according to another embodiment of the present invention;
FIG. 6 shows a schematic diagram of a table employed in the method shown in FIG. 5;
fig. 7 shows a flowchart of a method for assigning an ID number to a terminal device according to another embodiment of the present invention;
FIG. 8 shows a schematic diagram of a table employed in the method shown in FIG. 7;
fig. 9 is a diagram illustrating an apparatus for assigning an ID number to a terminal device according to an embodiment of the present invention;
fig. 10 is a diagram showing an apparatus for assigning an ID number to a terminal device according to another embodiment of the present invention;
FIG. 11 shows a schematic diagram of a server according to an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 shows a method for assigning an ID number to a terminal device, which may be used to assign terminal ID numbers to various terminal devices, such as POS machines and the like, according to an embodiment of the present invention, which may include the steps of:
s101, dividing a preset number of ID numbers to be allocated stored in the first ID number pool into a plurality of ID number groups.
The number of ID numbers to be assigned can be reasonably determined by those skilled in the art according to practical situations, for example, if the number of ID numbers assigned in a day is estimated to be in the order of millions, the predetermined number can be set to 1000 ten thousands to meet the ID number assignment requirement in a day. In an alternative embodiment, as shown in fig. 2, the ID number pool may be, for example, a Table (Table), which is an object for storing data in a database, each column in the Table is designed to store a certain type of information, and in the Table of fig. 2, the first column stores the ID numbers to be assigned.
As an alternative, the second column of the table stores status information, for example, two numbers of 0 and 1 may be used to indicate the status of the ID number, for example, when the status information is 0, the status of the corresponding ID number is to be assigned or valid, and when the status information is 1, the status of the corresponding ID number is assigned or invalid. It will be understood by those skilled in the art that any character may be employed to represent the state of the corresponding ID number, and is not limited to 0 and 1 in the above example.
Although two columns of data are shown in the table of fig. 2, the embodiment of the present invention is not limited thereto, and the table may further include a column for storing ID number entry time and a column for ID number retrieval time to help statistically analyze the assignment of ID numbers. For example, according to the data of the column of the time when the ID number is taken out, it can be counted that the frequency of the number taking request is higher in some time periods, and in order to improve the user experience, more system resources can be allocated to the number taking request in a high-frequency time period; it can also be counted that the frequency of the number-taking request is low in some time periods, and then less system resources can be allocated to the number-taking request in the low-frequency time period, so as to reduce the operation cost.
In an alternative embodiment, 1000 ID numbers may be grouped, the ID numbers to be assigned are divided into several ID number groups, and when the predetermined number is 1000 ten thousand, the ID numbers to be assigned stored in the first ID number pool may be divided into 1 ten thousand ID number groups. It will be understood by those skilled in the art that the ID numbers to be assigned contained within the respective ID number groups may be the same or different.
S102, different ID number groups in the first ID number pool are respectively assigned to each number taking thread.
In order to satisfy the request of allocating terminal ID numbers to a large number of terminal devices, a plurality of number taking servers may be used to satisfy the request, each number taking server is a number taking thread, different ID number groups in the first ID number pool are respectively assigned to each number taking thread, and each number taking thread respectively takes out an ID number from a corresponding ID number group so as to allocate a terminal ID number to a terminal device.
For example, if there are three number taking servers, each number taking server corresponds to one number taking thread, which is a number taking thread a, a number taking thread B, and a number taking thread C, as shown in fig. 2. For example, ID number group 1 may be assigned to number taking thread a, ID number group 2 may be assigned to number taking thread B, and ID number group 3 may be assigned to number taking thread C, which each take numbers from the corresponding ID number group according to the number taking request.
In an alternative embodiment, each time the number fetching thread fetches an ID number, the data associated with that ID number may be deleted. In another alternative embodiment, the table further includes a column for storing state information by the user, and when the number fetching thread fetches an ID number, the state corresponding to the fetched ID number may be modified to be allocated.
In the prior art, when there are multiple threads that can change a variable at the same time, a distributed lock mode is usually adopted, for example, two threads can change a variable at the same time, in this case, the two threads need to contend for a ZooKeeper distributed lock, for example, a contended thread completes locking, the variable is changed and then the lock is released, another process also performs locking after monitoring that the lock is released and changes the variable, as described in the background art, this mode may cause delay, resulting in low number fetching efficiency.
In this embodiment, appoint different ID number groups respectively for every number taking thread, every number taking thread all takes a number in appointed ID number group, can not take place the condition that a plurality of number taking threads are contended to rob for same ID number, consequently need not to adopt the distributed lock among the prior art to avoid the process of locking and release lock, a plurality of number taking threads can realize getting a number simultaneously, have promoted number taking efficiency.
S103, in response to the number fetching request of the number fetching thread, the ID number is fetched from the ID number group of the first ID number pool corresponding to the number fetching thread.
And when the number taking server receives the number taking request, the number taking thread takes out the ID number from the ID number group of the corresponding first ID number pool. As described above in step S102, the ID number may be extracted by deleting the data related to the extracted ID number from the ID number pool, or by modifying the status information corresponding to the extracted ID number.
In the method for allocating the ID number to the terminal equipment, the ID number to be allocated is divided into a plurality of ID number groups, different ID number groups are respectively allocated to each number taking thread, and each number taking thread takes numbers in the allocated ID number groups, so that compared with the scheme that the ID number is generated by the conventional snowflake algorithm, the number is not wasted; compared with the existing scheme of generating the global unique serial number by utilizing the middleware, the situation that a plurality of number taking threads contend for the same ID number cannot occur, so that the phenomenon of repeated number taking is avoided without adopting a distributed lock, the process of locking and releasing the lock required by the distributed lock is avoided, the number taking can be realized by the plurality of number taking threads, and the number taking efficiency is improved.
In some optional implementations of the embodiment of the present invention, as shown in fig. 1, the method for assigning an ID number to a terminal device may further include:
s104, judging whether the ID number to be distributed still exists in the ID number group of the fetched number, executing the step S105 when the ID number to be distributed does not exist, and executing the step S106 when the ID number to be distributed exists.
After the number fetching thread in the step S103 fetches an ID number from the ID number group in the corresponding first ID number pool, the system needs to determine whether there is an ID number to be allocated in the ID number group to be fetched, and if there is an ID number to be allocated, it indicates that the ID number in the ID number group is not completely fetched, and the number fetching operation may be continued; if no ID number to be allocated exists, the ID numbers in the ID number group are completely taken out, and a new ID number group should be assigned to the number taking thread.
As described in step S103, one possible way to extract the ID number is to delete the data relating to the extracted ID number from the ID number pool, and in this case, if there is no ID number data in the ID number group, it represents that all the ID numbers in the ID number group have been extracted. Another possible way to extract the ID number is to modify the status information corresponding to the extracted ID number, in which case the system may obtain the status information of the ID numbers in the ID number group, and if the status information of all the ID numbers in the ID number group is already allocated, it represents that all the ID numbers in the ID number group are extracted.
And S105, assigning a new ID number group of the first ID number pool to the number taking thread corresponding to the ID number group to be taken.
Because the ID numbers in the numbered ID number group have been completely taken, the system needs to assign a new ID number group of the first ID number pool to the number taking thread corresponding to the numbered ID number group at this time, so that the number taking process can continue to complete the number taking operation.
As a possible implementation mode, the system can randomly assign a new ID number group for the number taking process or assign the ID number group of the next number taking process which is not assigned. However, in an extreme case, if all the ID numbers in the plurality of ID number groups are completely extracted, and if a new ID number group is randomly assigned to the number extracting process corresponding to the ID number group whose ID numbers are completely extracted or an ID number group whose number extracting process is not assigned next is assigned, there is a possibility that two or more number extracting processes are assigned to the same new ID number group in an extreme case, and there is a possibility that the number extracting is repeated when the distributed lock is not used.
Therefore, as another possible implementation manner, when different ID number groups in the first ID number pool are respectively assigned to each number taking thread in step S102, all ID number groups in the first ID number pool have an assigned relationship with each number taking thread. Still continuing the previous example, if there are three number taking processes A, B and C, and there are 9 ID number groups 1-9 in the first ID number pool, ID number groups 1-3 may be assigned for number taking process A, ID number groups 4-6 for number taking process B, and ID number groups 7-9 for number taking process C; or the ID number groups 1, 4 and 7 are assigned to the number taking process a, the ID number groups 2, 5 and 8 are assigned to the number taking process B, and the ID number groups 3, 6 and 9 are assigned to the number taking process C. After the designation, the three number fetching processes cannot generate the phenomenon of repeated number fetching.
S106, waiting for the next number fetching request.
When it is determined in step S104 that there is an ID number to be assigned in the numbered ID number group, it indicates that each number taking process can continue to take the number, or when step S105 designates a new ID number group for the number taking thread, it also indicates that each number taking process can continue to take the number, so that the system can wait for the next number taking request, and when the next number taking request comes, it returns to step S103 to continue the number taking operation.
Fig. 3 shows a method for assigning ID numbers to terminal devices according to another embodiment of the present invention, which may be used to assign terminal ID numbers to various terminal devices, such as POS machines, and unlike the embodiment shown in fig. 1, in this embodiment, two ID number pools, i.e., a first ID number pool and a second ID number pool, are used, and the two ID number pools are active and standby, and when one ID number pool is in an activated state, the other ID number pool is in a deactivated state. It should be understood by those skilled in the art that more ID number pools may be used in the embodiments of the present invention, and the activation or deactivation states of these ID number pools may be arbitrarily set, and may be configured as, for example, a master-slave, a multi-master-slave, or a multi-master-slave. For ease of understanding, the two ID number pools are taken as an example in the present embodiment for detailed description. As shown in fig. 3, the method may include the steps of:
s201, dividing a preset number of ID numbers to be allocated stored in the first ID number pool into a plurality of ID number groups, and referring to the corresponding description of the step S101 for specific contents.
It should be additionally noted that a predetermined number of ID numbers to be assigned are also stored in the second ID number pool, as shown in fig. 4, wherein the first ID number pool is in an enabled state and the second ID number pool is in a disabled state.
S202, different ID number groups in the first ID number pool are respectively assigned to each number taking thread, and the specific content refers to the corresponding description of the step S102.
S203, responding to the number taking request of the number taking thread, and taking out the ID number from the ID number group of the first ID number pool corresponding to the number taking thread, wherein the specific content refers to the corresponding description of the step S103.
And S204, when the preset rule is met, the first ID number pool is deactivated, and the second ID number pool is activated.
The preset rule may be set to be, for example, whether 0 o 'clock is reached, that is, the time when a new day starts, when 0 o' clock is reached, the first ID number pool passes through the number fetching of one day, and the unassigned ID numbers remain little and cannot be fetched continuously, so that the first ID number pool needs to be deactivated and the second ID number pool needs to be activated. At this time, the first ID number pool is in a deactivated state, and the second ID number pool is in an activated state. It will be understood by those skilled in the art that the preset rule may be set according to actual situations, for example, the ID number pool in the enabled state may be set to be enabled for a predetermined time, such as 12 hours, 24 hours, 36 hours, etc.
S205, dividing the preset number of ID numbers to be distributed stored in the second ID number pool into a plurality of ID number groups.
In step S205, the first ID number pool is in a disabled state, the second ID number pool is in an enabled state, and the number fetching process needs to fetch a number in the second ID number pool. This step is similar to the corresponding operation for the first ID number pool in step S101, and specific contents may refer to the description of step S101.
S206, different ID number groups in the second ID number pool are respectively assigned to each number taking thread, and the number taking threads are used for taking out the ID numbers from the ID number groups. This step is similar to the corresponding operation for the first ID number pool in step S102, and specific contents may refer to the description of step S102.
And S207, in response to the number fetching request of the number fetching thread, extracting the ID number from the ID number group of the second ID number pool corresponding to the number fetching thread, wherein the extracted ID number is used for being distributed to the terminal equipment. This step is similar to the corresponding operation for the first ID number pool in step S103, and specific contents may refer to the description of step S103.
In the method for allocating the ID number to the terminal device according to the embodiment of the present invention, the first ID number pool and the second ID number pool are used, and when the preset rule is satisfied, the first ID number pool is disabled and the second ID number pool is enabled, so that the number fetching thread is seamlessly switched to fetch the number from the second ID number pool. Compared with the embodiment shown in fig. 1, in the method for allocating an ID number to a terminal device in this embodiment, a first ID number pool and a second ID number pool are active and standby, and when a preset rule is satisfied, a number fetching thread is seamlessly switched from the first ID number pool to the second ID number pool to fetch a number, so that number fetching interruption caused by the fact that the ID number in the first ID number pool is completely fetched is avoided. And in the period of the first ID number pool being stopped, the first ID number pool is supplemented with a new ID number to be allocated, so that when the second ID number pool is started to reach the preset rule, the second ID number pool is stopped and the first ID number pool is started, thereby realizing continuous number taking without interruption.
As described above, as an optional implementation manner of the embodiment of the present invention, the method for assigning an ID number to a terminal device in this embodiment may further include:
s208, clearing the allocated ID number in the first ID number pool.
Since the first ID number pool has been enabled for a period of time, and part of the ID numbers therein have been assigned, in order to avoid repeated number fetching, the assigned ID numbers in the first ID number pool need to be cleared. Also, as an alternative embodiment, the system may determine whether an ID has been assigned by status information corresponding to the ID number.
S209, supplementing the first ID number pool with a new ID number to be allocated.
For example, the ID numbers to be allocated stored in the first ID number pool may be made to reach the above-mentioned predetermined number by supplementing a new ID number to be allocated for use when the first ID number pool is enabled again.
It should be noted that the above steps S208 to S209 are performed during the execution of steps S205 to S207, that is, during the period when the first ID number pool is disabled and the second ID number pool is enabled, the already assigned ID numbers of the first ID number pool are cleared and the new ID numbers to be assigned are supplemented. Since the first ID number pool is deactivated for a certain period of time, there is sufficient time to complete the above steps S208 to S209.
S210, when the preset rule is met again, the second ID number pool is deactivated, and the first ID number pool is activated.
For example, when the number reaches 0 click again, at this time, the second ID number pool performs number fetching through one day, the unallocated ID numbers are not enough to continue number fetching, and therefore the second ID number pool needs to be deactivated, and the first ID number pool is activated, so that the number fetching process continues to fetch numbers in the first ID number pool, that is, the step S201 is returned, thereby implementing seamless switching between the first ID number pool and the second ID number pool.
Fig. 5 shows a method for assigning ID numbers to terminal devices, which may be used to assign terminal ID numbers to various terminal devices, such as POS machines and the like, according to another embodiment of the present invention, which may include the steps of:
s301, a preset number of ID records are stored in the first ID number pool, each ID record comprises an ID number to be distributed and a corresponding serial number, and the serial numbers are continuous.
In this embodiment, each ID number is a string of characters, and the strings may be continuous or discontinuous. Unlike the embodiments shown in fig. 1 and 3, the method for assigning ID numbers to terminal devices of the present embodiment requires that a serial number is assigned to each ID number, respectively, the serial numbers being consecutive.
Likewise, in this embodiment, the first ID Number pool may be a table, and as shown in fig. 6, each row of ID records in the table may include a sequence Number field and an ID Number field, where a data type of the sequence Number field may be, for example, a Number (Number) type, and a data type of the ID Number field may be, for example, a character (Char/Varchar) type. In the table illustrated in fig. 6, 1000 ten thousand rows of ID records are stored, with corresponding ID number field values from a0000000 to a9999999, the ID numbers being consecutive in the example of fig. 6, which may be discontinuous as will be appreciated by those skilled in the art. Accordingly, the sequence number field value is from 0 to 9999999.
In an alternative embodiment, each row of ID records in the table may further include a status field, for example, two numbers of 0 and 1 may be used to indicate the status of the ID number, for example, when the status field value is 0, the status of the corresponding ID number is to be allocated or valid, and when the status field value is 1, the status of the corresponding ID number is allocated or invalid. It should be understood by those skilled in the art that any state field value may be employed to represent the state of the corresponding ID number, and is not limited to 0 and 1 in the above example.
Likewise, each row of ID records in the table may further include an ID number logging time field and an ID number taken time field, and the data type of the ID number logging time field and the ID number taken time field may be, for example, a time stamp (timestamp) to store a column of the ID number logging time and the ID number taken time to help in statistical analysis of the ID number allocation. Those skilled in the art can set more columns for the table according to actual conditions to store corresponding information.
S302, dividing the ID records into a plurality of ID record sequences according to the sequence number of each ID record.
For example, the ID records in fig. 6 may be divided into a plurality of ID record sequences in steps of 1000, where ID record sequence 1 includes ID records with serial numbers 0 to 999, ID record sequence 2 includes ID records with serial numbers 1000 to 1999, ID record sequence 3 includes ID records with serial numbers 2000 to 2999, and so on.
In the above example, the number of ID records included in each ID record sequence is the same, and those skilled in the art will understand that the number of ID records included in each ID record sequence may also be different.
And S303, respectively assigning different ID recording sequences in the first ID number pool for each number taking thread, wherein the number taking thread is used for taking out the ID numbers from the corresponding ID recording sequences.
Similar to the corresponding description in step S102, for example, if there are three number taking servers, each corresponding to one number taking thread, namely, number taking thread a, number taking thread B and number taking thread C, the ID record sequence 1 may be assigned to number taking thread a, the ID record sequence 2 may be assigned to number taking thread B, the ID record sequence 3 may be assigned to number taking thread C, and each number taking thread takes numbers from the assigned ID record sequence.
S304, in response to a number fetching request of the number fetching thread, sequentially fetching numbers from an ID recording sequence of a first ID number pool corresponding to the number fetching thread, wherein the fetched ID numbers are used for being distributed to the terminal equipment.
In an alternative embodiment, the number fetching threads start fetching numbers from the start ID record in the respective ID record sequence, and the number of the number fetching threads sequentially increases by 1 when the number fetching thread initiates the number fetching request again. Taking number fetching thread a as an example, when a number fetching request is initiated for the first time, number fetching is started from the initial ID record of ID record sequence 1, that is, the ID number is fetched from the ID record of serial number 0, when a number fetching request is initiated for the second time, the serial number is incremented by 1, that is, the ID number is fetched from the ID record of serial number 1, and so on.
Of course, the embodiment of the present invention is also not limited to this, and the number fetching threads may also start fetching numbers from the last ID record in the respective ID record sequences, and when the number fetching threads initiate the number fetching request again, the sequence numbers are sequentially decremented by 1.
In addition to the advantages mentioned in the embodiment shown in fig. 1, the method for allocating ID numbers to terminal devices in this embodiment is to number ID number sequences to be allocated, so that a number fetching thread can fetch numbers sequentially from corresponding ID record sequences in the first ID number pool, a system does not need to delete one ID record every time an ID number is fetched, and does not need to acquire status information of the ID numbers in the ID record sequences, thereby being capable of further increasing the number fetching speed.
In some optional implementations of the embodiment of the present invention, as shown in fig. 5, the method for assigning an ID number to a terminal device may further include:
s305, judging whether the ID record of the number is the last ID record of the ID record sequence according to the serial number of the ID record of the number, executing step S306 when the ID record is the last ID record, and executing step S307 when the ID record is not the last ID record.
Still taking the above example that the number fetching thread starts fetching numbers from the start ID record in the respective ID record sequences, and when the number fetching thread initiates the number fetching request again, the number is sequentially increased by 1, when the number fetching thread a fetches numbers in the ID record sequence 1 including the ID records with the number from 0 to 999, if the number of the ID record of the fetched number is 999, it indicates that the ID record of the fetched number is the last ID record of the specified ID record sequence, that is, the ID record sequence 1 has been completely fetched.
Similarly, when the number fetching thread fetches a number from the last ID record in each ID record sequence and the number fetching thread re-issues a number fetching request, the number is sequentially decremented by 1, and when the number fetching thread a fetches a number in the ID record sequence 1 including ID records with numbers from 0 to 999, if the number of the ID record of the fetched number is 0, it means that the ID record of the fetched number is the last ID record of the designated ID record sequence, that is, the ID record sequence 1 has been completely fetched.
Therefore, for the sequential number taking mode, the system can judge whether the ID numbers in the ID recording sequence are completely taken or not only by carrying out numerical comparison, but also does not need to check the state values of all the ID records in the ID recording sequence, thereby improving the number taking speed.
S306, a new ID record sequence of the first ID number pool is appointed for the number fetching thread corresponding to the numbered ID record.
Still following the number fetching of number fetching thread a, number fetching thread B and number fetching thread C from ID record sequence 1, ID record sequence 2 and ID record sequence 3, respectively, ID record sequence 1 comprising ID records with sequence numbers 0 to 999, ID record sequence 2 comprising ID records with sequence numbers 1000 to 1999, ID record sequence 3 comprising an example of ID records with sequence numbers 2000 to 2999, when ID record sequence 1 is fetched by number fetching thread a, number fetching thread a fetches number from ID record 4 comprising sequence numbers 3000 to 3999; when ID record sequence 2 is taken by number taking thread B, number taking thread B takes numbers from ID record sequence 5, which includes sequence numbers 4000 to 4999, and so on. That is, the number taking thread a follows the rule that the number taking thread a takes numbers (n is an integer greater than or equal to 0) from the ID record sequence of the 3n +1 th in order, the number taking thread B follows the rule that numbers (n is an integer greater than or equal to 0) from the ID record sequence of the 3n +2 th in order, and the number taking thread C follows the rule that numbers (n is an integer greater than or equal to 0) from the ID record sequence of the 3n +2 th in order. In each of the above ID record sequences, ID records having serial numbers of 1000(m-1) to 1000m-1 are included, where m is the serial number of the ID record sequence. By means of the above regulation of the number taking thread, the phenomenon of repeated number taking does not occur among the three number taking processes.
Of course, the embodiment of the present invention is not limited thereto, and those skilled in the art may also use other ways to specify a new ID record sequence.
S307, waiting for the next number fetching request.
When it is determined in step S305 that there is an ID number to be allocated in the ID record sequence of the number fetched, it indicates that each number fetching process can continue fetching the number, or when step S306 designates a new ID record sequence for the number fetching thread, it also indicates that each number fetching process can continue fetching the number, so that the system can wait for the next number fetching request, and when the next number fetching request comes, it returns to step S304 to continue the number fetching operation.
Fig. 7 shows a method for assigning ID numbers to terminal devices, which may be used to assign terminal ID numbers to various terminal devices, such as POS machines and the like, according to another embodiment of the present invention. Similar to the embodiment shown in fig. 3, in this embodiment, two ID number pools are also used, the two ID number pools are active and standby, and when one of the ID number pools is in an enabled state, the other ID number pool is in a disabled state. Similarly, it should be understood by those skilled in the art that more ID number pools may be used in the embodiment of the present invention, and two ID number pools are taken as an example in the present embodiment for detailed description. As shown in fig. 7, the method may include the steps of:
s401, storing a preset number of ID records in a first ID number pool, wherein each ID record comprises an ID number to be distributed and a corresponding serial number, and the serial numbers are continuous. In this step, as shown in fig. 8, the first ID number pool is in an enabled state, and the second ID number pool is in a disabled state, and the specific content may refer to the corresponding description in step S301.
S402, dividing the ID records into a plurality of ID record sequences according to the sequence number of each ID record. The specific content can refer to the corresponding description in step S302.
And S403, respectively assigning different ID record sequences in the first ID number pool for each number taking thread. Specific contents may refer to corresponding descriptions in step S303.
S404, in response to a number fetching request of a number fetching thread, sequentially fetching numbers from an ID recording sequence of a first ID number pool corresponding to the number fetching thread, wherein the fetched ID numbers are used for being distributed to terminal equipment. The specific content can refer to the corresponding description in step S304.
S405, when the preset rule is met, the first ID number pool is deactivated, and the second ID number pool is activated. The specific content can refer to the corresponding description in step S204.
S406, dividing the preset number of ID records stored in the second ID number pool into a plurality of ID record sequences according to the serial number of each ID record. This step is similar to the corresponding operation for the first ID number pool in step S302, and specific contents may refer to the corresponding description in step S302.
And S407, respectively assigning different ID record sequences in the second ID number pool for each number taking thread. This step is similar to the corresponding operation for the first ID number pool in step S303, and specific contents may refer to the description of step S303.
And S408, responding to the number fetching request of the number fetching thread, sequentially fetching numbers from the ID recording sequence of the second ID number pool corresponding to the number fetching thread, wherein the fetched ID numbers are used for being distributed to the terminal equipment. This step is similar to the corresponding operation for the first ID number pool in step S304, and specific contents may refer to the description of step S304.
In the method for allocating the ID number to the terminal device in this embodiment, the first ID number pool and the second ID number pool are mutually active and standby, and when the preset rule is satisfied, the number fetching thread seamlessly switches from the first ID number pool to the second ID number pool to fetch the number, thereby avoiding number fetching interruption caused by the completion of the ID number fetching in the first ID number pool. Similarly, during the period of the deactivation of the first ID number pool, the first ID number pool is supplemented with a new ID number to be allocated, so that when the activation of the second ID number pool reaches a preset rule, the second ID number pool is deactivated, and the first ID number pool is activated, thereby realizing continuous number fetching without interruption.
As described above, as an optional implementation manner of the embodiment of the present invention, the method for assigning an ID number to a terminal device in this embodiment may further include:
s409, clearing the ID records of the assigned ID numbers in the first ID number pool, and numbering the remaining ID records of the ID numbers to be assigned in the first ID number pool again in sequence.
Since the present embodiment also relates to re-numbering the remaining ID numbers to be allocated in sequence, a convenient method for executing the step S409 includes:
1) all the ID records to be assigned with ID numbers in the first ID number pool are inserted into the temporary ID number pool.
In this embodiment, all ID numbers in the first ID number pool are numbered sequentially, and the system can know the serial numbers of the ID numbers taken out by each number taking process when the first ID number pool is disabled, so that the system can quickly know the ID records in the first ID number pool to which no ID number is assigned. When the ID record is inserted into a temporary table, the serial number of the inserted ID record is sequentially re-numbered from 0.
2) And emptying data in the first ID number pool, and inserting the ID record in the temporary ID number pool into the first ID number pool.
Through the above two steps, the above step S409 can be implemented.
And S410, supplementing a new ID record for the first ID number pool, wherein the new ID record comprises a new ID number to be allocated and is sequentially numbered.
When a new ID record is replenished to the first ID number pool, the sequence number of the new ID record is immediately next to the sequence number of the last ID record that is re-sequentially numbered in the first ID number pool. The ID records stored in the first ID number pool may be made to the above-mentioned predetermined number by supplementing new ID records for use when the first ID number pool is enabled again.
It should also be noted that the above steps S409 to S410 are executed during the execution of the steps S406 to S408, that is, during the period when the first ID number pool is disabled and the second ID number pool is enabled, the clearing of the ID record of the assigned ID number of the first ID number pool and the supplementing of the new ID record are performed. Since the first ID number pool is deactivated for a certain period of time, there is sufficient time to complete the above steps S409 to S410.
S411, when the preset rule is met again, the second ID number pool is deactivated, and the first ID number pool is started. The detailed contents may refer to the corresponding description of step S210.
Correspondingly, as shown in fig. 9, an embodiment of the present invention further provides an apparatus for assigning an ID number to a terminal device, where the apparatus may be used to assign a terminal ID number to various terminal devices, where the terminal device may be, for example, a POS machine, and the apparatus may include:
a dividing unit 501, configured to divide a predetermined number of ID numbers to be allocated stored in the first ID number pool into a plurality of ID number groups. Specific contents can refer to the relevant description of step S101.
A specifying unit 502, configured to specify different ID number groups in the first ID number pool for each number fetching thread, where the number fetching thread is configured to fetch an ID number from a corresponding ID number group. The specific content can refer to the relevant description of step S102.
A number taking unit 503, configured to, in response to a number taking request of the number taking thread, take out an ID number from an ID number group of the first ID number pool corresponding to the number taking thread, where the taken out ID number is used for being allocated to the terminal device. Specific contents may refer to the related description of step S103.
According to the device for distributing the ID number to the terminal equipment, the ID number to be distributed is divided into a plurality of ID number groups, different ID number groups are respectively assigned to each number taking thread, and each number taking thread takes the number in the assigned ID number group; compared with the existing scheme of generating the global unique serial number by utilizing the middleware, the situation that a plurality of number taking threads contend for the same ID number cannot occur, so that the phenomenon of repeated number taking is avoided without adopting a distributed lock, the process of locking and releasing the lock required by the distributed lock is avoided, the number taking can be realized by the plurality of number taking threads, and the number taking efficiency is improved.
The details of each component of the apparatus for assigning an ID number to a terminal device according to the embodiment of the present invention may be understood by referring to the corresponding related descriptions and effects in the embodiments shown in fig. 1 to fig. 4, which are not described herein again.
Correspondingly, as shown in fig. 10, an embodiment of the present invention further provides an apparatus for assigning an ID number to a terminal device, where the apparatus may be used to assign a terminal ID number to various terminal devices, where the terminal device may be, for example, a POS machine, and the apparatus may include:
a storage unit 601, configured to store a predetermined number of ID records in the first ID number pool, where each ID record includes an ID number to be assigned and a corresponding serial number, and the serial numbers are consecutive. Specific contents may refer to the related description of step S301.
A dividing unit 602, configured to divide the ID records into a plurality of ID record sequences according to the sequence number of each ID record. The specific content can refer to the relevant description of step S302.
A specifying unit 603, configured to specify, for each number fetching thread, a different ID record sequence in the first ID number pool, where the number fetching thread is configured to fetch the ID number from the corresponding ID record sequence. The specific content can refer to the relevant description of step S303.
A number taking unit 604, configured to, in response to a number taking request of the number taking thread, sequentially take numbers from an ID record sequence of a first ID number pool corresponding to the number taking thread, where the taken ID numbers are used for being allocated to terminal devices. The specific content can refer to the relevant description of step S304.
The device for allocating the ID numbers to the terminal equipment, disclosed by the invention, can sequentially fetch the numbers from the corresponding ID recording sequences of the first ID number pool by the number fetching thread through sequentially numbering the ID numbers to be allocated, so that the system does not need to delete one ID record every time one ID number is fetched, and does not need to acquire the state information of the ID numbers in the ID recording sequences, thereby further improving the number fetching speed.
The details of each component of the apparatus for assigning an ID number to a terminal device according to the embodiment of the present invention may be understood by referring to the corresponding related descriptions and effects in the embodiments shown in fig. 5 to fig. 8, which are not described herein again.
As shown in fig. 11, an embodiment of the present invention further provides a server, where the server may include a processor 701 and a memory 702, where the processor 701 and the memory 702 may be connected by a bus or in another manner, and fig. 7 illustrates a connection by a bus.
Processor 701 may be a Central Processing Unit (CPU). The Processor 701 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or combinations thereof.
The memory 702, which is a non-transitory computer-readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions corresponding to the method for assigning ID numbers to terminal devices in the embodiments of the present invention, and the memory 702 may also be used to store data of the first and/or second ID number pools. The processor 701 executes various functional applications of the processor and data processing by executing non-transitory software instructions stored in the memory 702, that is, implements the method for assigning an ID number to a terminal device in the above-described method embodiments.
The memory 702 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 702 may optionally include memory located remotely from processor 701, which may be connected to processor 701 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The details of the server may be understood by referring to the corresponding descriptions and effects in the embodiments shown in fig. 1 to fig. 8, and are not described herein again.
Those skilled in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by the associated hardware as instructed by a computer program, which may be stored in a computer readable storage medium, and when executed, may include the processes of the above method embodiments. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, HDD), a Solid-State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (10)

1. A method for assigning an ID number to a terminal device, comprising:
dividing a preset number of ID numbers to be allocated stored in a first ID number pool into a plurality of ID number groups;
respectively assigning different ID number groups in the first ID number pool for each number fetching thread, wherein the number fetching thread is used for fetching ID numbers from the corresponding ID number groups;
and responding to a number fetching request of the number fetching thread, and fetching an ID number from the ID number group of the first ID number pool corresponding to the number fetching thread, wherein the fetched ID number is used for being distributed to the terminal equipment.
2. The method according to claim 1, further comprising, after said extracting an ID number from said ID number group of said first ID number pool to which said number extracting thread corresponds:
judging whether the ID number to be distributed still exists in the ID number group of the number to be fetched;
and when no ID number to be allocated exists in the numbered ID number group, assigning a new ID number group of the first ID number pool to the number taking thread corresponding to the numbered ID number group.
3. The method of claim 1 or 2, further comprising:
when a preset rule is met, the first ID number pool is disabled, and a second ID number pool is enabled;
dividing a predetermined number of ID numbers to be allocated stored in a second ID number pool into a plurality of ID number groups;
respectively assigning different ID number groups in the second ID number pool for each number fetching thread, wherein the number fetching threads are used for fetching ID numbers from the corresponding ID number groups;
and responding to a number fetching request of the number fetching thread, and fetching an ID number from the ID number group of the second ID number pool corresponding to the number fetching thread, wherein the fetched ID number is used for being distributed to the terminal equipment.
4. The method of claim 3, further comprising, after the deactivating the first ID number pool:
clearing the allocated ID number in the first ID number pool;
and supplementing the first ID number pool with a new ID number to be allocated.
5. A method for assigning an ID number to a terminal device, comprising:
storing a preset number of ID records in a first ID number pool, wherein each ID record comprises an ID number to be distributed and a corresponding serial number, and the serial numbers are continuous;
dividing the ID records into a plurality of ID record sequences according to the serial number of each ID record;
respectively assigning different ID record sequences in the first ID number pool for each number taking thread, wherein the number taking thread is used for taking out the ID numbers from the corresponding ID record sequences;
and responding to a number fetching request of the number fetching thread, sequentially fetching numbers from the ID record sequence of the first ID number pool corresponding to the number fetching thread, wherein the fetched ID numbers are used for being distributed to the terminal equipment.
6. The method according to claim 5, further comprising, after sequentially fetching numbers from the ID record sequence of the first ID number pool corresponding to the number fetching thread:
judging whether the ID record of the number is the last ID record of the ID record sequence according to the serial number of the ID record of the number;
and when the numbered ID record is the last ID record of the located ID record sequence, assigning a new ID record sequence of the first ID number pool to the number taking thread corresponding to the numbered ID record.
7. The method of claim 5 or 6, further comprising:
when a preset rule is met, the first ID number pool is disabled, and a second ID number pool is enabled;
dividing a predetermined number of ID records stored in the second ID number pool into a plurality of ID record sequences according to the serial number of each ID record;
respectively assigning different ID record sequences in the second ID number pool for each number taking thread, wherein the number taking thread is used for taking out ID numbers from the corresponding ID record sequences;
and responding to a number fetching request of the number fetching thread, sequentially fetching numbers from the ID record sequence of the second ID number pool corresponding to the number fetching thread, wherein the fetched ID numbers are used for being distributed to the terminal equipment.
8. The method of claim 7, further comprising:
clearing ID records of the assigned ID numbers in the first ID number pool, and numbering the remaining ID records of the ID numbers to be assigned in the first ID number pool again in sequence;
and supplementing a new ID record for the first ID number pool, wherein the new ID record comprises a new ID number to be allocated and is a sequence number of the new ID record, and the sequence number of the new ID record is next to the sequence number of the last ID record which is numbered in the first ID number pool in a re-sequence manner.
9. A server, comprising: a memory and a processor communicatively coupled to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the method of any of claims 1-8.
10. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of claims 1-8.
CN202111007918.5A 2021-08-27 Method, server and storage medium for assigning ID number to terminal device Active CN113905014B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111007918.5A CN113905014B (en) 2021-08-27 Method, server and storage medium for assigning ID number to terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111007918.5A CN113905014B (en) 2021-08-27 Method, server and storage medium for assigning ID number to terminal device

Publications (2)

Publication Number Publication Date
CN113905014A true CN113905014A (en) 2022-01-07
CN113905014B CN113905014B (en) 2024-05-28

Family

ID=

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116841755A (en) * 2023-09-01 2023-10-03 中国中金财富证券有限公司 Verification code information processing method and device, electronic equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150055512A1 (en) * 2013-05-31 2015-02-26 Huawei Technologies Co., Ltd. Method, apparatus, and system for allocating phone number
CN105590194A (en) * 2014-12-03 2016-05-18 中国银联股份有限公司 Offline payment method and payment system
US20170083535A1 (en) * 2015-09-22 2017-03-23 Facebook, Inc. Managing sequential data store
CN107360224A (en) * 2017-07-07 2017-11-17 携程旅游信息技术(上海)有限公司 Sequence number generation method, system, equipment and storage medium in distributed system
CN109104490A (en) * 2018-08-29 2018-12-28 北京达佳互联信息技术有限公司 Service identification management method, device, electronic equipment and storage medium
CN110750353A (en) * 2018-07-24 2020-02-04 腾讯科技(北京)有限公司 Number issuing method, number issuing device, number issuing system, and computer program medium
CN111125569A (en) * 2019-12-25 2020-05-08 北京同邦卓益科技有限公司 Data identifier generation method and device, electronic equipment and medium
CN112181306A (en) * 2020-10-10 2021-01-05 杭州电子科技大学 Method for generating distributed ID (identity) in number segment mode
CN112351110A (en) * 2020-11-27 2021-02-09 杭州安恒信息技术股份有限公司 ID distribution method and device based on zookeeper

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150055512A1 (en) * 2013-05-31 2015-02-26 Huawei Technologies Co., Ltd. Method, apparatus, and system for allocating phone number
CN105590194A (en) * 2014-12-03 2016-05-18 中国银联股份有限公司 Offline payment method and payment system
US20170083535A1 (en) * 2015-09-22 2017-03-23 Facebook, Inc. Managing sequential data store
CN107360224A (en) * 2017-07-07 2017-11-17 携程旅游信息技术(上海)有限公司 Sequence number generation method, system, equipment and storage medium in distributed system
CN110750353A (en) * 2018-07-24 2020-02-04 腾讯科技(北京)有限公司 Number issuing method, number issuing device, number issuing system, and computer program medium
CN109104490A (en) * 2018-08-29 2018-12-28 北京达佳互联信息技术有限公司 Service identification management method, device, electronic equipment and storage medium
CN111125569A (en) * 2019-12-25 2020-05-08 北京同邦卓益科技有限公司 Data identifier generation method and device, electronic equipment and medium
CN112181306A (en) * 2020-10-10 2021-01-05 杭州电子科技大学 Method for generating distributed ID (identity) in number segment mode
CN112351110A (en) * 2020-11-27 2021-02-09 杭州安恒信息技术股份有限公司 ID distribution method and device based on zookeeper

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116841755A (en) * 2023-09-01 2023-10-03 中国中金财富证券有限公司 Verification code information processing method and device, electronic equipment and storage medium
CN116841755B (en) * 2023-09-01 2023-12-26 中国中金财富证券有限公司 Verification code information processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US9304807B2 (en) Fault tolerant batch processing
JP5528557B2 (en) Address server
CN109447253B (en) Video memory allocation method and device, computing equipment and computer storage medium
CN110609807B (en) Method, apparatus and computer readable storage medium for deleting snapshot data
CN110750517B (en) Data processing method, device and equipment of local storage engine system
CN110597879B (en) Method and device for processing time series data
CN106936931A (en) The implementation method of distributed lock, relevant device and system
CN111144582B (en) Method and corresponding device for training and updating machine learning model
CN113254223B (en) Resource allocation method and system after system restart and related components
CN106708865B (en) Method and device for accessing window data in stream processing system
CN113905014B (en) Method, server and storage medium for assigning ID number to terminal device
CN113905014A (en) Method, server and storage medium for assigning ID number to terminal device
CN110162395A (en) A kind of method and device of Memory Allocation
JP2018132948A (en) Loading program, loading method, and information processing device
CN113886376A (en) Data cleaning method and device, electronic equipment and medium
US11016685B2 (en) Method and defragmentation module for defragmenting resources
CN109597683B (en) Memory management method, device, equipment and storage medium
CN110109879B (en) Method, apparatus and computer readable medium for flushing metadata in a multi-core system
WO2015004571A1 (en) Method and system for implementing a bit array in a cache line
CN112817766B (en) Memory management method, electronic equipment and medium
CN116991595B (en) Memory allocation method, device, equipment and medium based on Bitmap
US20230153293A1 (en) Multi-threaded dynamic queries on an unpartitioned database
CN111158605B (en) Method and device for optimizing disk storage policy of operating system and intelligent equipment
CN113742042A (en) Timer processing method, device and equipment and readable storage medium
CN115080660A (en) Method, device and system for acquiring sequence number in distributed system

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