CN107045445A - A kind of light weight method and system that distributed sequence number is generated based on JAVA chained lists - Google Patents

A kind of light weight method and system that distributed sequence number is generated based on JAVA chained lists Download PDF

Info

Publication number
CN107045445A
CN107045445A CN201710253435.0A CN201710253435A CN107045445A CN 107045445 A CN107045445 A CN 107045445A CN 201710253435 A CN201710253435 A CN 201710253435A CN 107045445 A CN107045445 A CN 107045445A
Authority
CN
China
Prior art keywords
sequence number
sequence
generation
java
distributed
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.)
Granted
Application number
CN201710253435.0A
Other languages
Chinese (zh)
Other versions
CN107045445B (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.)
Beijing Si Tech Information Technology Co Ltd
Original Assignee
Beijing Si Tech Information Technology 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 Beijing Si Tech Information Technology Co Ltd filed Critical Beijing Si Tech Information Technology Co Ltd
Priority to CN201710253435.0A priority Critical patent/CN107045445B/en
Publication of CN107045445A publication Critical patent/CN107045445A/en
Application granted granted Critical
Publication of CN107045445B publication Critical patent/CN107045445B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Abstract

The present invention relates to a kind of light weight method and system that distributed sequence number is generated based on JAVA chained lists, belong to sequence number generation field, complicated integral structure when solving the formation sequence under distributed environment, the problem of complexity is big when being difficult to change and dock with external system.The present invention generates the sequence number of setting quantity with default generating mode by generating parameter according to the sequence number in default configuration file, and is stored in the global variable chained list of the JAVA of distributed deployment applications;The position of last sequence number in the sequence number of the setting quantity of generation recorded in sequence number generation parameter corresponding in the configuration file;Shearing with synchronization mechanism is carried out to the sequence number in the global variable chained list according to the quantity of the sequence number of required acquisition, the sequence number of requirement is obtained.For being that the generation of unique sequence numbers under distributed deployment can be achieved by easy configuration in the case where taking the hardware and underlying resource of lightweight.

Description

