A method and a device for generating unique identifier of database record

A technology of identifiers and databases, applied in the computer field, can solve the problem that the uniqueness and order of unique identifiers cannot be realized at the same time

Inactive Publication Date: 2009-09-16
ALIBABA GRP HLDG LTD
View PDF0 Cites 31 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0019] The embodiment of the present application provides a method and device for generating a unique identifier for a database record, which solves the problem that the uniqueness and order of the unique identifier cannot be realized at the same time, and ensures the uniqueness of the identifier while ensuring the uniqueness of the identifier. sequence

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
  • A method and a device for generating unique identifier of database record
  • A method and a device for generating unique identifier of database record
  • A method and a device for generating unique identifier of database record

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 2

[0186] Embodiment 2, Embodiment 3 and Embodiment 4 use the same identifier generation mechanism to generate unique identifiers at three different system times. The system time in the second embodiment is 0:00 on September 9, 1999, and the generated unique identifier is "A0000000K6MU3EHXZK5E". The system time in the third embodiment is 1:00 on September 9, 1999, and the generated unique identifier is " A0012KW0HLIX7SWLKQKS". The system time in the fourth embodiment is 2:00 on September 9, 1999, and the generated unique identifier is "A00255S06WZRF7IYQD2N". Since the first parts of the three unique identifiers (that is, the first eight characters) are obtained according to the conversion of the system time, the three unique identifiers conform to the natural sequence of data records and have order. Moreover, the last 12 characters obtained by random number conversion ensure the global uniqueness of the identifier.

[0187] Embodiment 5 of the present application provides a met...

Embodiment 5

[0220] Embodiment 5, Embodiment 6, and Embodiment 7 use the same identifier generation mechanism to generate unique identifiers at three different system times. The system time in the fifth embodiment is 0:00 on September 9, 1999, and the generated unique identifier is "00000000AFWLIRFI5NDU". The system time in the sixth embodiment is 1:00 on September 9, 1999, and the generated unique identifier is " 00012KW0GKCGNJMVHPUC". The system time in the seventh embodiment is 2:00 on September 9, 1999, and the generated unique identifier is "000255S03RZWOR3J1AVO". Since the first parts of the three unique identifiers (that is, the first eight characters) are obtained according to the conversion of the system time, the three unique identifiers conform to the natural sequence of data records and have order. Moreover, the last 12 characters obtained by random number conversion ensure the global uniqueness of the identifier.

[0221] Embodiment 8 of the present application provides a de...

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 application discloses a method and a device for generating unique identifier of database record; wherein the method comprises the following steps: acquiring system time; generating a time character string according to the system time; generating random character string; splicing the time character string and the random character string into a unique identifier, wherein the time character string is positioned at the beginning of the unique identifier; and the unique identifier is distributed to a data table to be a primary key of the data table. In the embodiment of the application, the technical proposal of splicing the generated time character string and the random character string into the unique identifier and arranging the time character string at the beginning of the unique identifier solves the problem that the uniqueness and the order of the unique identifier can not be realized at the same time, thereby ensuring the uniqueness and the order of the identifier at the same time.

Description

technical field [0001] The present application relates to the field of computer technology, in particular to a method and device for generating unique identifiers for database records. Background technique [0002] In the development of the database system, the unique identifier is often used as the primary key of the data table to distinguish each row of the data table, and the generation method of the unique identifier directly affects the writing efficiency and retrieval efficiency of the data in the data table . Generally speaking, if different computers do not need a centralized server to coordinate the generation of unique identifiers, this method is efficient; if the order of generated unique identifiers conforms to the natural order of data records, such unique identifiers are useful for Data retrieval efficiency is higher; if the computer-generated unique identifier occupies fewer bytes, such a unique identifier is more efficient for data retrieval and saves storag...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
Inventor 李战园
Owner ALIBABA GRP HLDG LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products