[go: up one dir, main page]

CN114970464A - Method, device, terminal equipment and storage medium for generating identification - Google Patents

Method, device, terminal equipment and storage medium for generating identification Download PDF

Info

Publication number
CN114970464A
CN114970464A CN202210438872.0A CN202210438872A CN114970464A CN 114970464 A CN114970464 A CN 114970464A CN 202210438872 A CN202210438872 A CN 202210438872A CN 114970464 A CN114970464 A CN 114970464A
Authority
CN
China
Prior art keywords
target
digit
self
target number
increment
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.)
Pending
Application number
CN202210438872.0A
Other languages
Chinese (zh)
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.)
Beijing Minglue Zhaohui Technology Co Ltd
Original Assignee
Beijing Minglue Zhaohui Technology 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 Beijing Minglue Zhaohui Technology Co Ltd filed Critical Beijing Minglue Zhaohui Technology Co Ltd
Priority to CN202210438872.0A priority Critical patent/CN114970464A/en
Publication of CN114970464A publication Critical patent/CN114970464A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • G06F40/157Transformation using dictionaries or tables
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to the technical field of unique code generation, and discloses a method, a device, terminal equipment and a storage medium for generating an identifier, which are used for generating a record identifier and a data center identifier in a snowflake algorithm, and comprise the following steps: acquiring a first target number based on the self-increment of the remote dictionary service; carrying out scale conversion on the first target digit to obtain a second target digit; and acquiring the value of the first digit in the second target number as a record identifier, and acquiring the value of the second digit in the second target number as a data center identifier. The first target number is obtained through a remote dictionary service self-increment mode. The remote dictionary service self-increment is atomic operation, the first target numbers obtained when the instance is started can be guaranteed to be different, the first target numbers are subjected to binary conversion to obtain second target numbers, values on different digits in the second target numbers are taken as record identification and data center identification respectively, and therefore the efficiency of generating the unique record identification and the data center identification is improved.

Description