A kind of light weight method and system that distributed sequence number is generated based on JAVA chained lists
Technical field
Field is generated the present invention relates to sequence number, more particularly to it is a kind of based on the light of the distributed sequence number of JAVA chained lists generation Magnitude method and system.
Background technology
With developing rapidly for computer technology, present software application system is to distributed application development. Original some technologies and method have not been applied in distributed system, as long as by number in the application system of non-distributed Can formation sequence number according to some mechanism of storehouse system (mode of disparate databases sequence number generation is different with occupation mode).And The generation of sequence number in a distributed system, can be because the factor such as high concurrent, the request of many service ends, results in relying on Database Systems The mechanism of offer can not meet.Formation sequence mode is two kinds under existing Distributed Application, and one kind is by independent A kind of ZooKeeper (distributed service framework) server distributed system formation sequence number, the shortcoming of which is:Should With system in formation sequence, it is desirable to dispose a set of ZooKeeper Distributed Applications, the ability that ZooKeeper is provided is relied on, There are problems that ZooKeeper single-point hostdowns;It is another be by being encoded to data-base cluster, and in cluster from Increase field and collectively constitute unique major key, the shortcoming of which is:Table is operation associated relatively complicated, it is necessary to two field conducts Joint major key, switchs to compound primary key for existed system by single major key, changes cost increase, and when being docked with external system Complexity increase.
The content of the invention
The technical problems to be solved by the invention are in view of the shortcomings of the prior art there is provided one kind based on the generation of JAVA chained lists The light weight method and system of distributed sequence number, it is therefore intended that in JAVA application software to during distributed deployment, independent of it His software and application, are that the generation of unique sequence numbers under distributed deployment can be achieved by easy configuration, it is only necessary to take light weight The hardware and underlying resource of level, can guarantee that the continuity of sequence number generation and are prevented effectively from repetition, and the synchronous machine for passing through JAVA System realizes that sequence number provides uniqueness.
The technical scheme that the present invention solves above-mentioned technical problem is as follows:
A kind of light weight method that distributed sequence number is generated based on JAVA chained lists, is comprised the following steps:
S1, parameter is generated with default generating mode generation setting quantity according to the sequence number in default configuration file Sequence number, and the sequence number of the setting quantity of generation is stored in the global variable chained list of the JAVA of distributed deployment applications;
S2, the position of last sequence number in the sequence number of the setting quantity of generation recorded in the configuration file In corresponding sequence number generation parameter;
S3, band synchronous machine is carried out to the sequence number in the global variable chained list according to the quantity of the sequence number of required acquisition The shearing of system, obtains the sequence number of requirement.
The beneficial effects of the invention are as follows:By the currently available sequence number of the global storage of linked list of JAVA, in JAVA application software It is that unique sequence code under distributed deployment can be achieved by easy configuration independent of other software and application to during distributed deployment Number generation, it is only necessary to take the hardware and underlying resource of lightweight.The position of formation sequence number is recorded after formation sequence number Put, it is ensured that the continuity of sequence number generation and be prevented effectively from repetition, and realize that sequence number is provided only by JAVA synchronization mechanism One property.
On the basis of above-mentioned technical proposal, the present invention can also do following improvement:
Further, the sequence number generation parameter in the configuration file includes:Using coding, default queue length, sequence Initial value and current sequence maximum;The current sequence maximum is used in the sequence number for the setting quantity that record has been generated It is in the position of last sequence number, the S1 during sequence number of the quantity of generation setting first, current sequence maximum is initial Turn to the value equal with sequence initial value.
Beneficial effect using above-mentioned further scheme is:Configuration file can set many kinds of parameters, can be by configuring Meet the requirement of various types of sequence number.
Further, the process for generating the sequence number for setting quantity described in the S1 with default generating mode includes:Root According to the incrementally formation sequence value of the current sequence maximum in the configuration file, it will assemble and give birth to sequential value using coding The sequence number of the quantity set into the default queue length.
Beneficial effect using above-mentioned further scheme is:Incrementally again with applying code set after formation sequence value Composition sequence number, can need to generate various types of sequence numbers according to different scenes, adapt to multiple use;The sequence of generation It is number continuous regular, with uniqueness, it is prevented effectively from repetition.
Further, the global variable chained list is first judged before the shearing of the progress with synchronization mechanism in the S3 Whether length meets the length needed for this shearing, if so, the shearing of mechanism is then synchronized, if it is not, then performing S1.
Beneficial effect using above-mentioned further scheme is:The length of global variable chained list is first judged before shearing sequence number Degree, the problem of can preventing from needing the sequence number that is produced during long-term a large amount of shearing sequence numbers not enough in real process, so that shape , can continuous continual offer sequence number into an automatic rounded system.
Further, methods described also includes:
S4, carries out adding default prefix, group before the sequence number that gets after the shearing with synchronization mechanism in the S3 Conjunction obtains required sequence number.
Beneficial effect using above-mentioned further scheme is:The bigger type for enriching sequence number, it is adaptable to it is more not Same application scenarios.
A kind of lightweight system that distributed sequence number is generated based on JAVA chained lists, including with lower module:
Sequence number generation module, for generating parameter according to the sequence number in default configuration file with default generation side Formula generation setting quantity sequence number, and by the sequence number of the setting quantity of generation be stored in distributed deployment JAVA apply In global variable chained list;
Sequence number logging modle, for the position of last sequence number in the sequence number of the setting quantity of generation to be recorded Into the configuration file in corresponding sequence number generation parameter;
Sequence number acquisition module, the quantity for the sequence number according to required acquisition is to the sequence in the global variable chained list Row number carries out the shearing with synchronization mechanism, obtains the sequence number of requirement.
The beneficial effects of the invention are as follows:By the currently available sequence number of the global storage of linked list of JAVA, in JAVA application software It is that unique sequence code under distributed deployment can be achieved by easy configuration independent of other software and application to during distributed deployment Number generation, it is only necessary to take the hardware and underlying resource of lightweight.The position of formation sequence number is recorded after formation sequence number Put, it is ensured that the continuity of sequence number generation and be prevented effectively from repetition, and realize that sequence number is provided only by JAVA synchronization mechanism One property.
On the basis of above-mentioned technical proposal, the present invention can also do following improvement:
Further, the sequence number generation parameter in the configuration file includes:Using coding, default queue length, sequence Initial value and current sequence maximum;The current sequence maximum is used in the sequence number for the setting quantity that record has been generated The position of last sequence number, the sequence number generation module first formation sequence when, current sequence maximum is initial Turn to the value equal with sequence initial value.
Beneficial effect using above-mentioned further scheme is:Configuration file can set many kinds of parameters, can be by configuring Meet the requirement of various types of sequence number.
Further, default generating mode is described in the sequence number generation module:According in the configuration file Current sequence maximum incrementally formation sequence value, will be using coding and the sequential value assembling generation default queue length The sequence number of the quantity of setting.
Beneficial effect using above-mentioned further scheme is:Incrementally again with applying code set after formation sequence value Composition sequence number, can need to generate various types of sequence numbers according to different scenes, adapt to multiple use;The sequence of generation It is number continuous regular, with uniqueness, it is prevented effectively from repetition.
Further, default generating mode is described in the sequence number generation module:According in the configuration file Current sequence maximum incrementally formation sequence value, will be using coding and the sequential value assembling generation default queue length The sequence number of the quantity of setting.
Beneficial effect using above-mentioned further scheme is:The length of global variable chained list is first judged before shearing sequence number Degree, the problem of can preventing from needing the sequence number that is produced during long-term a large amount of shearing sequence numbers not enough in real process, so that shape , can continuous continual offer sequence number into an automatic rounded system.
Further, the system also includes:
Sequence number composite module, for what is got after the sequence number acquisition module carries out the shearing with synchronization mechanism Default prefix is added before sequence number, combination obtains required sequence number.
Beneficial effect using above-mentioned further scheme is:The bigger type for enriching sequence number, it is adaptable to it is more not Same application scenarios.
Brief description of the drawings
Fig. 1 is a kind of stream for the light weight method that distributed sequence number is generated based on JAVA chained lists in the embodiment of the present invention 1 Cheng Tu;
Fig. 2 is a kind of original for the lightweight system that distributed sequence number is generated based on JAVA chained lists in the embodiment of the present invention 2 Manage block diagram.
Embodiment
The principle and feature of the present invention are described below in conjunction with accompanying drawing, the given examples are served only to explain the present invention, and It is non-to be used to limit the scope of the present invention.
Embodiment 1
As shown in figure 1, a kind of light weight method that distributed sequence number is generated based on JAVA chained lists, is comprised the following steps:
S1, parameter is generated with default generating mode generation setting quantity according to the sequence number in default configuration file Sequence number, and the sequence number of the setting quantity of generation is stored in the global variable chained list of the JAVA of distributed deployment applications;
S2, the position of last sequence number in the sequence number of the setting quantity of generation recorded relative in configuration file In the sequence number generation parameter answered;
S3, is carried out with synchronization mechanism according to the quantity of the sequence number of required acquisition to the sequence number in global variable chained list Shearing, obtains the sequence number of requirement.
The present invention is by the global currently available sequence numbers of storage of linked list of JAVA, in JAVA application software to distributed deployment When, independent of other software and application, it is that the generation of unique sequence numbers under distributed deployment can be achieved by easy configuration, only needs Take the hardware and underlying resource of lightweight.The position of formation sequence number is recorded after formation sequence number, it is ensured that sequence number The continuity of generation and repetition is prevented effectively from, and realizes that sequence number provides uniqueness by JAVA synchronization mechanism.
Further, the sequence number generation parameter in configuration file includes:It is initial using coding, default queue length, sequence Value and current sequence maximum;Current sequence maximum is used for last in the sequence number for the setting quantity that record has been generated In the position of sequence number, S1 first generation setting quantity sequence number when, by current sequence maximum be initialized as with the beginning of sequence The equal value of initial value.
Specifically, the parameter included in configuration file has:Using coding, default queue length, sequence initial value and current Sequence maximum.First during formation sequence, current sequence maximum is initialized as to the value equal with sequence initial value, that is, worked as The position of last sequence number is the value equal with sequence initial value in the preceding sequence number generated.Such as sequence initial value can To be set to 100000000, then first formation sequence when, the position of last sequence number is in the sequence number currently generated 100000000, subsequently generate sequence number on the basis of this position.
In the improvement, configuration file can set many kinds of parameters, can meet various types of sequence by configuring Number requirement.
Further, the process for generating the sequence number for setting quantity in S1 with default generating mode includes:According to configuration text Current sequence maximum in part incrementally formation sequence value, will be long using coding and sequential value assembling generation default queue Spend the sequence number of the quantity of setting.
Specifically, in formation sequence first, first reading the sequence number generation parameter in configuration file:Using coding, Default queue length, sequence initial value and current sequence maximum.For example, being 001 using encoding setting, sequence number initial value is 100000000, default queue length is 200000.Then according to default generating mode, for example, coding+(current sequence is applied Maximum+1) mode assemble formation sequence number 001100000001, sequentially generate 200000 sequence numbers, storage to JAVA should In global variable chained list;And recorded the position of last sequence number in the sequence number of generation relative in configuration file In the sequence number generation parameter answered, i.e., current sequence maximum is changed to 100200000.
, can be according to not incrementally again with application coded combination into sequence number after formation sequence value in the improvement Same scene needs to generate various types of sequence numbers, adapts to multiple use;The sequence number of generation is continuously regular, with unique Property, it is prevented effectively from repetition.
Further, first judge whether the length of global variable chained list meets before the shearing with synchronization mechanism is carried out in S3 Length needed for this shearing, if so, the shearing of mechanism is then synchronized, if it is not, then performing S1.
Specifically, before the shearing of mechanism is synchronized, first judging that global variable chained list length is less than required length (such as 100), if less than required length, S1 being introduced into before shearing and is increased newly in a collection of sequence number deposit global variable chained list, then The sequence number of requirement is sheared again.
In the improvement, the length of global variable chained list is first judged before shearing sequence number, can be prevented in real process The problem of needing the sequence number that is produced during long-term a large amount of shearing sequence number not enough, so that an automatic rounded system is formed, Can continuous continual offer sequence number.
Further, as shown in figure 1, this method also includes:S4, carries out what is got after the shearing with synchronization mechanism in S3 Default prefix is added before sequence number, combination obtains required sequence number.
Specifically, prefix can will be added to meet the demand under different application scene before the sequence number of acquisition, such as YYYYMMDD+ sequence numbers.
In the improvement, the bigger type for enriching sequence number, it is adaptable to more different application scenarios.
Embodiment 2
As shown in Fig. 2 a kind of lightweight system that distributed sequence number is generated based on JAVA chained lists, including with lower module:
Sequence number generation module, for generating parameter according to the sequence number in default configuration file with default generation side Formula generation setting quantity sequence number, and by the sequence number of the setting quantity of generation be stored in distributed deployment JAVA apply In global variable chained list;
Sequence number logging modle, for the position of last sequence number in the sequence number of the setting quantity of generation to be recorded Into configuration file in corresponding sequence number generation parameter;
Sequence number acquisition module, the quantity for the sequence number according to required acquisition is to the sequence number in global variable chained list The shearing with synchronization mechanism is carried out, the sequence number of requirement is obtained.
The present invention is by the global currently available sequence numbers of storage of linked list of JAVA, in JAVA application software to distributed deployment When, independent of other software and application, it is that the generation of unique sequence numbers under distributed deployment can be achieved by easy configuration, only needs Take the hardware and underlying resource of lightweight.The position of formation sequence number is recorded after formation sequence number, it is ensured that sequence number The continuity of generation and repetition is prevented effectively from, and realizes that sequence number provides uniqueness by JAVA synchronization mechanism.
Further, the sequence number generation parameter in configuration file includes:It is initial using coding, default queue length, sequence Value and current sequence maximum;Current sequence maximum is used for last in the sequence number for the setting quantity that record has been generated The position of sequence number, sequence number generation module first formation sequence when, by current sequence maximum be initialized as with the beginning of sequence The equal value of initial value.
Specifically, the parameter included in configuration file has:Using coding, default queue length, sequence initial value and current Sequence maximum.First during formation sequence, current sequence maximum is initialized as initial with sequence by sequence number generation module The position of last sequence number is the value equal with sequence initial value in the equal value of value, i.e., the current sequence number generated. For example sequence initial value can be set to 100000000, then first formation sequence when, last in the sequence number currently generated The position of individual sequence number is 100000000, subsequently generates sequence number on the basis of this position.
In the improvement, configuration file can set many kinds of parameters, can meet various types of sequence by configuring Number requirement.
Further, default generating mode is in sequence number generation module:Current sequence in configuration file is maximum It is worth incrementally formation sequence value, application is encoded into the sequence that the quantity for generating the setting of default queue length is assembled with sequential value Number.
Specifically, in formation sequence first, sequence number generation module first reads the sequence number generation in configuration file Parameter:Using coding, default queue length, sequence initial value and current sequence maximum.For example, be 001 using encoding setting, Sequence number initial value is 100000000, and default queue length is 200000.Then according to default generating mode, for example using The mode of coding+(current sequence maximum+1) assembles formation sequence number 001100000001, sequentially generates 200000 sequences Number, store in the global variable chained list applied to JAVA;And sequence number logging modle is by last sequence in the sequence number of generation The position of row number recorded in sequence number generation parameter corresponding in configuration file, i.e., be changed to current sequence maximum 100200000。
, can be according to not incrementally again with application coded combination into sequence number after formation sequence value in the improvement Same scene needs to generate various types of sequence numbers, adapts to multiple use;The sequence number of generation is continuously regular, with unique Property, it is prevented effectively from repetition.
Further, sequence number acquisition module is additionally operable to before the shearing with synchronization mechanism is carried out, and first judges global variable chain Whether the length of table meets the length needed for this shearing, if so, the shearing of mechanism is then synchronized, if it is not, then calling sequence The sequence number of number generation module generation setting quantity.
Specifically, before the shearing of mechanism is synchronized, first judging that global variable chained list length is less than required length (such as 100), if less than required length, first calling sequence generation module increases a collection of sequence number deposit overall situation newly and become before shearing Measure in chained list, the sequence number of requirement is then sheared again.
In the improvement, the length of global variable chained list is first judged before shearing sequence number, can be prevented in real process The problem of needing the sequence number that is produced during long-term a large amount of shearing sequence number not enough, so that an automatic rounded system is formed, Can continuous continual offer sequence number.
Further, as shown in Fig. 2 the system also includes:
Sequence number composite module, for the sequence in sequence number acquisition module get after the shearing with synchronization mechanism Default prefix is added before number, combination obtains required sequence number.
Specifically, prefix can will be added to meet the demand under different application scene before the sequence number of acquisition, such as YYYYMMDD+ sequence numbers.
In the improvement, the bigger type for enriching sequence number, it is adaptable to more different application scenarios.
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and Within principle, any modifications, equivalent substitutions and improvements made etc. should be included in the scope of the protection.

