Unique key generation method and device and terminal equipment

A unique key and serial number generation technology, applied in the field of distributed systems, can solve problems such as poor performance, poor UUID generation performance, irreversible solution disorder, etc., and achieve high performance

Active Publication Date: 2019-06-25
江西猛犸能源有限公司
View PDF7 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] Among them, 1. UUID calculation rules guarantee the uniqueness of the global system, but UUID has poor generation performance, untraceability, irreversible solution, and disorder. If UUID is used as the primary key of the database, it will cause database writing problems
[0004] 2. The implementation of the database method is generally realized by generating a primary key from the data and setting a specific primary key step size. This implementation scheme has poor performance and poor horizontal expansion capabilities, and at the same time relies on the database, which increases personnel maintenance costs
In a distributed environment with rapid development and high performance requirements, it is impossible to meet user needs

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
  • Unique key generation method and device and terminal equipment
  • Unique key generation method and device and terminal equipment
  • Unique key generation method and device and terminal equipment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0050] like figure 1 As shown, this embodiment provides a method for generating a unique key, which can be applied to terminal devices such as PCs, tablet computers, and mobile phones. The unique key generation method provided by this embodiment includes:

[0051] S101. Obtain data to be generated.

[0052] In specific applications, it is necessary to generate data to be generated with a globally unique primary key in the business system of the distributed system software. Among them, the unique primary key, referred to as the unique key, is used to summarize data, divide data, track data sources, and realize sub-databases function and sub-table function.

[0053] S102. Correspondingly generate service instance codes according to the sequence of service instances of the data to be generated.

[0054] In a specific application, the corresponding service instance code is generated according to the order of the service instances of the data to be generated, wherein the order o...

Embodiment 2

[0101] like figure 2 As shown, this embodiment provides a unique key generating device 100 for performing the method steps in Embodiment 1. The unique key generating device 100 provided in this embodiment includes:

[0102] An acquisition module 101, configured to acquire data to be generated;

[0103] The first generating module 102 is configured to correspondingly generate service instance codes according to the sequence of service instances of the data to be generated;

[0104] The second generation module 103 is used for correspondingly generating year, week, week and second according to actual time;

[0105] The third generation module 104 is used to correspondingly generate the serial number, extension and version according to preset rules;

[0106] Synthesis module 105, for synthesizing the above-mentioned generated field into a unique key according to the unique key basic data structure, and marking the unique key in the data to be generated; wherein, the generated...

Embodiment 3

[0129] image 3 It is a schematic diagram of a terminal device provided by an embodiment of the present invention. like image 3 As shown, the terminal device 3 of this embodiment includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and operable on the processor 30, such as a unique key generation program. When the processor 30 executes the computer program 32, the steps in the above-mentioned embodiments of the unique key generation method are realized, for example figure 1 Steps S101 to S105 are shown. Alternatively, when the processor 30 executes the computer program 32, it realizes the functions of the modules / units in the above-mentioned device embodiments, for example figure 2 The functions of modules 101 to 105 are shown.

[0130] Exemplarily, the computer program 32 can be divided into one or more modules / units, and the one or more modules / units are stored in the memory 31 and executed by the processor 30 to complete this inven...

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 method is suitable for the technical field of distributed systems. The invention provides a unique key generation method, device and terminal equipment, The method comprises the following steps of: Obtaining data to be generated, correspondingly generating a service instance code according to the service instance sequence of the to-be-generated data, correspondingly generating a year, a week,weekdays and a second according to actual time, correspondingly generating a serial number, an expansion bit and a version according to a preset rule, synthesizing the generated field into a unique key according to a unique key basic data structure, and labeling the unique key in the to-be-generated data; Wherein the generation field comprises service instance codes, years, weeks, weekdays and seconds, serial numbers, extension bits and versions. The method can ensure that the unique key data is not repeated in a single-machine scene, and meets the basic requirements of distributed global uniqueness, orderliness, inverse solvability, high performance, expandability, readability and the like.

Description

technical field [0001] The invention belongs to the technical field of distributed systems, and in particular relates to a unique key generation method, device and terminal equipment. Background technique [0002] In a distributed environment, the processing method of generating a unique key is generally realized through a universally unique identifier (UUID, Universally Unique Identifier) ​​calculation rule or a database generation method. [0003] Among them, 1. UUID calculation rules guarantee the uniqueness of the global system, but UUID has poor generation performance, untraceability, irreversible solution, and disorder. If UUID is used as the primary key of the database, it will cause database writing problems. [0004] 2. The implementation of the database method is generally achieved by generating a primary key from the data and setting a specific primary key step size. This implementation scheme has poor performance and poor horizontal expansion capabilities, and it...

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): G06F16/21G06F16/22G06F16/2455
Inventor 白国栋
Owner 江西猛犸能源有限公司
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