Service identifier generation method and apparatus

A technology for business identification and server identification, applied in the field of business identification generation methods and devices, can solve problems such as business impact, business server cannot assign ID to business instances, and cannot complete business processing, etc., to achieve the effect of reducing the scope of influence

Active Publication Date: 2016-03-30
ALIBABA GRP HLDG LTD
View PDF6 Cites 28 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] However, in the process of implementing the application, the inventor of the application found that at least the following problems exist in the prior art: since multiple service servers share the same centralized ID generator, once the centralized ID generator It is unavailable due to failure, and before the centralized ID generator returns to normal, all the IDs in the ID interval obtained by each business server are used up, which will cause all business servers to be unable to allocate for newly created business instances. ID, so that business processing cannot be completed
Therefore, all businesses on all business servers will be affected at the same time due to the failure of the centralized ID generator

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
  • Service identifier generation method and apparatus
  • Service identifier generation method and apparatus
  • Service identifier generation method and apparatus

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0052] The embodiment of the present application provides a method and device for generating a service identifier based on a distributed environment. Different from multiple service servers sharing the same service identifier generator in the prior art, in the technical solution of the embodiment of the present application, at least one of the multiple service servers is assigned a service identifier generator that only belongs to the service server, That is to say, in the embodiment of the present application, some service servers may share ID generators as in the prior art, while another part of service servers each uniquely correspond to one ID generator, that is, for this part of service servers, one service identifier is generated The server only provides the service of generating service IDs for one service server. Of course, each service server may also uniquely correspond to an ID generator. Wherein, the service identifier generator can be integrated in the service se...

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

Embodiments of the present application disclose a service identifier generation method and apparatus. A service identifier generator is assigned exclusively to at least one service server of a plurality of service servers. The method comprises: a service identifier generator receiving a service identifier obtaining request message (carrying a service server identifier and a service object identifier); in response to the message, querying a current maximum service identifier value of a target service object indicated by the service object identifier, performing hash calculation on the service server identifier, and performing modulo calculation on a preset threshold by using a hash calculation value; and firstly calculating a product of a modulo calculation value and a preset step value, secondly calculating a sum of the product and the maximum service identifier value as a starting value, calculating a sum of the starting value and the preset step value as an ending value, and finally generating an initial service identifier range. According to the method and apparatus provided by the embodiments of the present application, the range of influence of the service identifier generator failure on the service can be reduced, and it can also ensure that the generated service identifier is unique.

Description

technical field [0001] This application relates to the field of computer applications, in particular to a method and device for generating service identifiers. Background technique [0002] In Internet applications, after the business server creates a business instance for each business of the client (the business instance performs business processing), it needs to assign a unique identifier (ID, Identify) to the business instance, and the ID is Business ID. In general, you can use the auto-increment primary key mode of the business database to generate a unique ID for each business instance, and then assign it to each business instance by the business server. [0003] Because the huge amount of data in the Internet environment brings huge access pressure to business databases, business databases are usually divided into databases or tables. The advantage of the sub-database is that it is easy to expand the business database horizontally (horizontally). For example, expan...

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