Method, device, terminal equipment and storage medium for generating identification
Technical Field
The application relates to the technical field of unique code generation, in particular to a method, a device, terminal equipment and a storage medium for generating an identifier.
Background
With the rapid development of internet technology and the accumulation of data volume, the need for data identification using ordered sequence numbers as globally unique identifiers is growing urgently.
In a complex distributed system, a unique identifier is often required to be assigned to a large amount of data and messages, for example, a unique order number is assigned to each order in a service system, and the order number can be understood as an identifier (Identity document.id) corresponding to the order. The ID basic requirements include the following: 1. the global is unique; 2. the occupation is relatively small, the ID is convenient to store, and the index is convenient; 3. the method is time-friendly and facilitates service query; 4. high performance and high usability. To meet the demand for IDs in distributed systems, it is an important aspect to provide a way to generate distributed IDs. The snowflake algorithm is a superior distributed identification solution. Which can produce 26 thousand incredibly orderable tokens per second.
However, the snowflake algorithm also has certain requirements on use, for example, the word or the datacentre of the two services cannot be the same, and if the same word or datacentre exists in the two services, the ID generated by the snowflake algorithm may be the same.
Most of existing works and datacentres are automatically generated through a random function, then a service instance is traversed, whether the randomly generated works and datacentres are occupied or not is judged, and if the occupation exists, the works and datacentres are regenerated. Although unique words and datacentred identifiers can be generated, when a large-scale service instance exists, the efficiency of generating words and datacentred identifiers by the system is greatly slowed down by the identification generation method which is generated before traversal, and the efficiency of generating globally unique identifiers is further influenced.
Disclosure of Invention
The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed embodiments. This summary is not an extensive overview nor is intended to identify key/critical elements or to delineate the scope of such embodiments but rather as a prelude to the more detailed description that is presented later.
The embodiment of the disclosure provides a method and a device for generating an identifier, a terminal device and a storage medium, so as to improve the efficiency of generating a unique record identifier and a data center identifier.
In some embodiments, a method for identification generation comprises:
acquiring a first target number based on a remote dictionary service (redis) self-increment; carrying out scale conversion on the first target digit to obtain a second target digit; and acquiring the value of the first digit in the second target number as a record identifier, and acquiring the value of the second digit in the second target number as a data center identifier.
Optionally, the obtaining the first target number based on the remote dictionary service self-increment comprises: obtaining self-increment numbers based on self-increment of remote dictionary service; and carrying out remainder operation on the self-increasing numbers to obtain first target numbers.
Optionally, the first target number is a decimal number; the performing the binary conversion on the first target number to obtain the second target number includes: and carrying out thirty-two system conversion on the first target digit to obtain a second target digit.
Optionally, the first digit is ten.
Optionally, the second bit is a single bit.
In some embodiments, the apparatus comprises:
a number acquisition module configured to acquire a first target number based on redis self-increment; the system conversion module is configured to carry out system conversion on the first target digit to obtain a second target digit; and the identification acquisition module is configured to acquire the value of the first digit in the second target number as the record identification, and acquire the value of the second digit in the second target number as the data center identification.
In some embodiments, the terminal device comprises the above-mentioned means for identity generation.
In some embodiments, the storage medium stores program instructions that, when executed, perform the above-described method for identification generation.
The method, the device, the terminal device and the storage medium for generating the identifier provided by the embodiment of the disclosure adopt the technical means applied to the technical field of distributed platform tuning, and can realize the following technical effects: and acquiring the first target number in a redis self-increment mode. Because the redis self-increment is an atomic operation, a concurrency problem does not exist, so that the first target numbers obtained by the service instance during starting are all different, the first target numbers are subjected to binary conversion to obtain second target numbers, values of different digits in the second target numbers are taken as the word and the datacentried respectively, the word and the datacentried are ensured to be unique codes, the efficiency of generating the word and the datacentried is improved, and the efficiency of generating the global unique identifier is further improved.
The foregoing general description and the following description are exemplary and explanatory only and are not restrictive of the application.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the accompanying drawings and not in limitation thereof, in which elements having the same reference numeral designations are shown as like elements and not in limitation thereof, and wherein:
FIG. 1 is a schematic flow chart diagram of a method for identity generation provided by an embodiment of the present application;
FIG. 2 is a schematic flow chart illustrating the generation of a first target number based on the remote dictionary service self-increment provided by the embodiment of the present disclosure;
FIG. 3 is a flow chart diagram of a method for identity generation provided by an embodiment of the present disclosure;
FIG. 4 is a block diagram of an apparatus for identity generation according to an embodiment of the present disclosure;
fig. 5 is a second schematic structural diagram of an apparatus for identifier generation according to an embodiment of the present disclosure;
fig. 6 is a third schematic structural diagram of an apparatus for identifier generation according to an embodiment of the present disclosure.
Detailed Description
So that the manner in which the features and elements of the disclosed embodiments can be understood in detail, a more particular description of the disclosed embodiments, briefly summarized above, may be had by reference to the embodiments, some of which are illustrated in the appended drawings. In the following description of the technology, for purposes of explanation, numerous details are set forth in order to provide a thorough understanding of the disclosed embodiments. However, one or more embodiments may be practiced without these details. In other instances, well-known structures and devices may be shown in simplified form in order to simplify the drawing.
The terms "first," "second," and the like in the description and in the claims, and the above-described drawings of embodiments of the present disclosure, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the present disclosure described herein may be made. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions.
The term "plurality" means two or more unless otherwise specified.
The term "correspond" may refer to an association or binding relationship, and a corresponds to B refers to an association or binding relationship between a and B.
First, an application scenario to which the present application is applicable will be described. The method and the device can be applied to the scenes of the distributed system.
Research has shown that in a complex distributed system, a large amount of data and messages often need to be uniquely identified. The snowflake algorithm is an excellent solution for distributed identification, and can generate 26 thousands of incredibly sortable identifications per second.
The Snowflake algorithm is widely used in distributed application at present, the generated result is an integer of one bit 64bit, which is a long type (the conversion into character strings is 19 bits at most), and the snowfall-64 bit structure is as follows:
from left to right, the first bit is a sign bit, and since the snowflake ID is generally a positive number, the first bit is generally fixed to 0;
timestamp (ms to year): 2^41/(3652460601000) ^ 69.73 years. The snowflake algorithm can be expressed in the range of 69 years (from 1970), and the snowflake algorithm can be expressed in the year 2039;
12 bit-sequence number: each machine of each computer room can generate 2^12-1(4095) different ID serial numbers every millisecond;
the ID generated by the snowflake algorithm cannot be repeated in the whole distributed system because of 10bit, namely record identification (word) and data center identification (datacentried) parameters set by the ID of the working machine; when source code is programmed, a program "public identity" is generally set to generate a snowflake ID, and different word and datacentred parameters need to be specified before generation.
However, the snowflake algorithm also has certain requirements on use, for example, the word or the datacentre of the two services cannot be the same, and if the same word or datacentre exists in the two services, the ID generated by the snowflake algorithm may be the same. Most of existing works and datacentried are automatically generated through a random function, or a 32-bit remainder is taken to generate a work based on an ip address hash, a 32-bit remainder is taken to generate a datacentried based on a name hash of a server, then a service instance is traversed, whether the randomly generated works and datacentried are occupied or not is judged, and if the occupation exists, the works and datacentried are regenerated. Although unique words and datacentred identifiers can be generated, when a large-scale service instance exists, the efficiency of generating words and datacentred identifiers by the system is greatly slowed down by the identification generation method which is generated before traversal, and the efficiency of generating globally unique identifiers is further influenced.
Based on this, the embodiment of the present application provides a method, an apparatus, a terminal device and a storage medium for identifier generation, which are applied to a server side to obtain a first target number in a redis self-increment manner. Because the redis self-increment is an atomic operation, a concurrency problem does not exist, so that the first target numbers obtained when the service instance is started in the server are all different, the first target numbers are subjected to binary conversion to obtain second target numbers, values on different digits in the second target numbers are taken as the word and the datacentried respectively, the identifiers of the word and the datacentried are ensured to be unique codes, the efficiency of generating the word and the datacentried is improved, and the efficiency of generating the global unique identifier is further improved.
Referring to fig. 1, fig. 1 is a schematic flowchart of a method for identifier generation according to an embodiment of the present application. As shown in fig. 1, a method for identity generation includes:
s11, the server generates a first target number based on the remote dictionary service increase.
In the embodiment of the application, because the remote dictionary service (redis) self-increment is an atomic operation and there is no concurrency problem, the numbers obtained by the instances during starting are all different, thereby ensuring that the generated first target numbers are all different each time based on the redis self-increment.
And S12, the server carries out the binary conversion on the first target digit to obtain a second target digit.
In the embodiment of the present application, the first target number is a decimal number, and the manner of performing binary conversion on the first target number to obtain the second target number is to perform thirty-two conversion on the first target number to obtain the second target number.
In this way, the first target number is converted into the thirty-two system, and the obtained second target number can accommodate more values in each digit.
S13, the server takes the value of the first digit in the second target number as the record identification and takes the value of the second digit in the second target number as the data center identification.
In the embodiment of the present application, the first digit is ten digits of the second target number, and the second digit is one digit of the second target number.
Therefore, the value corresponding to the ten digits in the second target number is taken as the word, and the value corresponding to the one digits in the second target number is taken as the datacentred, so that the uniqueness of the word and the datacentred can be better ensured.
The method and the device have the advantages that the unique first target number can be obtained in a redis self-increment mode by adopting technical means applied to the technical field of distributed platform tuning, the first target number obtained when the service instance is started is ensured to be different, the first target number is subjected to binary conversion to obtain a second target number, values of different digits in the second target number are taken as the word and the datacentre respectively, and the marks of the word and the datacentre are ensured to be unique codes. Most of the words and datacentres in the prior art are automatically generated by a random function, and then the service instance is traversed, whether the randomly generated words and datacentres are occupied or not is compared, and if the occupation exists, the words and datacentres are regenerated. Although unique words and datacentred identifiers can be generated, when a large-scale service instance exists, the efficiency of generating words and datacentred identifiers by the system is greatly slowed down by the identification generation method which is generated before traversal, and the efficiency of generating globally unique identifiers is further influenced. Compared with the prior art, the technical scheme in the application can obviously improve the efficiency of generating the word and the datacentred, and further improve the working efficiency of generating the global unique identifier by the system.
The following describes, with reference to fig. 2, a step of generating a first target number based on the self-increment of the remote dictionary service provided in the embodiment of the present application, as shown in fig. 2:
s21, the server gains the self-increment number based on the self-increment of the remote dictionary service.
And S22, the server performs remainder operation on the self-increasing numbers to obtain first target numbers.
In the embodiment of the application, by adopting the method for generating the first target number based on the self-increment of the remote dictionary service provided by the embodiment of the disclosure, the self-increment number is preferably subjected to 1024 remainder operation, and the first target number of the number in 1024 can be obtained. Thus, by adopting the method for generating the first target number based on the self-increment of the remote dictionary service provided by the embodiment of the disclosure, the instance can obtain a number between 0 and 1023 based on the self-increment and the remainder operation of the remote dictionary service when the service is started every time, and the number is sequentially increased and different, thereby ensuring the unique generation of the word and the datacentried.
The workflow of the method for identifier generation provided in the embodiment of the present application is briefly described below with reference to fig. 3, as shown in fig. 3:
s31, the server acquires the self-increment number based on the self-increment of the remote dictionary service.
In the embodiment of the application, when the server instance is started, a self-increment number is acquired in a self-increment mode of remote dictionary service, and as the self-increment of the remote dictionary service is atomic operation and no concurrency problem exists, the self-increment numbers acquired by the instance when the instance is started are different. Here, the incremental numbers obtained by the way of incremental serving of the remote dictionary at the time of starting the server instance are 2999 as an example, and the following flow is applied, where 2999 is taken as the incremental numbers.
And S32, the server carries out the remainder operation on the self-increasing numbers to obtain first target numbers.
In the embodiment of the application, the server performs the remainder operation on the self-increasing numbers, preferably, performs the remainder operation on 1024, and obtains a first target number of the 1024 internal numbers. Thus, by adopting the method for generating the first target number based on the self-increment of the remote dictionary service provided by the embodiment of the disclosure, the number between 0 and 1023 can be distributed and obtained based on the self-increment and the remainder operation of the remote dictionary service when the instance starts the service each time, and the number is sequentially increased and different, thereby ensuring the unique generation of the word and the datacentrid. At this time, the result of the remainder operation on 2999 is 951, where the result 951 of the remainder operation on 2999 is taken as the first target number.
And S33, the server carries out the binary conversion on the first target digit to obtain a second target digit.
In the embodiment of the present application, the first target number is a decimal number, and the manner of performing binary conversion on the first target number to obtain the second target number is to perform thirty-two conversion on the first target number to obtain the second target number. In this way, the first target number is converted into the thirty-two system, and the obtained second target number can accommodate more values in each digit. At this time, the number resulting from the thirty-binary conversion of 951 is "TN" as the second target number. Here, the tens of the second target number is "T", and the units of the second target number is "N".
S34, the server takes the tenth digit of the second target digit as the first target mark and the third digit as the second target mark.
In the embodiment of the present application, the value of the first target identifier is "T", that is, 29, and the value of the second target identifier is "N", that is, 23.
S35, the server determines the first identification as word and the second identification as datacentred.
Therefore, the server takes the value of the tens digit in the second target number as the word and the value of the units digit in the second target number as the datacentred, so that the uniqueness of the word and the datacentred can be better ensured.
After the unique word and the unique datacentre are obtained, the snowflake id can be generated through the word and the datacentre, a snowflake instance is created, and the service program is started normally. The scheme is applied to distributed ID calculation, and is started once at the moment when the ID needs to be redistributed, after the unique word and the unique datacentre are obtained, the word and the unique datacentre are sequentially increased on the basis of the original identification when the next instance is started.
The method and the device have the advantages that the unique first target number can be obtained in a redis self-increment mode by adopting technical means applied to the technical field of distributed platform tuning, the first target number obtained when the service instance is started is ensured to be different, the first target number is subjected to binary conversion to obtain a second target number, values of different digits in the second target number are taken as the word and the datacentre respectively, and the marks of the word and the datacentre are ensured to be unique codes. In the prior art, most of the word and the datacentred are automatically generated through a random function, then the service instance is traversed, whether the randomly generated word and datacentred are occupied or not is compared, and if the occupation exists, the word and the datacentred are regenerated. Although unique words and datacentred identifiers can be generated, when a large-scale service instance exists, the efficiency of generating words and datacentred identifiers by the system is greatly slowed down by the identification generation method which is generated before traversal, and the efficiency of generating globally unique identifiers is further influenced. Compared with the prior art, the technical scheme in the application can obviously improve the efficiency of generating the word and the datacentred, and further improve the working efficiency of generating the global unique identifier by the system.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an apparatus for generating an identifier according to an embodiment of the present disclosure. As shown in fig. 4, an apparatus for identifier generation provided in an embodiment of the present application includes:
a number acquisition module 401 configured to acquire a first target number based on the remote dictionary service auto-increment.
Here, since remote dictionary service (redis) self-increment is an atomic operation, there is no concurrency problem, so that the numbers obtained by the instances at the time of starting are all different, thereby ensuring that the first target numbers generated each time based on the redis self-increment are all different.
A system conversion module 402 configured to perform system conversion on the first target digit to obtain a second target digit.
And an identifier obtaining module 403 configured to obtain the value of the first digit in the second target number as a record identifier, and obtain the value of the second digit in the second target number as a data center identifier.
In the embodiment of the present application, the first digit is ten digits of the second target number, and the second digit is one digit of the second target number.
In this way, the identifier obtaining module 403 may obtain the value of the ten digit in the second target number as the word, and obtain the value of the one digit in the second target number as the datacentred, so as to better ensure the uniqueness of the word and the datacentred.
By adopting the device for generating the identifier, which is provided by the embodiment of the disclosure, and adopting the technical means applied to the technical field of distributed platform tuning, the unique first target number can be obtained in a redis self-increment mode, so that the first target numbers obtained when the service instance is started are different, the first target number is subjected to binary conversion to obtain a second target number, and values of different digits in the second target number are taken as the word and the datacentried respectively, so that the identifiers of the word and the datacentried are ensured to be unique codes. In the prior art, most of the word and the datacentred are automatically generated through a random function, then the service instance is traversed, whether the randomly generated word and datacentred are occupied or not is judged, and if the occupation exists, the word and the datacentred are regenerated. Although unique words and datacentred identifiers can be generated, when a large-scale service instance exists, the efficiency of generating words and datacentred identifiers by the system is greatly slowed down by the identification generation method which is generated before traversal, and the efficiency of generating globally unique identifiers is further influenced. Compared with the prior art, the technical scheme in the application can obviously improve the efficiency of generating the word and the datacentred, and further improve the working efficiency of generating the global unique identifier by the system.
Referring to fig. 5, fig. 5 is a second schematic structural diagram of an apparatus for generating an identifier according to an embodiment of the present application. As shown in fig. 5, the binary conversion module provided in the embodiment of the present application includes:
a remote dictionary service self-increment module 501 configured to obtain self-increment numbers based on the remote dictionary service self-increment;
a remainder module 502 configured to perform a remainder operation on the self-increasing number to obtain a first target number.
In this embodiment of the present application, the remote dictionary service self-increment module 501 generates a first target number by adopting the self-increment based on the remote dictionary service provided by the embodiment of the present disclosure, and the remainder module 502 performs a remainder operation on the self-increment number, preferably 1024 remainders, to obtain a first target number of a number within 1024. Thus, by adopting the method for generating the first target number based on the self-increment of the remote dictionary service provided by the embodiment of the disclosure, the number between 0 and 1023 can be distributed and obtained based on the self-increment and the remainder operation of the remote dictionary service when the instance starts the service each time, and the number is sequentially increased and different, thereby ensuring the unique generation of the word and the datacentrid.
Referring to fig. 6, a third schematic diagram of an apparatus for identifier generation according to an embodiment of the present disclosure includes a processor (processor)600 and a memory (memory) 601. Optionally, the apparatus may also include a Communication Interface 602 and a bus 603. The processor 600, the communication interface 602, and the memory 601 may communicate with each other via a bus 603. The communication interface 602 may be used for information transfer. The processor 100 may call logic instructions in the memory 101 to perform the method for identification generation of the above-described embodiment.
In addition, the logic instructions in the memory 601 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products.
The memory 601 is used as a storage medium for storing software programs, computer executable programs, and program instructions/modules corresponding to the methods in the embodiments of the disclosure. The processor 100 executes the functional application and data processing, i.e. implements the method for identification generation in the above-described embodiments, by executing the program instructions/modules stored in the memory 601.
The memory 601 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal device, and the like. In addition, the memory 601 may include a high speed random access memory, and may also include a non-volatile memory.
The embodiment of the present disclosure provides a terminal device, which includes the above apparatus for generating an identifier.
Embodiments of the present disclosure provide a storage medium storing computer-executable instructions configured to perform the above-described method for identity generation.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and 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 of devices or units through some communication interfaces, 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 application 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 functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the method described in the embodiments of the present application.
The storage medium described above may be a transitory computer-readable storage medium or a non-transitory computer-readable storage medium. A non-transitory storage medium comprising: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes, and may also be a transient storage medium.
Those of skill in the art would 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 may depend upon the particular application and design constraints imposed on the solution. 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 disclosed embodiments. It can be clearly understood by the skilled person that, for convenience and brevity of description, the specific working processes of the system, the apparatus and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used to illustrate the technical solutions of the present application, but not to limit the technical solutions, and the scope of the present application is not limited to the above-mentioned embodiments, although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
The above description and drawings sufficiently illustrate embodiments of the disclosure to enable those skilled in the art to practice them. Other embodiments may incorporate structural, logical, electrical, process, and other changes. The examples merely typify possible variations. Individual components and functions are optional unless explicitly required, and the sequence of operations may vary. Portions and features of some embodiments may be included in or substituted for those of others. Furthermore, the words used in the specification are words of description only and are not intended to limit the claims. As used in the description of the embodiments and the claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term "and/or" as used in this application is meant to encompass any and all possible combinations of one or more of the associated listed. Furthermore, the terms "comprises" and/or "comprising," when used in this application, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. Without further limitation, an element defined by the phrase "comprising an …" does not exclude the presence of other like elements in a process, method or apparatus that comprises the element. In this document, each embodiment may be described with emphasis on differences from other embodiments, and the same and similar parts between the respective embodiments may be referred to each other. For methods, products, etc. of the embodiment disclosures, reference may be made to the description of the method section for relevance if it corresponds to the method section of the embodiment disclosure.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. In the description corresponding to the flowcharts and block diagrams in the figures, operations or steps corresponding to different blocks may also occur in different orders than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two sequential operations or steps may in fact be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. Each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

