A distributed unique ID generation method, system, device and medium

By initializing system parameters, obtaining timestamps and generating sequence numbers in distributed systems, the problems of low-efficiency and inability to time-order in the prior art are solved, efficient, globally unique and time-ordered ID generation is achieved, and high-concurrency and large-scale distributed clusters are supported.

CN119766775APending Publication Date: 2025-04-04HUANENG NINGXIA ENERGY CO LTD LINGWULONGQIAO BRANCH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411929026.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

In the prior art, the database auto-increasing primary key is a performance bottleneck in high concurrency scenarios. The UUID length is long and does not have time order, making it difficult to achieve efficient, globally unique and time orderly ID generation.

Method used

By initializing the system parameters, obtaining the current timestamp, generating a sequence number, and combining these parameters to generate a distributed unique ID. Specific steps include determining the epoch time, configuring the data center ID and machine ID, initializing the serial number, defining the offset, obtaining and verifying the timestamp, generating and updating the serial number, and finally generating a unique ID through a combination of bit operations.

Benefits of technology

It ensures the uniqueness of IDs between different nodes, avoids conflicts, and supports high concurrency scenarios and larger-scale distributed clusters. It has time-ordering and is suitable for database sorting and indexing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766775A_ABST
    Figure CN119766775A_ABST
Patent Text Reader

Abstract

The present invention discloses a distributed unique ID generation method, system, device and medium, comprising: initializing system parameters; obtaining the current timestamp of the system; generating a serial number; generating a distributed unique ID according to the initialized system parameters, the current timestamp and the serial number. The method, system, device and medium can generate an efficient, globally unique and time-ordered ID.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of distributed systems and relates to a distributed unique ID generation method, system, device and medium. Background Art

[0002] In a distributed system, each node usually needs to generate a globally unique ID to identify data records or transaction events. In the prior art, common unique ID generation methods include database auto-increment primary keys, UUIDs, etc. However, database auto-increment primary keys can cause performance bottlenecks and are not suitable for high-concurrency scenarios; although UUIDs can ensure global uniqueness, they are long and lack time order, making them inconvenient for database index optimization. Therefore, how to design an efficient, globally unique, and time-ordered ID generation method has become a key issue in distributed system design. Summary of the invention

[0003] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a distributed unique ID generation method, system, device and medium, which can generate efficient, globally unique and time-ordered IDs.

[0004] To achieve the above object, the present invention discloses a distributed unique ID generation method, comprising:

[0005] Initialize system parameters;

[0006] Get the current system timestamp;

[0007] Generate a serial number;

[0008] A distributed unique ID is generated according to the initialization system parameters, the current timestamp and the sequence number.

[0009] The further improvement of the distributed unique ID generation method of the present invention is:

[0010] Furthermore, the operation process of initializing the system parameters is as follows:

[0011] determine epoch time twepoch;

[0012] Configure the data center IDdataCenterId and the machine IDworkerId;

[0013] Initialize the serial number;

[0014] Defines the offset.

[0015] Furthermore, the process of obtaining the current timestamp is:

[0016] Call the system function to get the current timestamp;

[0017] Determine the validity of the current timestamp obtained. If the current timestamp obtained is invalid, discard the current timestamp and call the system function again to obtain the current timestamp.

[0018] Furthermore, the process of generating the serial number is:

[0019] Determine whether timestamplastTimestamp is within the same millisecond. If timestamplastTimestamp is within the same millisecond, add 1 to the current sequence number. If timestamplastTimestamp is not within the same millisecond, reset the sequence number to 0 and update the timestamp.

[0020] When the sequence number exceeds the maximum value, it blocks and waits for the next millisecond.

[0021] Furthermore, the process of generating a distributed unique ID according to the initialization system parameters, the current timestamp and the serial number is:

[0022] Subtract the epoch time from the timestamp, then shift it left by 22 bits and place it in the high-order part of the ID;

[0023] Data center ID part: Shift the data center ID left by 17 bits and place it in the low bit of the timestamp;

[0024] Shift the machine ID left by 12 bits and place it in the lower bit of the data center ID;

[0025] The serial number directly occupies the lowest 12 digits of the ID.

[0026] Furthermore, the distributed unique ID is: |sign bit (1)|timestamp (41)|data center ID (5)|machine ID (5)|serial number (12)|.

[0027] Furthermore, after generating the distributed unique ID according to the initialization system parameters, the current timestamp and the serial number, the following steps are further included:

[0028] Returns the generated distributed unique ID to the caller.

[0029] The present invention discloses a distributed unique ID generation system, comprising:

[0030] Initialization module, used to initialize system parameters;

[0031] The acquisition module is used to obtain the current timestamp of the system;

[0032] A first generating module, used for generating a serial number;

[0033] The second generating module is used to generate a distributed unique ID according to the initialization system parameters, the current timestamp and the serial number.

[0034] The present invention discloses a computer device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the distributed unique ID generation method when executing the computer program.

[0035] The present invention discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the distributed unique ID generation method are implemented.

[0036] The present invention has the following beneficial effects:

[0037] The distributed unique ID generation method, system, device and medium of the present invention generate a distributed unique ID according to the initialization system parameters, the current timestamp and the sequence number during specific operation, which can ensure the uniqueness of the generated ID between different nodes and avoid conflicts. In addition, by increasing the initialization system parameters, a larger-scale distributed cluster can be supported. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0039] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] In the description of the present invention, it should be understood that the terms “include” and “comprises” indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.

[0042] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0043] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects are in an "or" relationship.

[0044] It should be understood that, although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.

[0045] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0046] In order to make the purpose, 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 in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings here can usually be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0047] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.

[0048] Embodiment 1

[0049] refer to Figure 1 The distributed unique ID generation method of the present invention comprises the following steps:

[0050] 1) Initialize system parameters;

[0051] 11) Determine the epoch time twepoch:

[0052] Choose a fixed starting time (for example, January 1, 2024 00:00:00) to calculate the difference between the current timestamp and the epoch time.

[0053] Among them, the epoch time can be freely set according to system requirements, but the epoch time must be unified in the entire distributed system.

[0054] 12) Assignment ID:

[0055] Each data center is assigned a unique data center ID dataCenterId, ranging from 0 to 31, which is represented by 5 bits of binary.

[0056] Each machine node is assigned a unique machine ID workerId ranging from 0 to 31, which is represented by 5 bits of binary.

[0057] 13) Initialize the serial number:

[0058] The sequence number is initialized to 0, which is used to record the number of IDs generated in the same millisecond.

[0059] 14) Define the offset:

[0060] Assume that the timestamp offset timestampLeftShift is 41 bits.

[0061] Assume that the offset of the data center ID dataCenterIdShift is 17 bits.

[0062] Assume that the offset of the machine ID workerIdShift is 12 bits.

[0063] 2) Get the current timestamp;

[0064] 21) Get the current timestamp;

[0065] Call the system function to get the current timestamp and record the number of milliseconds since the epoch time. The JAVA code is: longtimestamp = System.currentTimeMillis();

[0066] 22) Determine the time validity;

[0067] When the current timestamp is less than the timestamp lastTimestamp of the last generated ID, it means that the system clock has been set back and an exception needs to be thrown. The JAVA code is as follows: if(timestamp <lastTimestamp){

[0068] thrownewRuntimeException("Clock moved backwards.Refusing to generateID.");

[0069] }

[0070] 3) Generate a serial number;

[0071] 31) Determine whether it is within the same millisecond;

[0072] When timestamplastTimestamp, it means they are still in the same millisecond. In this case, you need to increase the sequence. The JAVA code is as follows:

[0073] sequence=(sequence+1)&sequenceMask;

[0074] 32) Sequence number overflow processing;

[0075] When the sequence number exceeds the maximum value of 4095 (that is, all 12 bits are 1), it blocks and waits for the next millisecond. The JAVA code is as follows:

[0076] if (sequence == 0) {

[0077] timestamp=waitUntilNextMillis(lastTimestamp);

[0078] }

[0079] The code of the waitUntilNextMillis() method is:

[0080] private long waitUntilNextMillis(long lastTimestamp){

[0081] long timestamp=System.currentTimeMillis();

[0082] while(timestamp<=lastTimestamp){

[0083] timestamp=System.currentTimeMillis();

[0084] }

[0085] return timestamp;

[0086] }

[0087] 33) Update timestamp;

[0088] When the timestamp is not in the same millisecond, reset the sequence number to 0 and update the lastTimestamp. The JAVA code is as follows:

[0089] sequence=0L;

[0090] lastTimestamp = timestamp;

[0091] 4) Combine to generate a unique ID;

[0092] Use bitwise operations to concatenate the parts into a unique ID. The JAVA code is as follows: long id = ((timestamp-twepoch) < <timestampLeftShift)

[0093] (dataCenterId< <dataCenterIdShift)|

[0094] (workerId< <workerIdShift)|

[0095] sequence;

[0096] The process of step 4) is:

[0097] 41) Timestamp part: Subtract the epoch time from the timestamp, then shift it left by 22 bits and place it in the high-order part of the ID;

[0098] 42) Data center ID part: Shift the data center ID left by 17 bits and place it in the low bit of the timestamp;

[0099] 43) Machine ID part: Shift the machine ID 12 bits to the left and place it in the lower bit of the data center ID;

[0100] 44) Serial number part: The serial number directly occupies the lowest 12 bits of the ID.

[0101] The format of the final generated unique ID is:

[0102] |Sign bit (1)|Timestamp (41)|Data center ID (5)|Machine ID (5)|Serial number (12)|Among them, the sign bit is fixed to 0 to ensure that the ID is a positive number. Timestamp: Records the number of milliseconds since the epoch (41 bits can be used for about 69 years). Data center ID: Identifies the physical data center where the ID is generated. Machine ID: Identifies the specific machine node that generates the ID. Serial number: Used to distinguish IDs within the same millisecond, and supports generating 4096 IDs per millisecond.

[0103] 5) Return the generated ID;

[0104] Return the calculated ID to the caller to complete the unique ID generation. The JAVA code is as follows: return id;

[0105] It should be noted that the present invention has the following characteristics:

[0106] Efficiency: IDs are generated through bit operations, which is highly efficient and supports high-concurrency scenarios.

[0107] Temporal order: IDs generated based on timestamps have a natural temporal order and are suitable for database sorting and indexing.

[0108] Scalability: By increasing the number of bits in the data center ID and machine ID, larger distributed clusters can be supported.

[0109] Global uniqueness: Ensure the uniqueness of generated IDs between different nodes to avoid conflicts.

[0110] Embodiment 2

[0111] The distributed unique ID generation system of the present invention comprises:

[0112] Initialization module, used to initialize system parameters;

[0113] The acquisition module is used to obtain the current timestamp of the system;

[0114] A first generating module, used for generating a serial number;

[0115] The second generating module is used to generate a distributed unique ID according to the current timestamp and the sequence number.

[0116] As an implementation mode of the present invention, the operation process of initializing system parameters is as follows:

[0117] determine epoch time twepoch;

[0118] Configure the data center IDdataCenterId and the machine IDworkerId;

[0119] Initialize the serial number;

[0120] Defines the offset.

[0121] As an implementation mode of the present invention, the process of obtaining the current timestamp is:

[0122] Call the system function to get the current timestamp;

[0123] Determine the validity of the current timestamp obtained. If the current timestamp obtained is invalid, discard the current timestamp and call the system function again to obtain the current timestamp.

[0124] As an implementation mode of the present invention, the process of generating the serial number is as follows:

[0125] Determine whether timestamplastTimestamp is within the same millisecond. If timestamplastTimestamp is within the same millisecond, add 1 to the current sequence number. If timestamplastTimestamp is not within the same millisecond, reset the sequence number to 0 and update the timestamp.

[0126] When the sequence number exceeds the maximum value, it blocks and waits for the next millisecond.

[0127] As an implementation mode of the present invention, the process of generating a distributed unique ID according to the current timestamp and the sequence number is:

[0128] Subtract the epoch time from the timestamp, shift it left 22 bits, and place it in the high-order part of the ID;

[0129] Data center ID part: Shift the data center ID left by 17 bits and place it in the low bit of the timestamp;

[0130] Shift the machine ID left by 12 bits and place it in the lower bit of the data center ID;

[0131] The serial number directly occupies the lowest 12 digits of the ID.

[0132] As an implementation mode of the present invention, the distributed unique ID is: |sign bit (1)|timestamp (41)|data center ID (5)|machine ID (5)|serial number (12)|.

[0133] As an implementation manner of the present invention, after generating a distributed unique ID according to the current timestamp and the sequence number, the method further includes:

[0134] Returns the generated distributed unique ID to the caller.

[0135] The division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.

[0136] Embodiment 3

[0137] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of implementing the distributed unique ID generation method include, for example, initializing system parameters; obtaining the current system timestamp; generating a sequence number; and generating a distributed unique ID according to the current timestamp and the sequence number. The operation process of initializing the system parameters is: determining the epoch time twepoch; configuring the data center ID dataCenterId and the machine ID workerId; initializing the sequence number; and defining the offset. The process of obtaining the current timestamp is: calling a system function to obtain the current timestamp; judging the validity of the obtained current timestamp; when the obtained current timestamp is invalid, discarding the current timestamp and re-calling the system function to obtain the current timestamp. The process of generating the sequence number is: judging whether timestamplastTimestamp is within the same millisecond; when timestamplastTimestamp is within the same millisecond, adding 1 to the current sequence number; when timestamplastTimestamp is not within the same millisecond, resetting the sequence number to 0 and updating the timestamp; when the sequence number exceeds the maximum value, blocking and waiting for the next millisecond. The process of generating a distributed unique ID according to the current timestamp and the serial number is: subtract the epoch time from the timestamp, then shift left by 22 bits and place it in the high-order part of the ID; data center ID part: shift the data center ID left by 17 bits and place it in the low-order part of the timestamp; shift the machine ID left by 12 bits and place it in the low-order part of the data center ID; the serial number directly occupies the lowest 12 bits of the ID. Among them, the memory may include a memory, such as a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk memory, etc.; the processor, the network interface, and the memory are interconnected through an internal bus, and the internal bus can be an industrial standard architecture bus, a peripheral component interconnection standard bus, an extended industrial standard structure bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory is used to store programs. Specifically, the program can include a program code, and the program code includes computer operation instructions. The memory can include a memory and a non-volatile memory, and provides instructions and data to the processor.