Claims (10)

1. a kind of light weight method that distributed sequence number is generated based on JAVA chained lists, it is characterised in that comprise the following steps:
S1, the sequence that parameter generates setting quantity with default generating mode is generated according to the sequence number in default configuration file Number, and the sequence number of the setting quantity of generation is stored in the global variable chained list of the JAVA of distributed deployment applications;
S2, the position of last sequence number in the sequence number of the setting quantity of generation recorded relative in the configuration file In the sequence number generation parameter answered;
S3, is carried out with synchronization mechanism according to the quantity of the sequence number of required acquisition to the sequence number in the global variable chained list Shearing, obtains the sequence number of requirement.
2. the light weight method of distributed sequence number is generated based on JAVA chained lists according to claim 1, it is characterised in that institute Stating the generation of the sequence number in configuration file parameter includes:Using coding, default queue length, sequence initial value and current sequence most Big value;The current sequence maximum is used for the position of last sequence number in the sequence number for the setting quantity that record has been generated Put, in the S1 during sequence number of the quantity of generation setting first, current sequence maximum is initialized as and sequence initial value phase Deng value.
3. the light weight method of distributed sequence number is generated based on JAVA chained lists according to claim 2, it is characterised in that institute Stating the process for generating the sequence number for setting quantity described in S1 with default generating mode includes:According in the configuration file Current sequence maximum incrementally formation sequence value, will be using coding and the sequential value assembling generation default queue length The sequence number of the quantity of setting.
4. the light weight method of distributed sequence number is generated based on JAVA chained lists according to claim 3, it is characterised in that institute State in S3 it is described progress the shearing with synchronization mechanism before, first judge whether the length of the global variable chained list meets this and cut Required length is cut, if so, the shearing of mechanism is then synchronized, if it is not, then performing S1.
5. generating the light weight method of distributed sequence number based on JAVA chained lists according to any one of Claims 1-4, it is special Levy and be, methods described also includes:
S4, carries out adding default prefix before the sequence number that gets after the shearing with synchronization mechanism in the S3, combines To required sequence number.
6. a kind of lightweight system that distributed sequence number is generated based on JAVA chained lists, it is characterised in that including with lower module:
Sequence number generation module, for being given birth to according to the sequence number generation parameter in default configuration file with default generating mode Into the sequence number of setting quantity, and the overall situation that the JAVA that the sequence number of the setting quantity of generation is stored in into distributed deployment is applied In variable chained list;
Sequence number logging modle, for the position of last sequence number in the sequence number of the setting quantity of generation to recorded into institute State in sequence number generation parameter corresponding in configuration file;
Sequence number acquisition module, the quantity for the sequence number according to required acquisition is to the sequence number in the global variable chained list The shearing with synchronization mechanism is carried out, the sequence number of requirement is obtained.
7. the lightweight system of distributed sequence number is generated based on JAVA chained lists according to claim 6, it is characterised in that institute Stating the generation of the sequence number in configuration file parameter includes:Using coding, default queue length, sequence initial value and current sequence most Big value;The current sequence maximum is used for the position of last sequence number in the sequence number for the setting quantity that record has been generated Put, the sequence number generation module first formation sequence when, current sequence maximum is initialized as and sequence initial value phase Deng value.
8. the lightweight system of distributed sequence number is generated based on JAVA chained lists according to claim 7, it is characterised in that institute Stating default generating mode described in sequence number generation module is:Current sequence maximum in the configuration file is to pass Increasing mode formation sequence value, application coding and sequential value is assembled the sequence for the quantity for generating the default queue length setting Number.
9. the lightweight system of distributed sequence number is generated based on JAVA chained lists according to claim 8, it is characterised in that institute State sequence number acquisition module to be additionally operable to before the shearing of the progress with synchronization mechanism, first judge the length of the global variable chained list Whether degree meets the length needed for this shearing, if so, the shearing of mechanism is then synchronized, if it is not, then calling the sequence number The sequence number of generation module generation setting quantity.
10. the lightweight system of distributed sequence number is generated based on JAVA chained lists according to any one of claim 6 to 9, its It is characterised by, the system also includes:
Sequence number composite module, for the sequence in the sequence number acquisition module get after the shearing with synchronization mechanism Default prefix is added before number, combination obtains required sequence number.
CN201710253435.0A 2017-04-18 2017-04-18 Lightweight method and system for generating distributed serial numbers based on JAVA chain table Active CN107045445B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710253435.0A CN107045445B (en) 2017-04-18 2017-04-18 Lightweight method and system for generating distributed serial numbers based on JAVA chain table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710253435.0A CN107045445B (en) 2017-04-18 2017-04-18 Lightweight method and system for generating distributed serial numbers based on JAVA chain table

