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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com