CN104486407B - The generation method and device of numbering - Google Patents

The generation method and device of numbering Download PDF

Info

Publication number
CN104486407B
CN104486407B CN201410773566.8A CN201410773566A CN104486407B CN 104486407 B CN104486407 B CN 104486407B CN 201410773566 A CN201410773566 A CN 201410773566A CN 104486407 B CN104486407 B CN 104486407B
Authority
CN
China
Prior art keywords
numbering
terminal
generation
content
trigger signal
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
CN201410773566.8A
Other languages
Chinese (zh)
Other versions
CN104486407A (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 Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum 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 Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201410773566.8A priority Critical patent/CN104486407B/en
Publication of CN104486407A publication Critical patent/CN104486407A/en
Application granted granted Critical
Publication of CN104486407B publication Critical patent/CN104486407B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a kind of generation method of numbering and device.Wherein, this method includes:Receive the trigger signal for triggering generation numbering ID;According to trigger signal, the different numbering ID of N number of content is generated, wherein, N is the generation numbering ID pre-set quantity;The different numbering ID of N number of content is sent into terminal cluster according to predetermined transmission rule, so that the terminal that numbering ID is received in terminal cluster stores the numbering ID received into the message queue of the terminal itself, wherein, terminal cluster includes at least two terminals.The present invention solves the service response for when there is the request of high concurrent to numbering ID, causing to generate numbering ID in the prior art not in time or the problem of service crashes.

Description

The generation method and device of numbering
Technical field
The present invention relates to computer realm, in particular to the generation method and device of a kind of numbering.
Background technology
With the development of distributed system, increasing place needs quickly and easily to obtain unique number ID, such as Order number in form ordering system, the Transaction Identification Number in payment system.Connected by character string, complete serializing.
Currently there is the method for much obtaining unique ID, such as:Using adding certainly to obtain unique number ID in database, The program can ensure numbering ID global uniqueness, but because the database for generating numbering ID is single-point, some when Between point can only there is numbering ID to ask to be responded, like this in the case of high concurrent service may occur responding it is too late When, or the problem of service crashes (crash).Another relatively common scheme is used as numbering ID by the use of time-tagging Unique sign, although the program, which can be dealt with, must respond requirement under high concurrent, easily there is the problem of numbering ID repetition.
For when there is the request of high concurrent to numbering ID, causing generation numbering ID service response in the prior art not The problem of timely or service crashes, effective solution is not yet proposed at present.
The content of the invention
It is a primary object of the present invention to provide the generation method and device of a kind of numbering, to solve in the prior art right When the request of high concurrent occurs in numbering ID, cause to generate numbering ID service response not in time or the problem of service crashes.
To achieve these goals, a kind of one side according to embodiments of the present invention, there is provided generation method of numbering. This method includes:Receive the trigger signal for triggering generation numbering ID;According to trigger signal, the different volume of N number of content is generated Number ID, wherein, N is the generation numbering ID pre-set quantity;It is regular by the different numbering of N number of content according to predetermined transmission ID is sent into terminal cluster, so that the terminal that numbering ID is received in terminal cluster stores the numbering ID received to the end In the message queue for holding itself, wherein, terminal cluster includes at least two terminals.
To achieve these goals, another aspect according to embodiments of the present invention, there is provided a kind of generating means of numbering, The device includes:First receiving module, for receiving the trigger signal for being used for triggering generation numbering ID;Generation module, for root According to trigger signal, the different numbering ID of N number of content is generated, wherein, N is the generation numbering ID pre-set quantity;Distribute mould Block, for sending the different numbering ID of N number of content into terminal cluster according to predetermined transmission rule, so that in terminal cluster The terminal for receiving numbering ID stores the numbering ID received into the message queue of the terminal itself, wherein, terminal cluster Including at least two terminals.
According to inventive embodiments, by receiving the trigger signal for being used for triggering generation numbering ID;According to trigger signal, generation The different numbering ID of N number of content, wherein, N is the generation numbering ID pre-set quantity;According to predetermined transmission rule by N The different numbering ID of individual content is sent into terminal cluster, so that numbering ID terminal is received in terminal cluster to be received Numbering ID is stored into the message queue of the terminal itself, wherein, terminal cluster includes at least two terminals, solves existing skill Art causes to generate numbering ID service response not in time or service crashes is asked when there is the request of high concurrent to numbering ID Topic.The equally loaded when high concurrent asks numbering ID is realized, improves the effect of numbering ID distribution efficiency.
Brief description of the drawings
The accompanying drawing for forming the part of the application is used for providing a further understanding of the present invention, schematic reality of the invention Apply example and its illustrate to be used to explain the present invention, do not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart of the generation method of according to embodiments of the present invention one numbering;
Fig. 2 is the flow chart of according to embodiments of the present invention one generation method preferably numbered;
Fig. 3 is the flow chart of according to embodiments of the present invention one generation method preferably numbered;
Fig. 4 is the generation system block diagram of according to embodiments of the present invention one numbering;
Fig. 5 is the structural representation of the generating means of according to embodiments of the present invention two numbering;
Fig. 6 is the structural representation of according to embodiments of the present invention two generating means preferably numbered;And
Fig. 7 is the structural representation of according to embodiments of the present invention two generating means preferably numbered.
Embodiment
It should be noted that in the case where not conflicting, the feature in embodiment and embodiment in the application can phase Mutually combination.Describe the present invention in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention Accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people The every other embodiment that member is obtained under the premise of creative work is not made, it should all belong to the model that the present invention protects Enclose.
It should be noted that term " first " in description and claims of this specification and above-mentioned accompanying drawing, " Two " etc. be for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that so use Data can exchange in the appropriate case, so as to embodiments of the invention described herein.In addition, term " comprising " and " tool Have " and their any deformation, it is intended that cover it is non-exclusive include, for example, containing series of steps or unit Process, method, system, product or equipment are not necessarily limited to those steps clearly listed or unit, but may include without clear It is listing to Chu or for the intrinsic other steps of these processes, method, product or equipment or unit.
Term is explained:
Concurrently:In an operating system, refer to have in a period several programs to run all in having been turned on running to Between finishing, and these programs are run on same processor, but only have a program locating in any one moment point Run on reason machine.
In relational database simultaneously, it is allowed to which multiple users access and the process of change shared data.SQL Server make With locking with allow multiple users and meanwhile access and change shared data and do not clash each other.
The characteristics of operating system concurrent program performs:
Under concurrent environment, because the closure of program is broken, there is the characteristics of new:
1. program no longer corresponds with calculating, a copies of programs can have multiple calculating;
2. there is mutual restricting relation between concurrent program, directly restrict and be presented as that a program needs the meter of another program Result is calculated, restricts indirectly and is presented as that multiple programs compete a certain resource, such as processor, buffering area;
3. concurrent program loiters in commission, discontinuously promote.
Numbering ID:
Identity number.Also referred to as sequence number or account number, it is relatively unique coding in some system, is the equal of one Kind " identity card ", in a certain specific things, identity number is usually constant, and the things is identified as what, Then determined by the self-ordained rule of designer.In general, this rule has in design according to specific use environment Certain subjectivity, such as:" employee's job number ", " ID card No. " " computer network address " etc..Mainly there are two kinds of fortune for computer Calculation mode, logical operation and arithmetical operation, logical operation are just related to the ID functions of numeral.Identity number is in life It is very common, for example you are by the model of product, production grade be attached to respectively in similar things with differentiation they, this can also It is ID.
Message queue:
" message " is the data unit in two intercomputer transmission.Message can be very simple, such as only includes text Character string;Can also be more complicated, embedded object may be included.
Message is sent in queue." message queue " is the container that message is preserved in the transmitting procedure of message.Message Queue management device is acted as an intermediary when message is relayed into its target from its source.The main purpose of queue is to provide route And ensure the transmission of message;If recipient is unavailable when sending message, message queue can reservation message, until can be successfully Transmit message.
Load balancing:
Load balancing (Load Balancing) is established on existing network infrastructure, and it provides a kind of cheap effectively saturating Bright method extended network equipment and the bandwidth of server, increase handling capacity, Strengthens network data-handling capacity, improve network Flexibility and availability.
Embodiment 1
The embodiments of the invention provide a kind of generation method of numbering.
Fig. 1 is a kind of flow chart of the generation method of numbering according to embodiments of the present invention.As shown in figure 1, this method bag It is as follows to include step:
Step S11, receive the trigger signal for triggering generation numbering ID.
Specifically, the outside trigger signal for being used to trigger generation numbering ID sent is received by above-mentioned steps S11, its In, generation numbering ID can be the numbering ID lifes in special a numbering ID generation servers or server Into service.Trigger signal can be generated by load-balanced server or load balancing service, and be sent to current number ID Generate in server.
Step S13, according to trigger signal, the different numbering ID of N number of content is generated, wherein, N is that the generation pre-set is compiled Number ID quantity, N is positive integer.
Specifically, by above-mentioned steps S13, according to trigger signal, the N number of numbering ID of quantity pre-set is generated every time. Generation numbering ID quantity N can artificially be set according to numbering ID demands., can when very big to numbering ID demands It is larger so that quantity N numerical value to be set;When to numbering ID demand very littles, quantity N numerical value can be turned down, with more preferable Saving server calculation resources.
Step S15, the different numbering ID of N number of content is sent into terminal cluster according to predetermined transmission rule, so that The terminal that numbering ID is received in terminal cluster stores the numbering ID received into the message queue of the terminal itself, its In, terminal cluster includes at least two terminals.
Specifically, by above-mentioned steps S15, the different numbering ID of N number of content of generation is sent into terminal cluster In at least two terminals.Sending method can be by among each terminal that the N number of numbering ID of quantity is averagely distributed in terminal cluster; It can also judge according to remaining numbering ID quantity in each terminal in terminal cluster, the numbering ID of generation is preferential Send to numbering ID quantity and be less than among the terminal of amount threshold set in advance.
After numbering ID is received in terminal cluster, numbering ID is stored in respective message by the terminal for receiving numbering ID In queue.
By above-mentioned steps S11 to step S15, by receiving the trigger signal for being used for generating numbering ID, several are generated Numbering ID, and numbering ID is distributed among each terminal in terminal cluster.So, numbering ID is stored in different terminals and worked as In, can be by acquisition numbering ID course allocation to the different terminals for being stored with numbering ID when high concurrent obtains numbering ID It is central, to reach the purpose of equally loaded, avoid numbering ID service response delay or collapse.Meanwhile because all volumes Number ID is to generate server by a numbering ID or ID generation services are carried out, it is possible to avoids the occurrence of numbering ID and repeats The problem of.
In summary, the present invention is solved in the prior art when the request of high concurrent occur to numbering ID, causes to generate Numbering ID service response realizes the equally loaded when high concurrent asks numbering ID not in time or the problem of service crashes, Improve the effect of numbering ID distribution efficiency.
Preferably, as shown in Fig. 2 according to the above embodiments of the present application, received in step S11 for triggering generation numbering Before ID trigger signal, method also includes:
Step S101, the quantity for the numbering being had not been used in the message queue of any one terminal is read, obtained any Remaining numbering quantitative value in the message queue of one terminal.
Step S103, the remaining numbering quantitative value in the message queue of any one terminal is entered with the threshold value pre-set Row contrast, it is determined whether need to generate trigger signal,
When the remaining numbering quantitative value in the message queue of any one terminal is more than or equal to the threshold value pre-set, Do not generate trigger signal;
When the remaining numbering quantitative value in the message queue of any one terminal is less than the threshold value pre-set, generation Trigger signal.
Specifically, by above-mentioned steps S101 and step S103, to the numbering in the message queue of terminal in terminal cluster Whether ID volume residuals are read out, and judge numbering ID volume residuals less than the threshold value pre-set.When numbering ID remainders When amount is less than threshold value, the lazy weight of the remaining numbering ID in terminal is determined, it is necessary to supplement, i.e., to numbering ID generation server hairs Send trigger signal.Among practical application, the setting to threshold value, it can be configured according to numbering ID quantity requireds.
Preferably, according to the above embodiments of the present application, in step 13 according to trigger signal, the different volume of N number of content is generated After number ID, method also includes:
Step S140, the different numbering ID of N number of content is loaded into by ID generation record sheets with additional method.
Specifically, by step S140, the numbering ID generated every time is recorded among ID generation record sheets with additional method, For being recorded to the numbering ID generated.
Preferably, according to the above embodiments of the present application, in step S13 according to trigger signal, the different volume of N number of content is generated In number ID, step includes:
Step S131, read at least one history numbering ID saved in ID generation record sheets.
Step S133, read the generation numbering ID pre-set quantity N.
Step S135, the last item history numbering ID saved in record sheet content is generated based on ID, and order is raw The numbering ID different into N number of content.
Specifically, by above-mentioned steps S131 to step S135, the ID history numbering ID generated in record sheet are recorded into Row inquiry, based on the last item history numbering ID in ID generation record sheets, generation quantity is N number of not to be weighed with history numbering ID Multiple new numbering ID.
In actual applications, continuous new different numbering ID can be sequentially generated by sequential method, can also be with day New different numbering ID are sequentially generated based on time phase, can also be handled by randomized, and by duplicate removal, generation is random New different numbering ID.Certainly, according to actual conditions, also there is other numberings ID generation method, may be suitable for this Among the method that embodiment provides, do not repeat specifically.
Preferably, according to the above embodiments of the present application, the different numbering ID of N number of content is carried with additional method in step S140 After entering ID generation record sheets, method also includes:
Step S141, ID generation record sheets are synchronized in any one or more terminals in new terminal cluster.
Specifically, by above-mentioned steps S141, ID can be generated to each terminal that record sheet is synchronized in terminal cluster It is central, for generating the backup of record sheet to ID, with the reliability of strengthening system.
Preferably, as shown in figure 3, according to the above embodiments of the present application, in step S15 according to predetermined transmission rule by N The different numbering ID of individual content is sent into terminal cluster, wherein, after terminal cluster includes at least two terminals, method is also wrapped Include:
Step S17, receive the numbering solicited message of outside numbering requesting terminal.
Step S19, numbering solicited message directive sending is met into terminal cluster in the terminal of load balancing condition.
Specifically, by above-mentioned steps S17 and step S19, the numbering request to outside numbering requesting terminal is allocated, By numbering solicited message directive sending to the terminal that message queue is stored with terminal cluster.The request of balanced each terminal room is born Carry, proof load is balanced.Wherein, the outside numbering requesting terminal of numbering solicited message is sent, can be using numbering generation clothes Client in the application system of business.
Among practical application, the method for directive sending numbering solicited message can be by average distribution system directly to numbering Solicited message is allocated.The load factor of each terminal in terminal cluster by the method for threshold decision, can also be judged, led to Cross and load factor is compared with the threshold value pre-set, only when reaching load balancing condition, can just send and number to the terminal Solicited message.
Among practical application, as shown in figure 4, newly-built message queue is generated for storing in some different terminals Numbering ID.Front end can set load-balanced server, and when there is the request for obtaining numbering ID, load-balanced server can be Request is directed on the message queue on different terminals, and numbering ID is obtained from message queue and is returned.Can also load Equalization function is integrated in the generating means of the numbering of the embodiment of the present invention, and those skilled in the art can be according to actual scene need Sets itself is wanted, is not repeated herein.
Backstage has a numbering ID generations service or numbering ID generation servers to be sequentially generated numbering ID, and this A little numbering ID are distributed on the message queue in different terminals.The service can also record the current maximum numbering ID generated, When starting for next time after the maximum numbering ID generate.The service can also monitor the numbering ID numbers in each message queue Amount, if quantity is less than some threshold value, newly-generated numbering ID is inserted in the service in will starting toward message queue.
Numbering ID requests so both can have quickly been responded in the case of high concurrent, can dispose, prevent because of multiple spot again The generation of Single Point of Faliure.
Method provided in above-described embodiment, according to the situation of actual loading, distributed server collection can be deployed in Among each server terminal of group, it can also be deployed in the situation of backstage system service among one or more server, Embodiment is not limited herein.
Embodiment 2
The embodiment of the present invention additionally provides a kind of generating means of numbering, as shown in figure 5, the device can include:First Receiving module 21, generation module 23 and distribution module 25.
Wherein, the first receiving module 21, for receiving the trigger signal for being used for triggering generation numbering ID.
Specifically, the triggering for being used to trigger generation numbering ID that outside transmission is received by above-mentioned first receiving module 21 is believed Number, wherein, generation numbering ID can be a numbering in special a numbering ID generation servers or server ID generation services.Trigger signal can be generated by load-balanced server or load balancing service, and sent to current and compiled In number ID generation server.
Generation module 23, for according to trigger signal, generating the different numbering ID of N number of content, wherein, N is pre-sets Generation numbering ID quantity, N is positive integer.
Specifically, by above-mentioned generation module 23, according to trigger signal, the N number of numbering of quantity pre-set is generated every time ID.Generation numbering ID quantity N can artificially be set according to numbering ID demands.When very big to numbering ID demands When, quantity N numerical value can be set larger;When to numbering ID demand very littles, quantity N numerical value can be turned down, Preferably to save the calculation resources of server.
Distribution module 25, for sending the different numbering ID of N number of content to terminal cluster according to predetermined transmission rule In, so that the terminal that the numbering ID is received in the terminal cluster stores the numbering ID received to the terminal certainly In the message queue of body, wherein, terminal cluster includes at least two terminals.
Specifically, by above-mentioned distribution module 25, the different numbering ID of N number of content of generation is sent into terminal cluster At least two terminals in.Each terminal that the N number of numbering ID of quantity can be averagely distributed in terminal cluster by sending method is worked as In;It can also judge according to remaining numbering ID quantity in each terminal in terminal cluster, by the numbering ID of generation Preferential send to numbering ID quantity is less than among the terminal of amount threshold set in advance.
Specifically, in each terminal in terminal cluster, in addition to memory module 30.Wherein, it is each in terminal cluster The memory module 30 of individual terminal is used for the message queue for storing the numbering ID received.
Above-mentioned first receiving module 21, generation module 23 and distribution module 25, it is used to generate touching for numbering ID by receiving Signal, generate several numberings ID, and numbering ID is distributed among each terminal in terminal cluster.So, numbering ID It is stored among different terminals, can be by acquisition numbering ID course allocation to different when high concurrent obtains numbering ID It is stored among numbering ID terminal, to reach the purpose of equally loaded, avoids numbering ID service response delay or collapse Burst.Meanwhile because all numbering ID are to generate server or ID generation service progress by a numbering ID, it is possible to Avoid the occurrence of the problem of numbering ID is repeated.
In summary, the present invention is solved in the prior art when the request of high concurrent occur to numbering ID, causes to generate Numbering ID service response realizes the equally loaded when high concurrent asks numbering ID not in time or the problem of service crashes, Improve the effect of numbering ID distribution efficiency.
Preferably, as shown in fig. 6, device also includes:Read module 201 and processing module 203.
Wherein, read module 201, the number for the numbering having not been used in the message queue for reading any one terminal Amount, obtain the remaining numbering quantitative value in the message queue of any one terminal;
Processing module 203, for the remaining numbering quantitative value in the message queue by any one terminal with pre-setting Threshold value contrasted, it is determined whether need generate trigger signal;When the residue in the message queue of any one terminal is compiled When number value is more than or equal to the threshold value pre-set, trigger signal is not generated;When in the message queue of any one terminal Remaining numbering quantitative value when being less than the threshold value pre-set, generation trigger signal.
Specifically, by above-mentioned read module 201 and processing module 203, in the message queue of terminal in terminal cluster Numbering ID volume residuals be read out, and judge numbering ID volume residuals whether less than the threshold value that pre-sets.As numbering ID When volume residual is less than threshold value, determine the lazy weight of remaining numbering ID in terminal, it is necessary to supplement.Generate and take to numbering ID Business device sends trigger signal.Among practical application, the setting to threshold value, it can be configured according to numbering ID quantity requireds.
Preferably, also included according to the above embodiments of the present application, device:Logging modle 240.
Wherein, logging modle 240, for the different numbering ID of N number of content to be loaded into ID generation record sheets with additional method.
Specifically, by logging modle 240, the numbering ID generated every time is recorded in ID generation record sheets with additional method and worked as In, for being recorded to the numbering ID generated.
Preferably, included according to the above embodiments of the present application, above-mentioned generation module 23:First sub- read module 231, second Sub- read module 233 and sub- generation module 235.
Wherein, the first sub- read module 231, at least one history for reading saved in ID generation record sheets are compiled Number ID.
Second sub- read module 233, for reading the generation numbering ID pre-set quantity N.
Sub- generation module 235, for being generated based on ID in the last item history numbering ID saved in record sheet Hold, be sequentially generated the different numbering ID of N number of content.
Specifically, by the above-mentioned first sub- read module 231, the second sub- read module 233 and sub- generation module 235, it is right ID generation record sheet in history numbering ID record is inquired about, using ID generation record sheet in the last item history numbering ID as Basis, generation quantity are N number of with the unduplicated new numbering ID of history numbering ID.
In actual applications, continuous new different numbering ID can be sequentially generated by sequential method, can also be with day New different numbering ID are sequentially generated based on time phase, can also be handled by randomized, and by duplicate removal, generation is random New different numbering ID.Certainly, according to actual conditions, also there is other numberings ID generation method, may be suitable for this Among the method that embodiment provides, do not repeat specifically.
Preferably, also included according to the above embodiments of the present application, said apparatus:Synchronization module 241.
Wherein, synchronization module 241, for being carried the different numbering ID of N number of content with additional method in logging modle 240 After entering ID generation record sheets, ID generation record sheets are synchronized in any one or more terminals in terminal cluster.
Specifically, by above-mentioned synchronization module 241, ID can be generated to each end that record sheet is synchronized in terminal cluster Among end, for generating the backup of record sheet to ID, with the reliability of strengthening system.
Preferably, as shown in fig. 7, according to the above embodiments of the present application, said apparatus also includes:The He of second receiving module 27 Load balancing module 29.
Wherein, the second receiving module 27, for receiving the numbering solicited message of outside numbering requesting terminal.
Load balancing module 29, for numbering solicited message directive sending to be met into load balancing condition into terminal cluster Terminal on.
Specifically, by above-mentioned second receiving module 27 and load balancing module 29, to the volume of outside numbering requesting terminal Number request is allocated, by numbering solicited message directive sending to the terminal that message queue is stored with terminal cluster.It is balanced each The request load of individual terminal room, proof load are balanced.
Among practical application, the method for directive sending numbering solicited message can be by average distribution system directly to numbering Solicited message is allocated.The load factor of each terminal in terminal cluster by the method for threshold decision, can also be judged, led to Cross and load factor is compared with the threshold value pre-set, only when reaching load balancing condition, can just send and number to the terminal Solicited message.
Among practical application, as shown in figure 4, newly-built message queue is generated for storing in some different terminals Numbering ID.Front end can set load-balanced server, and when there is the request for obtaining numbering ID, load-balanced server can be Request is directed on the message queue on different terminals, and numbering ID is obtained from message queue and is returned.Can also load Equalization function is integrated in the generating means of the numbering of the embodiment of the present invention, and those skilled in the art can be according to actual scene need Sets itself is wanted, is not repeated herein.
Backstage has a numbering ID generations service or numbering ID generation servers to be sequentially generated numbering ID, and this A little numbering ID are distributed on the message queue in different terminals.The service can also record the current maximum numbering ID generated, When starting for next time after the maximum numbering ID generate.The service can also monitor the numbering ID numbers in each message queue Amount, if quantity is less than some threshold value, newly-generated numbering ID is inserted in the service in will starting toward message queue.
Numbering ID requests so both can have quickly been responded in the case of high concurrent, can dispose, prevent because of multiple spot again The generation of Single Point of Faliure.
It should be noted that for foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as a series of Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because According to the present invention, some steps can use other orders or carry out simultaneously.Secondly, those skilled in the art should also know Know, embodiment described in this description belongs to preferred embodiment, and involved action and module are not necessarily of the invention It is necessary.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed device, can be by another way Realize.For example, device embodiment described above is only schematical, such as the division of the unit, it is only one kind Division of logic function, can there is an other dividing mode when actually realizing, such as multiple units or component can combine or can To be integrated into another system, or some features can be ignored, or not perform.Another, shown or discussed is mutual Coupling direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING or communication connection of device or unit, Can be electrical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is used as independent production marketing or use When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially The part to be contributed in other words to prior art or all or part of the technical scheme can be in the form of software products Embody, the computer software product is stored in a storage medium, including some instructions are causing a computer Equipment (can be personal computer, mobile terminal, server or network equipment etc.) performs side described in each embodiment of the present invention The all or part of step of method.And foregoing storage medium includes:USB flash disk, read-only storage (ROM, Read-Only Memory), Random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various to be stored The medium of program code.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies Change, equivalent substitution, improvement etc., should be included in the scope of the protection.

Claims (12)

  1. A kind of 1. generation method of numbering, it is characterised in that including:
    Receive the trigger signal for triggering generation numbering ID;
    According to the trigger signal, the different numbering ID of N number of content is generated, wherein, the N is the generation pre-set the volume Number ID quantity;
    The different numbering ID of N number of content is sent into terminal cluster according to predetermined transmission rule, so that the terminal The terminal that the numbering ID is received in cluster stores the numbering ID received into the message queue of the terminal itself, Wherein, the terminal cluster includes at least two terminals,
    Wherein, generating the different numbering ID of N number of content includes:The history numbering ID records generated to ID in record sheet are looked into Ask, based on the last item history numbering ID for generating in record sheet by ID, generation quantity is N number of unduplicated with history numbering ID New numbering ID.
  2. 2. according to the method for claim 1, it is characterised in that receiving the trigger signal for triggering generation numbering ID Before, methods described also includes:
    The quantity for the numbering being had not been used in the message queue of any one of terminal is read, is obtained described any one Remaining numbering quantitative value in the message queue of individual terminal;
    Remaining numbering quantitative value in the message queue of any one terminal is contrasted with the threshold value pre-set, really It is fixed whether to need to generate the trigger signal;
    When the remaining numbering quantitative value in the message queue of any one terminal is more than or equal to the threshold value pre-set When, the trigger signal is not generated;
    It is raw when the threshold value that the remaining numbering quantitative value in the message queue of any one terminal is pre-set less than described in Into the trigger signal.
  3. 3. according to the method for claim 1, it is characterised in that according to the trigger signal, it is different to generate N number of content After numbering ID, methods described also includes:
    The different numbering ID of N number of content is loaded into by ID generation record sheets with additional method.
  4. 4. according to the method for claim 3, it is characterised in that wrap the step of the N number of content of the generation different numbering ID Include:
    Read at least one history numbering ID saved in the ID generations record sheet;
    Read the generation numbering ID pre-set the quantity N;
    The last item history numbering ID saved in record sheet content is generated based on the ID, is sequentially generated described N number of The different numbering ID of content.
  5. 5. according to the method for claim 3, it is characterised in that it is described with additional method by the different volume of N number of content Number ID is loaded into after ID generation record sheets, and methods described also includes:
    ID generation record sheets are synchronized in any one or more terminals in the terminal cluster.
  6. 6. method as claimed in any of claims 1 to 5, it is characterised in that incited somebody to action according to predetermined transmission rule The different numbering ID of N number of content is sent into terminal cluster, wherein, the terminal cluster include at least two terminals it Afterwards, methods described also includes:
    Receive the numbering solicited message of outside numbering requesting terminal;
    The numbering solicited message directive sending is met in the terminal of load balancing condition into the terminal cluster.
  7. A kind of 7. generating means of numbering, it is characterised in that including:
    First receiving module, for receiving the trigger signal for being used for triggering generation numbering ID;
    Generation module, for according to the trigger signal, generating the different numbering ID of N number of content, wherein, the N is sets in advance The generation numbering ID put quantity;
    Distribution module, for the different numbering ID of N number of content to be sent into terminal cluster according to predetermined transmission rule, So that the terminal that the numbering ID is received in the terminal cluster stores the numbering ID received to the terminal itself Message queue in, wherein, the terminal cluster includes at least two terminals,
    Wherein, generating the different numbering ID of N number of content includes:The history numbering ID records generated to ID in record sheet are looked into Ask, based on the last item history numbering ID for generating in record sheet by ID, generation quantity is N number of unduplicated with history numbering ID New numbering ID.
  8. 8. device according to claim 7, it is characterised in that described device also includes:
    Read module, the quantity for the numbering having not been used in the message queue for reading any one of terminal, Obtain the remaining numbering quantitative value in the message queue of any one terminal;
    Processing module, for by the remaining numbering quantitative value in the message queue of any one terminal and the threshold that pre-sets Value is contrasted, it is determined whether needs to generate the trigger signal;Residue in the message queue of any one terminal During the threshold value that numbering quantitative value is pre-set more than or equal to described in, the trigger signal is not generated;When any one described terminal Message queue in remaining numbering quantitative value be less than described in pre-set threshold value when, generate the trigger signal.
  9. 9. device according to claim 7, it is characterised in that described device also includes:
    Logging modle, for the different numbering ID of N number of content to be loaded into ID generation record sheets with additional method.
  10. 10. device according to claim 9, it is characterised in that the generation module includes:
    First sub- read module, for reading at least one history numbering ID saved in the ID generations record sheet;
    Second sub- read module, for reading the generation numbering ID pre-set the quantity N;
    Sub- generation module, for generating the last item history numbering ID saved in record sheet content based on the ID, It is sequentially generated the different numbering ID of N number of content.
  11. 11. device according to claim 9, it is characterised in that described device also includes:
    Synchronization module, for the different numbering ID of N number of content to be loaded into ID generation notes with additional method in the logging modle After recording table, ID generation record sheets are synchronized in any one or more terminals in the terminal cluster.
  12. 12. the device according to any one in claim 7 to 11, it is characterised in that described device also includes:
    Second receiving module, for receiving the numbering solicited message of outside numbering requesting terminal;
    Load balancing module, for the numbering solicited message directive sending to be met into load balancing bar into the terminal cluster In the terminal of part.
CN201410773566.8A 2014-12-12 2014-12-12 The generation method and device of numbering Active CN104486407B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410773566.8A CN104486407B (en) 2014-12-12 2014-12-12 The generation method and device of numbering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410773566.8A CN104486407B (en) 2014-12-12 2014-12-12 The generation method and device of numbering

Publications (2)

Publication Number Publication Date
CN104486407A CN104486407A (en) 2015-04-01
CN104486407B true CN104486407B (en) 2017-12-19

Family

ID=52760911

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410773566.8A Active CN104486407B (en) 2014-12-12 2014-12-12 The generation method and device of numbering

Country Status (1)

Country Link
CN (1) CN104486407B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677704B (en) * 2015-12-25 2020-02-07 北京奇虎科技有限公司 Information arrangement method and apparatus, and information management method and apparatus
CN107528816B (en) * 2016-06-22 2021-05-18 中兴通讯股份有限公司 Processing method, management system and server of ID in distributed database
CN106506663B (en) * 2016-11-22 2019-04-02 北京科摩仕捷科技有限公司 A kind of number distributing method, server and system
CN106911780B (en) * 2017-02-28 2020-12-04 北京三快在线科技有限公司 Service ID generation method, device and system
CN108804451B (en) * 2017-04-28 2021-07-30 北京京东尚科信息技术有限公司 Method and device for generating primary key, electronic equipment and readable storage medium
CN107786628B (en) * 2017-07-24 2020-08-18 深圳壹账通智能科技有限公司 Service number distribution method and device, computer equipment and storage medium
CN109104490A (en) * 2018-08-29 2018-12-28 北京达佳互联信息技术有限公司 Service identification management method, device, electronic equipment and storage medium
CN109450987B (en) * 2018-10-18 2021-08-03 杭州云永网络科技有限公司 Number generation method, device and system and storage medium
CN109376155B (en) * 2018-11-06 2021-07-20 泰康保险集团股份有限公司 ID generation method and device, storage medium and electronic device
CN111741081A (en) * 2020-06-05 2020-10-02 安徽三实信息技术服务有限公司 Distributed server management system
CN113065034B (en) * 2021-03-29 2022-11-18 上海安畅网络科技股份有限公司 Distributed system number generation method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060064921A (en) * 2004-12-09 2006-06-14 엘지전자 주식회사 Order management system
CN101976240A (en) * 2010-09-21 2011-02-16 用友软件股份有限公司 Form number generating method and system
CN103218718A (en) * 2011-11-18 2013-07-24 苏州中茵泰格科技有限公司 Order number generating method and order number generating system based on multiple platforms

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1731324A1 (en) * 2005-06-08 2006-12-13 Kba-Giori S.A. Numbering process and device for securities and method for processing numbered securities

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060064921A (en) * 2004-12-09 2006-06-14 엘지전자 주식회사 Order management system
CN101976240A (en) * 2010-09-21 2011-02-16 用友软件股份有限公司 Form number generating method and system
CN103218718A (en) * 2011-11-18 2013-07-24 苏州中茵泰格科技有限公司 Order number generating method and order number generating system based on multiple platforms

Also Published As

Publication number Publication date
CN104486407A (en) 2015-04-01

Similar Documents

Publication Publication Date Title
CN104486407B (en) The generation method and device of numbering
CN107391629B (en) Method, system, server and computer storage medium for data migration between clusters
CN106095572B (en) distributed scheduling system and method for big data processing
CN102932472B (en) Data processing method and communication system
CN111988203B (en) Node election method, device and storage medium
CN106649637B (en) Method and system for processing red packet
CN106446168B (en) A kind of load client realization method of Based on Distributed data warehouse
CN110289999B (en) Data processing method, system and device
CN110058940B (en) Data processing method and device in multi-thread environment
CN105096174A (en) Transaction matching method and transaction matching system
WO2022048357A1 (en) Transaction endorsement method and apparatus, and storage medium
CN109254854A (en) Asynchronous invoking method, computer installation and storage medium
CN103838855A (en) Method for updating residual tickets
CN106874109A (en) A kind of distributed job distribution processing method and system
CN107864211A (en) Cluster resource dispatching method and system
CN108206839B (en) Data storage method, device and system based on majority
CN110727727A (en) Statistical method and device for database
CN108616581A (en) Data-storage system and method based on OLAP/OLTP mixing applications
CN109191135A (en) Transaction based on block chain retries method, apparatus, equipment and readable storage medium storing program for executing
CN106060130A (en) Verification method and system of merchandise inventory
CN107665453B (en) Virtual resource processing method and device and server
CN112286688A (en) Memory management and use method, device, equipment and medium
CN103428260A (en) System and method for allocating server to terminal and efficiently delivering messages to the terminal
CN108769227A (en) A kind of data trade SiteServer LBS
US10171570B2 (en) Information processing apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Method and device for generating numbers

Effective date of registration: 20190531

Granted publication date: 20171219

Pledgee: Shenzhen Black Horse World Investment Consulting Co.,Ltd.

Pledgor: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

Registration number: 2019990000503

PE01 Entry into force of the registration of the contract for pledge of patent right
CP02 Change in the address of a patent holder

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Patentee after: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

Address before: 100086 Beijing city Haidian District Shuangyushu Area No. 76 Zhichun Road cuigongfandian 8 layer A

Patentee before: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

PP01 Preservation of patent right

Effective date of registration: 20240604

Granted publication date: 20171219

PP01 Preservation of patent right