A serial number processing method and device

A processing method and serial number technology, which is applied in the computer field, can solve problems such as the inability to write data records, and achieve the effect of sharing and weakening dependencies

Active Publication Date: 2016-05-04
ALIBABA GRP HLDG LTD
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0013] The embodiment of the present application provides a serial number processing method and equipment to solve the problem in the prior art that data records cannot be written into the database after the serial numbers in some databases are exhausted

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 serial number processing method and device
  • A serial number processing method and device
  • A serial number processing method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0030] like figure 1 As shown, it is a schematic diagram of the steps of the serial number processing method in Embodiment 1 of the present application, and the method includes the following steps:

[0031] Step 101: When the server needs to write data records into the database, it selects a database from multiple databases according to the set database query sequence, and reads the sequence table in the selected database.

[0032] Usually, a database architecture can contain multiple servers and multiple databases, and any one server can perform operations such as querying, writing, and deleting data records for each database belonging to the same database architecture; preferably, Considering that in the actual process, when the business system is started, multiple servers may obtain the serial number from the sequence table of a certain database at the same time, which will cause serial number preemption conflicts. In order to reduce the probability of serial number preempt...

Embodiment 2

[0084] In consideration of avoiding preemptive conflicts when servers acquire serial numbers, ensuring the uniqueness of serial numbers acquired by each server, and ensuring the consistency and integrity of the database, this embodiment 2 describes the preferred implementation of this embodiment 1 in detail in combination with lock technology Program.

[0085] like figure 2 As shown, it is a schematic diagram of the steps of the serial number processing method in Example 2 of the present application, and the method includes the following steps:

[0086] Step 201: the server acquires a synchronization lock.

[0087] The granularity of the synchronization lock is the data group table.

[0088] The data group table is a general term for the data tables that record the same business in each of the multiple databases, and each data record in the data tables that make up the data group table needs to obtain a globally unique available serial number.

[0089] Acquiring the synchr...

Embodiment 3

[0113] Embodiment 3 of this application proposes a serial number processing device under the same idea as Embodiment 1, such as image 3 As shown, including: selection module 11, acquisition module 12 and writing module 13, wherein:

[0114] The selection module 11 is used to select a database from multiple databases according to the set database query sequence when the data record needs to be written into the database, and read the sequence table in the selected database;

[0115] An acquisition module 12, configured to acquire N available serial numbers from the read sequence table, where N is a positive integer;

[0116] The writing module 13 is configured to write the data record into the database according to the acquired available serial number.

[0117] Specifically, the selection module 11 includes:

[0118] The first selection unit 21 is configured to randomly select a database from the plurality of databases when writing data records into the database for the first...

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 a method and a device for processing serial numbers. When a server is required to write data records in a data bank, one data bank is selected from a plurality of data banks according to a set data bank inquiry sequence, a sequence list in the selected data bank is read, N available serial numbers are obtained from the read sequence list and the data records are written in the data bank by using the available serial numbers. Due to the fact that the server can select one sequence list of one data bank from the plurality of data banks according to the inquiry sequence so that the serial numbers are obtained, acquisition of the serial numbers are not limited in one sequence list in a certain data bank, dependant relationship between the sequence list and the data bank is effectively weakened and sharing of the serial numbers is achieved. Even though the condition that the serial numbers in the certain data bank are exhausted or the data bank malfunctions, the server still can obtain the serial numbers from other data banks and the problem that the data records can not be written in the data bank continuously due to the fact that the serial numbers in a part of the data banks are exhausted is solved.

Description

technical field [0001] The present application relates to the field of computer technology, in particular to a serial number processing method and equipment. Background technique [0002] A sequence table is a database object used to create unique continuous integer values. Its typical use is to create a globally unique sequence number to identify a data record in a data table. When the number of data records in the data table is small, a sequence table can be directly created in the database storing the data table. When adding a new data record, the server obtains the serial number from the sequence table and uses the sequence table The number identifies the newly added data record. [0003] If the number of data records to be recorded in the database reaches or exceeds a certain scale (such as 10 million), as the number of data records continues to increase, if all the data records are recorded in the same data table, then the data in the data table The performance of re...

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 Patents(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