Identifier generation method, system and device based on distributed system and medium

A distributed system and identification technology, applied in the computer field, can solve problems such as difficulty and repeated expansion, and achieve the effects of ensuring timing, improving efficiency, and avoiding ID duplication

Pending Publication Date: 2021-01-08
重庆紫光华山智安科技有限公司
View PDF3 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In view of the shortcomings of the prior art described above, the purpose of this application is to provide a method, system, device and medium for generating identifiers based on a distributed system, which are used to solve the problems of ID duplication and difficulty in expansion that are easily caused by identifier generation in the prior art The problem

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
  • Identifier generation method, system and device based on distributed system and medium
  • Identifier generation method, system and device based on distributed system and medium
  • Identifier generation method, system and device based on distributed system and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 5

[0069] Refer below Figure 5 , which shows a schematic structural diagram of an electronic device (such as a terminal device or a server 700) suitable for implementing an embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but not limited to mobile phones, notebook computers, digital broadcasting Mobile terminals such as receivers, PDA (Personal Digital Assistant), PAD (Tablet Computer), PMP (Portable Multimedia Player), vehicle-mounted terminal (eg, vehicle-mounted navigation terminal), etc., and stationary terminals such as digital TV, desktop computer, etc. Figure 5 The illustrated electronic device is only an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present disclosure.

[0070] like Figure 5 As shown, the electronic device 700 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) ) 703 to perform ...

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 provides an identifier generation method, system and device based on a distributed system and a medium, and the method comprises the steps: obtaining one or more identifier generation requests, and enabling the identifier generation requests to comprise a business KEY value; detecting whether the number of the remaining identifiers in the current cache meets the requirements of the identifier generation request or not; when the number of the remaining identifiers in the cache meets the requirement of an identifier generation request, returning the identifiers to a requester; whenthe number of the remaining identifiers in the cache does not meet the requirement of an identifier generation request, calling a Redis INCR instruction to generate an identifier, and returning the identifier to the cache to meet the identifier generation request; and obtaining the maximum value of the sequence by utilizing the Redis INCR, reversely calculating the initial values to be sequentially increased or decreased to generate identifiers, and determining the generation quantity of the identifiers according to the quantity of the remaining identifiers in the cache and the requirements of identifier generation requests. According to the invention, the identifier generation efficiency is improved; the ID repetition phenomenon is avoided through the sequence IDs generated in sequence,and subsequent capacity expansion is facilitated.

Description

technical field [0001] The present application relates to the computer field, and in particular to a method, system, device and medium for generating an identifier based on a distributed system. Background technique [0002] In some scenarios of Internet and software development, all data objects need a unique identification (Identification, ID), and the service used to generate the ID is called an ID generator (or ID generator). The ID generator includes issuing globally unique IDs for data objects or other services. Data objects can only be stored and used after being assigned an ID. [0003] Existing ID generators ensure the uniqueness of data based on the self-incrementing sequence of the database or UUID (Universal Unique Identification Code). However, when the data reaches a certain level, the system will be upgraded to a distributed cluster architecture. On the one hand, if you continue to use the auto-increment sequence, it will limit the expansion of the database ...

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): G06F40/126
CPCG06F40/126
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