Publications (2)

Publication Number Publication Date
CN107045445A true CN107045445A (en) 2017-08-15
CN107045445B CN107045445B (en) 2020-09-08

Family

ID=59545616

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710253435.0A Active CN107045445B (en) 2017-04-18 2017-04-18 Lightweight method and system for generating distributed serial numbers based on JAVA chain table

Country Status (1)

Country Link
CN (1) CN107045445B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515956A (en) * 2019-09-02 2019-11-29 中国工商银行股份有限公司 Sequence number acquisition methods, device, system, electronic equipment and storage medium
CN110688149A (en) * 2019-10-09 2020-01-14 深圳市共进电子股份有限公司 Intelligent number calculation method, device, equipment terminal and computer readable storage medium
CN111124635A (en) * 2019-12-06 2020-05-08 北京达佳互联信息技术有限公司 Task processing method and device, electronic equipment and storage medium
CN111949324A (en) * 2020-07-21 2020-11-17 北京思特奇信息技术股份有限公司 Distributed serial number generation method and device
CN114281872A (en) * 2022-03-07 2022-04-05 广联达科技股份有限公司 Method, device and equipment for generating distributed serial number and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101960775A (en) * 2008-03-04 2011-01-26 捷通国际有限公司 Be used to distribute the method and system of the sequence number that carries unique information and multidate information
CN102769667A (en) * 2012-06-29 2012-11-07 北京奇虎科技有限公司 Method, equipment and system for generating ID
CN105072160A (en) * 2015-07-17 2015-11-18 联动优势科技有限公司 Serial number generating method and device, and a server

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101960775A (en) * 2008-03-04 2011-01-26 捷通国际有限公司 Be used to distribute the method and system of the sequence number that carries unique information and multidate information
CN102769667A (en) * 2012-06-29 2012-11-07 北京奇虎科技有限公司 Method, equipment and system for generating ID
CN105072160A (en) * 2015-07-17 2015-11-18 联动优势科技有限公司 Serial number generating method and device, and a server

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110515956A (en) * 2019-09-02 2019-11-29 中国工商银行股份有限公司 Sequence number acquisition methods, device, system, electronic equipment and storage medium
CN110515956B (en) * 2019-09-02 2022-03-25 中国工商银行股份有限公司 Serial number obtaining method, device and system, electronic equipment and storage medium
CN110688149A (en) * 2019-10-09 2020-01-14 深圳市共进电子股份有限公司 Intelligent number calculation method, device, equipment terminal and computer readable storage medium
CN111124635A (en) * 2019-12-06 2020-05-08 北京达佳互联信息技术有限公司 Task processing method and device, electronic equipment and storage medium
CN111949324A (en) * 2020-07-21 2020-11-17 北京思特奇信息技术股份有限公司 Distributed serial number generation method and device
CN114281872A (en) * 2022-03-07 2022-04-05 广联达科技股份有限公司 Method, device and equipment for generating distributed serial number and readable storage medium
CN114281872B (en) * 2022-03-07 2022-05-24 广联达科技股份有限公司 Method, device and equipment for generating distributed serial number and readable storage medium