Claims (10)

1. A method for generating a logo, wherein the logo comprises a record logo and a data center logo used in a snowflake algorithm, the method comprising:
generating a first target number based on the self-increment of the remote dictionary service;
carrying out scale conversion on the first target digit to obtain a second target digit;
and taking the value of the first digit in the second target number as a record identifier, and taking the value of the second digit in the second target number as a data center identifier.
2. The method of claim 1, wherein the obtaining the first target number based on the remote dictionary service self-increment comprises:
obtaining self-increment numbers based on self-increment of remote dictionary service;
and carrying out remainder operation on the self-increasing numbers to obtain first target numbers.
3. The method of claim 1 or 2, wherein the first target number is a decimal number; the performing the binary conversion on the first target number to obtain the second target number includes:
and carrying out thirty-two system conversion on the first target digit to obtain a second target digit.
4. The method of claim 3, wherein the first digit is a ten digit.
5. The method of claim 4, wherein the second number of bits is a single bit.
6. An apparatus for identity generation, comprising:
a number acquisition module configured to acquire a first target number based on a remote dictionary service increase;
the system conversion module is configured to carry out system conversion on the first target digit to obtain a second target digit;
and the identification acquisition module is configured to acquire the value of the first digit in the second target number as the record identification, and acquire the value of the second digit in the second target number as the data center identification.
7. The apparatus of claim 6, wherein the second digital acquisition module comprises:
the remote dictionary service self-increment module is configured to obtain self-increment numbers based on the remote dictionary service self-increment;
and the residue taking module is configured to carry out residue taking operation on the self-increasing numbers to obtain first target numbers.
8. An apparatus for identity generation comprising a processor and a memory storing program instructions, wherein the processor is configured to perform the method for identity generation of any one of claims 1 to 5 when executing the program instructions.
9. A terminal device, characterized in that it comprises means for identification generation according to any of claims 6 to 8.
10. A storage medium storing program instructions, characterized in that said program instructions, when executed, perform the method for identification generation according to any of claims 1 to 5.
CN202210438872.0A 2022-04-25 2022-04-25 Method, device, terminal equipment and storage medium for generating identification Pending CN114970464A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210438872.0A CN114970464A (en) 2022-04-25 2022-04-25 Method, device, terminal equipment and storage medium for generating identification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210438872.0A CN114970464A (en) 2022-04-25 2022-04-25 Method, device, terminal equipment and storage medium for generating identification

Publications (1)

Publication Number Publication Date
CN114970464A true CN114970464A (en) 2022-08-30

Family

ID=82980118

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210438872.0A Pending CN114970464A (en) 2022-04-25 2022-04-25 Method, device, terminal equipment and storage medium for generating identification

Country Status (1)

Country Link
CN (1) CN114970464A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114153846A (en) * 2021-11-29 2022-03-08 北京无忧创想信息技术有限公司 A method and device for rapidly generating a unique ID of a distributed system
CN115757408A (en) * 2022-11-21 2023-03-07 北京锐安科技有限公司 Memory database storage method and device of dictionary and electronic equipment
CN117194547A (en) * 2023-09-28 2023-12-08 深圳市梦网科技发展有限公司 Method, device, equipment and medium for generating unique identifier
CN117785385A (en) * 2023-12-30 2024-03-29 北京领雁科技股份有限公司 ID generation system and method based on snowflake algorithm

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114153846A (en) * 2021-11-29 2022-03-08 北京无忧创想信息技术有限公司 A method and device for rapidly generating a unique ID of a distributed system
CN115757408A (en) * 2022-11-21 2023-03-07 北京锐安科技有限公司 Memory database storage method and device of dictionary and electronic equipment
CN117194547A (en) * 2023-09-28 2023-12-08 深圳市梦网科技发展有限公司 Method, device, equipment and medium for generating unique identifier
CN117785385A (en) * 2023-12-30 2024-03-29 北京领雁科技股份有限公司 ID generation system and method based on snowflake algorithm
CN117785385B (en) * 2023-12-30 2024-06-07 北京领雁科技股份有限公司 ID generation system and method based on snowflake algorithm

Similar Documents

Publication Publication Date Title
CN114970464A (en) Method, device, terminal equipment and storage medium for generating identification
US10778441B2 (en) Redactable document signatures
CN111708825B (en) Data processing method, device and equipment based on block chain and readable storage medium
CN110851748A (en) Short link generation method, server, storage medium and computer equipment
CN113127915A (en) Data encryption desensitization method and device, electronic equipment and storage medium
CN110634052A (en) Method and device for generating order number by distributed architecture
CN109359276B (en) Anti-counterfeiting code generation method, device, equipment and storage medium
WO2020000486A1 (en) Data processing method and device
CN109241056B (en) Digital ID generation system for distributed system
CN112559546B (en) Database synchronization method, database synchronization device, computer equipment and readable storage medium
CN104639550A (en) User identification method and equipment
CN112887451A (en) Domain name resolution method and device and computer equipment
CN110855441A (en) Method, device and equipment for authenticating electronic identity and storage medium
CN111695124A (en) Authority control method and device, storage medium and electronic equipment
CN108365962B (en) Certificate revocation list query method and device
CN117609964A (en) Authorization code generation method, device, equipment and readable storage medium
CN112883301A (en) Method and device for generating short link based on 55 system and storage medium
CN115913547B (en) Quantum security root key derivation device, method, root key center and medium
CN117633014A (en) Service data processing method and system
CN115391826A (en) Information processing method and device
CN112131293B (en) Interface management method, device, terminal equipment and storage medium
CN111813769B (en) Data processing method and device
CN115146315A (en) Private data protection method, device, equipment and storage medium of low-code platform
CN114201176A (en) Intelligent contract compiling and matching method, device, equipment and storage medium
CN112860488A (en) Object recovery method and device, electronic equipment and storage medium

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