Method and system for generating main key of distributed database
A technology for generating systems and databases, applied in the field of distributed databases, can solve the problem of limited length of primary keys, and achieve the effect of efficient concurrent performance
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0044] This embodiment provides a method for generating a distributed database primary key, such as figure 1 shown, including steps:
[0045] S11: Receive a primary key generation request;
[0046] S12: Generate a unique primary key according to the primary key generation request; the primary key consists of a seed part and an auto-growth part.
[0047] A database is a warehouse that organizes, stores and manages data according to its data structure. Databases include distributed databases, which differ from single databases in that:
[0048] A distributed database is a logically unified database composed of multiple physically dispersed database units connected by a computer network. Each connected database unit is called a site or node. Distributed databases are managed by a unified database management system, which is called a distributed database management system.
[0049] In a database software system, it is necessary to generate a unique string of numbers or charac...
Embodiment 2
[0089] This embodiment provides a method for generating a distributed database primary key, such as figure 2 shown, including steps:
[0090] S21: Receive a primary key generation request;
[0091] S22: generating a nine-base number;
[0092] S23: Query whether the non-nary number exists in the database, if so, regenerate a non-nary number, otherwise, assign the non-nary number to the seed part of the primary key;
[0093] S24: saving the nine-ary number to the database;
[0094] S25: Generate the self-growth part of the primary key.
[0095] The difference between this embodiment and the first embodiment is that the step of generating the seed part of the primary key specifically includes step S22, step S23, and step S24.
[0096] In this embodiment, the seed part is a nine-digit number generated by a central server.
[0097] Specifically, the central server first generates decimal numbers, and then converts them into nine-ary numbers.
[0098] The seed part is fixed u...
Embodiment 3
[0119] This embodiment provides a method for generating a distributed database primary key, such as image 3 shown, including steps:
[0120] S31: Receive a primary key generation request;
[0121] S32: generating a nine-base number;
[0122] S33: Query whether the non-ary number exists in the database, if so, regenerate a non-ary number, otherwise, assign the non-ary number to the seed part of the primary key;
[0123] S34: saving the nine-ary number to the database;
[0124] S35: Store the non-nary number whose initial value is zero in the database corresponding to the seed part;
[0125] S36: Increase the value of the self-increasing part sequentially according to the order of increasing records.
[0126] The difference between this embodiment and the first and second embodiments is that the step of generating the self-incrementing part of the primary key specifically includes step S35 and step S36.
[0127] The self-growth part of the primary key is also a string of n...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com