Also Published As

Publication number Publication date
CN107045445B (en) 2020-09-08

Similar Documents

Publication Publication Date Title
CN107045445A (en) A kind of light weight method and system that distributed sequence number is generated based on JAVA chained lists
US11126595B2 (en) Network coded storage with multi-resolution codes
CN106126722B (en) A kind of prefix compound tree and design method based on verifying
CN101031907B (en) Index processing
CN111581214B (en) Parallel merkle tree construction and verification method applicable to energy block chain
US20200394181A1 (en) Big data blockchains with merkle trees
CN103188521A (en) Method and device for transcoding distribution, method and device for transcoding
CN108536729B (en) Cross-partition mirror image file synchronization method and device
CN104731956A (en) Method and system for synchronizing data and related database
CN105516542B (en) Multi-channel video synchronization system and its synchronous method based on hardware coder
CN104750855B (en) A kind of big data storage optimization method and device
CN109491835A (en) A kind of data fault tolerance method based on Dynamic Packet code
CN104348793A (en) Storage server system and storage method for data information
CN111443998B (en) Multi-layer segment type consensus method and system applied to block chain
CN105303365A (en) Office schedule planning method based on intelligent terminals
Lee et al. Implementation of MapReduce-based image conversion module in cloud computing environment
CN112445776B (en) Presto-based dynamic barrel dividing method, system, equipment and readable storage medium
CN105183582A (en) Data backup method and device
CN104836842B (en) A kind of method and device of synchronous ftp server file
CN102103607A (en) No-refresh picture bulk-uploading and automatic picture information acquisition technique
CN106791932A (en) Distributed trans-coding system, method and its device
CN103281395B (en) A kind of data slice based on client terminal quantity divides equally selective system and method
CN111597268B (en) Block chain extension method, block chain node and block chain system
CN102195928A (en) System for verifying data integrity of new media program
CN108536758B (en) Data table reconstruction method, device and system for database mode

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant