Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Distributed unique ID generation method

A distributed and distributed data technology, applied in the direction of database distribution/replication, structured data retrieval, instruments, etc., to achieve the effect of fast response, strong readability, and high query efficiency

Pending Publication Date: 2021-11-09
SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

But once it involves sub-database and sub-table, it will lead to the generation of unique primary key ID in the distributed system, which requires the characteristics of unique ID:

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Distributed unique ID generation method
  • Distributed unique ID generation method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0044] The present invention will be described in further detail below in conjunction with the accompanying drawings and embodiments.

[0045] Such as figure 2 As shown, a distributed unique ID generation method, a flow chart of distributed ID generation, wherein: [User Service] is the user service module, [Generate ID Service] is the ID generation service module, which is an independent application, and the specific implementation process as follows:

[0046] 1. [User Service] requires a user ID when registering a user; request the interface of [Generate ID Service];

[0047] 2. [Generate ID service] will query the database to find the id of user_tag, the current max_id is 0, step=1000;

[0048] 3. [Generate ID Service] returns max_id and step to [User Service]; and updates max_id to max_id=max_id+step, that is, to 1000;

[0049] 4. [User Service] get max_id=0, step=1000;

[0050] 5. This user service can use the ID in the range of ID=[max_id+1, max_id+step], which is [1, ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a distributed unique ID generation method. The method comprises the following steps that distributed data ID self-increasing is achieved in a MySql primary key self-increasing mode, MySql multi-instance primary key self-increasing is used, a database request is sent when the ID is obtained every time, and the obtained ID is an ID interval section. According to the invention, a reliable solution is provided for the generation of the distributed system ID, and different scenes, requirements and performance requirements are adapted; the self-increasing problem of the database is perfectly solved, the readability is high, the query efficiency is high, the availability delay is low, and the ID generation response is fast; a single-point problem does not exist, and it is ensured that the ID is a globally unique basic requirement; the invention is high in availability, low in delay and fast in ID generation response, does not become a business bottleneck, and is infinitely close to 100% in availability; the problem of concurrence during ID acquisition is solved by using a distributed lock; the trend increases progressively, and various specific business scenes are met.

Description

technical field [0001] The invention relates to the technical field of distributed data processing, and specifically provides a method for generating a distributed unique ID. Background technique [0002] In the distributed system, some businesses with large data volume will be split, such as user table and order table. Because the amount of data is too large for one table to undertake, it will be divided into databases and tables. But once it involves sub-database and sub-table, it will lead to the generation of unique primary key ID in the distributed system, which requires the characteristics of unique ID: [0003] The ID of the entire system is unique; the ID is a digital type, and the trend is increasing; the ID is short and the query efficiency is fast; [0004] The so-called increment means: the first generated ID is 12, the next generated ID is 13, and the next generated ID is 14. This is to generate ID increments; [0005] Increasing trend: In a period of time, ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F16/2458G06F16/2453G06F16/2455G06F16/21G06F16/22G06F16/27
CPCG06F16/2471G06F16/2453G06F16/24552G06F16/217G06F16/2282G06F16/27
Inventor 孙志强徐士强杨继伟董玉全
Owner SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products