[0138] Embodiment 4

[0139] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of implementing the distributed unique ID generation method are, for example, including: initializing system parameters; obtaining the current timestamp of the system; generating a sequence number; and generating a distributed unique ID according to the current timestamp and the sequence number. The operation process of initializing the system parameters is: determining the epoch time twepoch; configuring the data center ID dataCenterId and the machine ID workerId; initializing the sequence number; and defining the offset. The process of obtaining the current timestamp is: calling a system function to obtain the current timestamp; judging the validity of the obtained current timestamp. When the obtained current timestamp is invalid, the current timestamp is discarded and the system function is called again to obtain the current timestamp. The process of generating the sequence number is: judging whether timestamplastTimestamp is within the same millisecond. When timestamplastTimestamp is within the same millisecond, 1 is added to the current sequence number; when timestamplastTimestamp is not within the same millisecond, the sequence number is reset to 0 and the timestamp is updated; when the sequence number exceeds the maximum value, it is blocked and waits for the next millisecond. The process of generating a distributed unique ID based on the current timestamp and the serial number is: subtract the epoch time from the timestamp, then shift it left by 22 bits and place it in the high-order part of the ID; data center ID part: shift the data center ID left by 17 bits and place it in the low-order part of the timestamp; shift the machine ID left by 12 bits and place it in the low-order part of the data center ID; the serial number directly occupies the lowest 12 bits of the ID. Specifically, the computer-readable storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. The volatile memory may include random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include read-only memory (ROM), hard disk, flash memory, optical disk, magnetic disk, etc.

[0140] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0141] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0142] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0144] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and disclosure of the invention. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.

[0145] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

[0146] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent structural change made to the above embodiment based on the technical essence of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. A distributed unique ID generation method, characterized in that: include: Initialize system parameters; Get the current system timestamp; Generate a serial number; A distributed unique ID is generated according to the initialization system parameters, the current timestamp and the sequence number.

2. The distributed unique ID generation method according to claim 1, characterized in that: The operation process of initializing system parameters is as follows: determine epoch time twepoch; Configure the data center IDdataCenterId and the machine IDworkerId; Initialize the serial number; Defines the offset.

3. The distributed unique ID generation method according to claim 1, characterized in that: The process of obtaining the current timestamp is: Call the system function to get the current timestamp; Determine the validity of the current timestamp obtained. If the current timestamp obtained is invalid, discard the current timestamp and call the system function again to obtain the current timestamp.

4. The distributed unique ID generation method according to claim 1, characterized in that: The process of generating the serial number is as follows: Determine whether timestamplastTimestamp is within the same millisecond. If timestamplastTimestamp is within the same millisecond, add 1 to the current sequence number. When timestamplastTimestamp is not in the same millisecond, the sequence number is reset to 0 and the timestamp is updated; When the sequence number exceeds the maximum value, it blocks and waits for the next millisecond.

5. The distributed unique ID generation method according to claim 1, characterized in that: The process of generating a distributed unique ID according to the initialization system parameters, the current timestamp and the serial number is as follows: Subtract the epoch time from the timestamp, then shift it left by 22 bits and place it in the high-order part of the ID; Data center ID part: Shift the data center ID left by 17 bits and place it in the low bit of the timestamp; Shift the machine ID left by 12 bits and place it in the lower bit of the data center ID; The serial number directly occupies the lowest 12 digits of the ID.

6. The distributed unique ID generation method according to claim 1, characterized in that: The distributed unique ID is: |sign bit (1)|timestamp (41)|data center ID (5)|machine ID (5)|serial number (12)|.

7. The distributed unique ID generation method according to claim 1, characterized in that: After generating the distributed unique ID according to the initialization system parameters, the current timestamp and the serial number, the following steps are further included: Returns the generated distributed unique ID to the caller.

8. A distributed unique ID generation system, characterized in that: include: Initialization module, used to initialize system parameters; The acquisition module is used to obtain the current timestamp of the system; A first generating module, used for generating a serial number; The second generating module is used to generate a distributed unique ID according to the initialization system parameters, the current timestamp and the serial number.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the distributed unique ID generation method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the distributed unique ID generation method according to any one of claims 1 to 7 are implemented.