CN103514216B - Serial numbers based on Database Systems generate method - Google Patents

Serial numbers based on Database Systems generate method Download PDF

Info

Publication number
CN103514216B
CN103514216B CN201210219713.8A CN201210219713A CN103514216B CN 103514216 B CN103514216 B CN 103514216B CN 201210219713 A CN201210219713 A CN 201210219713A CN 103514216 B CN103514216 B CN 103514216B
Authority
CN
China
Prior art keywords
serial number
data base
service processes
serial
described data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210219713.8A
Other languages
Chinese (zh)
Other versions
CN103514216A (en
Inventor
刘宾
冀乃庚
李筑埭
傅宜生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Unionpay Co Ltd
Original Assignee
China Unionpay Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN201210219713.8A priority Critical patent/CN103514216B/en
Publication of CN103514216A publication Critical patent/CN103514216A/en
Application granted granted Critical
Publication of CN103514216B publication Critical patent/CN103514216B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of serial numbers based on Database Systems and generate method, described serial number is for distinguishing the business in the multiple units communicated with described data base, described serial number generates method and includes: when receiving the serial number distribution request that the serial number request process accessing described data base proposes, one section of continuous print serial number headed by current first available serial number is distributed to serial number service processes;And the serial number distributing to described serial number service processes is removed from currently available serial number.The application of the invention, can improve the performance of system and still provide stable service when Database Systems generation problem.

Description

Serial numbers based on Database Systems generate method
Technical field
Present invention relates in general to Database Systems, particularly relate to the technology to the traffic assignments serial number in the unit communicated with data base.
Background technology
By data base and multiple mutual with this data base and be independently processed from the Distributed Computer System that the unit of business forms, in order to distinguish the purpose of the multiple business carried out in each unit, need for each the unique serial number of traffic assignments, the value of serial number circulates repeatedly within the specific limits, and does not repeats in the range of the regular hour.For keeping the high reliability of system and high concurrent processing ability, current most of such Distributed Computer System uses the system architecture of distributed parallel, but serial number therein distribution still needs to the most unified mode and generates.In this case, existing scheme has the disadvantage in that
1, in the case of multimachine, many application, centralized distribution serial number produces bigger adverse effect to systematic function;
2, the conforming ability of system serial number that keeps during system active-standby switch is lacked;
3, after system is recovered from the fault that main frame or data base cause, system serial number easily repeats.
Still there is no to solve well the scheme of the problems referred to above at present.
Summary of the invention
In order at least solve an aspect of the problems referred to above, the present invention proposes a kind of serial numbers based on Database Systems and generates method, described serial number is for distinguishing the business in the multiple units communicated with described data base, described serial number generates method and includes: when receiving the serial number distribution request that the serial number request process accessing described data base proposes, one section of continuous print serial number headed by current first available serial number is distributed to serial number service processes;And the serial number distributing to described serial number service processes is removed from currently available serial number.
In serial number generation method according to an aspect of the present invention, primary distribution gives the number of the serial number of described serial number service processes less than the half of serial number total size in described data base divided by the result of the number of serial number service processes.
In serial number generation method according to an aspect of the present invention, serial number service processes once applies for that the number of the serial number obtained is more than the traffic peak number result divided by the number of serial number service processes of each second.
Business described in serial number generation method according to an aspect of the present invention is the transaction occurred in financial transaction system.
The present invention proposes a kind of serial numbers based on Database Systems and generates method, described serial number is for distinguishing the business in the multiple units communicated with described data base, and described serial number generates method and includes: is accessed described data base by serial number request process and proposes serial number distribution request;Obtain one section of continuous print serial number headed by current first available serial number in described data base;And before the one section of continuous print serial number obtained distributes, only the serial number obtained is sequentially allocated and does not visit again data base to business.
Serial numbers based on Database Systems according to an aspect of the present invention generate method, wherein, described data base includes primary data base and standby database, and provided service by primary data base under normal circumstances, when primary data base go wrong and thus by standby database provide service time, first serial number request process accessing described standby database will be based on existing serial number section, skip the initial usable levels as next section of serial number after a segment limit, update current first the available serial number in described standby database simultaneously.
Serial number according to an aspect of the present invention generates method, wherein, when described database manipulation failure, reuses serial number service processes once at the upper serial number once applied for described data base.
Serial number according to an aspect of the present invention generates method, wherein, described serial number service processes primary distribution to the number of serial number less than the half of serial number total size in described data base divided by the result of the number of serial number service processes.
Serial number according to an aspect of the present invention generates method, and the number of the serial number that wherein said serial number service processes obtains is more than the traffic peak result divided by the number of serial number service processes of each second.
The application of the invention, can improve the performance of system and still provide stable service when Database Systems generation problem.
Accompanying drawing explanation
For ease of understanding, by not limiting example, embodiments of the invention are described with reference to the accompanying drawings.In figure:
Fig. 1 shows that the serial number of Database Systems according to an embodiment of the invention generates the basic procedure of method;
Fig. 2 shows that the serial number of Database Systems generates a method application in financial transaction system.
Detailed description of the invention
Illustrate unless separately added, as from discussion below it can also be recognized that as, this specification in the whole text in, utilize such as " distribute ", " acquisition ", the discussion expression of " renewal " etc term use action or the process of the such as particular device of computer or similar computing electronics etc.In the context of the present specification, computer or similar computing electronics can be handled or convert signal.These signals are typically expressed as physical electronic or the quantity of magnetism in computer or the memorizer of similar computing electronics, depositor or out of Memory storage device, transmitting device or display device.Such as, computing electronics can include the one or more processor performing one or more specific functions.
As it is shown in figure 1, in the present invention, when system receives the serial number distribution request of the serial number service processes from unit, system can distribute, to it, the one section of continuous print serial number started from current first available serial number.Then, himself currently available serial number of database update.Here, the distribution to serial number asks simply just can send when unallocated or allocated serial number section is finished.
Assuming on sometime, serial number available in system is xxx01 to xxx99, the numeral during wherein x represents a 0-9.When serial number distribution request sent by a certain and this database communication unit, start from xxx01 one section of such as 20 serial number is distributed to this unit by this system.Serial number allocated during this sub-distribution will be for xxx01-xxx20.Then, the serial number that it is currently available is updated to xxx21 to xxx99 by system.When serial number distribution request sent by next unit, its first serial number obtained will be for xxx21.
Unit, when sending serial number distribution request, is likely encountered and provides the primary data base of service to go wrong before and thus turn the situation being provided service by standby database.Now, this unit is by based on serial number section existing in the internal memory of its serial number service processes, skip the initial usable levels as next section of serial number of the value after a segment limit, current first the available serial number in described standby database is updated to described initial usable levels simultaneously.
Owing to distributed system existing multi-course concurrency operation, therefore, first a process from a unit can complete this operation, next section for avoiding each process follow-up to be all as the criterion in more new database with the serial number section used in self current memory can use serial number, when next section in process more new database can use serial number, to be updated according to the principle of timestamp priority, the data in data base are i.e. only had to update timestamp old times when obtaining serial number section than the current process time, process just can use serial number with next section that self current data is as the criterion in more new database, otherwise, serial number service processes is still as the criterion with the current data in data base and acquires one section of available serial number scope, simultaneously, data in more new database, produce next section and can use serial number.
Unit is when sending serial number distribution request, and another situation being likely encountered is database manipulation failure, at this point it is possible to reuse serial number service processes once at the upper serial number once applied for described data base.
In order to both ensure that in being effectively reduced the unit interval, serial number distributes the number asked, ensure again to be unlikely to go wrong from main part to the handoff procedure of backup data base, primary distribution could be arranged to less than the half of serial number total size in described data base divided by the result of the number of serial number service processes to the number of the serial number of described serial number service processes, and is more than the traffic peak number result divided by the number of serial number service processes of each second.
The most the detailed description of the invention to the present invention has made detailed description, and those skilled in the art can be fully understood by realizing the optimal way of the present invention.Hereinafter again present invention application in the data process business of financial field is given one example.
In financial transaction system, a wide variety of system is that POS receives single system.It includes primary data base, standby database, and multiple independent agency.Under normal circumstances, independent agency and primary database communication.In the case of primary data base occurs extremely, standby database take over the work of primary data base.When trading processing, the transaction of multiple mechanisms is assigned to serial number from data base, and each inter-agency serial number can repeat, but an in-house serial number distribution needs to keep unique.
As in figure 2 it is shown, after starting step S201, first obtain Institution Code in step S202.In step S203, in the internal memory of independent agency system, inquire about the serial number of mechanism according to Institution Code.In step S204, check in internal memory whether there is above-mentioned serial number.If it is, the most successfully obtained one section of serial number from data base before i.e. illustrating, then turn to step S205, wherein judge that whether current serial number is more than current session maximum.If it is determined that result be "No", i.e. explanation currently still has serial number to use, and need not then turn to step S206 with database communication, wherein take the currently available serial number of mechanism to requestor, and in step S207, the numeral of the currently available serial number of this mechanism in internal memory is added one.So far, currently available serial number has been the next serial number after the serial number just having distributed to requestor.
If whether the result checked in step S204, or the result judged in step S205 is "Yes", then turn to step S208.Never getting serial number before the former explanation system from data base, the latter then illustrates that the serial number distributed before has run out.In step S208, to attempt obtaining the serial number of this next section of mechanism from data base.Then in step S209, judge whether data base exists the serial number information of this mechanism, if result is "Yes", then turn to step S210, it is judged that whether internal memory is empty or new than in internal memory of data-base recording new time.If it is, turn to step S212, wherein take the serial number in data base.If whether the result judged in step S210, then turn to step S211, from internal memory, construct next section wherein can use serial number.Then turn to step S213, next section of serial number section in more new database.Equally, step S213 is also gone to after step S212.Going to step S206 after step S213, it hereinbefore has been carried out introducing.
If the result judged in step S209 is "No", then turns to step S214, wherein judge whether internal memory has available serial number, if it has, then turn to step S216, from internal memory, construct next section can use serial number.If the result that step S214 judges is not have, then turn to step S215, i.e. one section of available serial number of neotectonics.All turning to step S217 after step S215 and step S216, the serial number of the front construction of basis inserts a new record to data base wherein.Then turning to step S218, check that whether the new record of insertion has with existing record wherein and conflict, if it has, then return again to step S208, if it is not, go to step S206, its particular content has been described above introducing.
Method described here can be realized by various modes based in part on application according to special characteristic or example.Such as, this method can be realized by hardware, firmware, software or their any combination.In hardware realizes, such as, device can realize in one or more special ICs (ASICs), digital signal processor (DSPs), digital signal processing device (DSPDs), PLD (PLDs), field programmable gate array (FPGAs), processor, controller, microcontroller, microprocessor, electronic installation or other device unit being designed to carry out all functions as described herein or their any combination.
Equally, in certain embodiments, method can use execution function described here or their any combination of module to realize.Such as, any machine readable media visibly embodying instruction can use in realizing this kind of method.In one embodiment, such as, software or code are storable in running in memorizer and by processing unit.Memorizer can realize in processing unit and/or outside processing unit.Term used herein above " memorizer " represents any kind of long-term, short-term, volatibility, non-volatile or other memorizer, and is not limited to any particular type of memorizer or the quantity of memorizer or the type of storage medium.
Storage medium can include any usable medium that can be accessed by computer, calculating platform, calculating device etc..As an example rather than limit, computer-readable medium can include RAM, ROM, EEPROM, CD-ROM or other optical disc storage, disk storage or other magnetic memory apparatus, or can be used for carrying or storing taking instruction or the desired program code of data structure form and other any medium that can be accessed by computer, calculating platform or calculating device.
Although being illustrated above the content being presently considered to be exemplary characteristics, it will be understood by those skilled in the art that in the case of without departing substantially from claimed theme, specific embodiment described in the present invention can be carried out various amendment.It is therefore desirable to the theme of protection is not limited to disclosed particular example, on the contrary, that includes all the elements fallen within the scope of the appended claims.

Claims (8)

1. A kind of serial numbers based on Database Systems generate method, and described serial number is for distinguishing the business in the multiple units communicated with described data base, and described serial number generates method and includes:
When receiving the serial number distribution request that the serial number request process accessing described data base proposes, one section of continuous print serial number headed by current first available serial number is distributed to serial number service processes;And
The serial number distributing to described serial number service processes is removed from currently available serial number,
Wherein, described data base includes primary data base and standby database, and provided service by primary data base under normal circumstances, when primary data base go wrong and thus by standby database provide service time, first serial number service processes accessing described standby database will be based on existing serial number section, skip the initial usable levels as next section of serial number after a segment limit, update current first the available serial number in described standby database simultaneously.
2. serial number as claimed in claim 1 generates method, wherein, distributes to the number of serial number of described serial number service processes less than the half of serial number total size in described data base divided by the result of the number of serial number service processes.
3. serial number as claimed in claim 2 generates method, and wherein, serial number service processes once applies for that the number of the serial number obtained is more than the traffic peak number result divided by the number of serial number service processes of each second.
4. serial number as claimed in claim 1 generates method, and wherein said business is the transaction occurred in financial transaction system.
5. serial numbers based on Database Systems generate a method, and described serial number is for distinguishing the business in the multiple units communicated with described data base, and described serial number generates method and includes:
Accessed described data base by serial number request process and propose serial number distribution request;
Obtain one section of continuous print serial number headed by current first available serial number in described data base;And
Before the one section of continuous print serial number obtained distributes, only the serial number obtained is sequentially allocated and does not visit again data base to business,
Wherein, described data base includes primary data base and standby database, and provided service by primary data base under normal circumstances, when primary data base go wrong and thus by standby database provide service time, first serial number service processes accessing described standby database will be based on existing serial number section, skip the initial usable levels as next section of serial number after a segment limit, update current first the available serial number in described standby database simultaneously.
6. serial number as claimed in claim 5 generates method, wherein, when described database manipulation failure, reuses serial number request process once at the upper serial number once applied for described data base.
7. serial number as claimed in claim 5 generates method, wherein, described serial number service processes primary distribution to the number of serial number less than the half of serial number total size in described data base divided by the result of the number of serial number service processes.
8. serial number as claimed in claim 7 generates method, and the number of the serial number that wherein said serial number service processes obtains is more than the traffic peak result divided by the number of serial number service processes of each second.
CN201210219713.8A 2012-06-29 2012-06-29 Serial numbers based on Database Systems generate method Active CN103514216B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210219713.8A CN103514216B (en) 2012-06-29 2012-06-29 Serial numbers based on Database Systems generate method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210219713.8A CN103514216B (en) 2012-06-29 2012-06-29 Serial numbers based on Database Systems generate method

Publications (2)

Publication Number Publication Date
CN103514216A CN103514216A (en) 2014-01-15
CN103514216B true CN103514216B (en) 2016-12-21

Family

ID=49896949

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210219713.8A Active CN103514216B (en) 2012-06-29 2012-06-29 Serial numbers based on Database Systems generate method

Country Status (1)

Country Link
CN (1) CN103514216B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103761793A (en) * 2014-01-24 2014-04-30 北京壹平台科技有限公司 Data processing method of electronic instant lottery ticket
CN103824245A (en) * 2014-03-10 2014-05-28 北京壹平台科技有限公司 Issuing data processing method of electronic instant lottery
CN103824246A (en) * 2014-03-10 2014-05-28 北京壹平台科技有限公司 Method for distributing and issuing lottery tickets according to electronic instant lottery ticket data
CN105095263B (en) * 2014-05-08 2019-12-17 创新先进技术有限公司 method and device for generating card number
CN106326410A (en) * 2016-08-23 2017-01-11 无锡天脉聚源传媒科技有限公司 Data inquiry method and device
CN107908697B (en) * 2017-11-03 2022-01-14 中国银行股份有限公司 Automatic collection method and device for host batch processing operation results
CN109947846B (en) * 2018-11-30 2021-06-15 网联清算有限公司 Transaction data processing method and device, computer equipment and storage medium
CN109828990A (en) * 2019-02-02 2019-05-31 中国银行股份有限公司 A kind of transaction journal generation method, server, equipment and medium
CN112667685B (en) * 2020-12-29 2024-04-16 北京先进数通信息技术股份公司 Method, device, equipment and storage medium for configuring serial numbers

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6950961B2 (en) * 2001-02-13 2005-09-27 Hewlett-Packard Development Company, L.P. Highly available, monotonic increasing sequence number generation
CN101237331A (en) * 2007-12-27 2008-08-06 华为技术有限公司 CDR file generation method, transmission method, system and device
CN101504698A (en) * 2009-03-20 2009-08-12 中国网通集团宽带业务应用国家工程实验室有限公司 Inspection application processing method and system, and laboratory information system platform
KR20100042922A (en) * 2008-10-17 2010-04-27 노틸러스효성 주식회사 System for controlling sequence number call

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6950961B2 (en) * 2001-02-13 2005-09-27 Hewlett-Packard Development Company, L.P. Highly available, monotonic increasing sequence number generation
CN101237331A (en) * 2007-12-27 2008-08-06 华为技术有限公司 CDR file generation method, transmission method, system and device
KR20100042922A (en) * 2008-10-17 2010-04-27 노틸러스효성 주식회사 System for controlling sequence number call
CN101504698A (en) * 2009-03-20 2009-08-12 中国网通集团宽带业务应用国家工程实验室有限公司 Inspection application processing method and system, and laboratory information system platform

Also Published As

Publication number Publication date
CN103514216A (en) 2014-01-15

Similar Documents

Publication Publication Date Title
CN103514216B (en) Serial numbers based on Database Systems generate method
CN107844268B (en) Data distribution method, data storage method, related device and system
EP3100184B1 (en) Prioritizing data reconstruction in distributed storage systems
CN102696017B (en) Method and system for maintaining data storage reliability
US10353787B2 (en) Data stripping, allocation and reconstruction
CN109886693B (en) Consensus realization method, device, equipment and medium for block chain system
CN1987804A (en) Method and system for securing redundancy in parallel computing sytem
CN102594858A (en) Mirroring solution in cloud storage environment
US10929043B2 (en) Space reservation for distributed storage systems
KR100922584B1 (en) Distributed object-sharing system and method thereof
CN115167782B (en) Temporary storage copy management method, system, equipment and storage medium
CN111338834B (en) Data storage method and device
US20120245793A1 (en) Multi-cell voltage secure data encoding in hybrid vehicles
US20120084499A1 (en) Systems and methods for managing a virtual tape library domain
CN106951443B (en) Method, equipment and system for synchronizing copies based on distributed system
CN109919768B (en) Block generation method, device, medium and computing equipment
US20080250421A1 (en) Data Processing System And Method
US9934106B1 (en) Handling backups when target storage is unavailable
CN111124294A (en) Sector mapping information management method and device, storage medium and equipment
CN110018798A (en) One kind writing data performance optimization method, device, equipment and storage medium
CN115756955A (en) Data backup and data recovery method and device and computer equipment
CN109981767A (en) HANA data bank access method, device, system, equipment and storage medium
CN112131191B (en) Management method, device and equipment of NAMENODE file system
CN115344214A (en) Data reading and writing method, device, server and computer readable storage medium
CN111338574B (en) Data self-repairing method, device, medium and electronic equipment based on block chain

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant