CN104486407A - Method and device for generating numbers - Google Patents

Method and device for generating numbers Download PDF

Info

Publication number
CN104486407A
CN104486407A CN201410773566.8A CN201410773566A CN104486407A CN 104486407 A CN104486407 A CN 104486407A CN 201410773566 A CN201410773566 A CN 201410773566A CN 104486407 A CN104486407 A CN 104486407A
Authority
CN
China
Prior art keywords
numbering
terminal
content
message queue
different
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
CN201410773566.8A
Other languages
Chinese (zh)
Other versions
CN104486407B (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

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

Abstract

The invention discloses a method and a device for generating numbers. The method comprises the following steps: receiving triggering signals which are used for triggering generation of ID numbers; generating N ID numbers with different contents according to the triggering signals, wherein N is the number of the predetermined and generated ID numbers; sending the N ID numbers to a terminal cluster according to a predetermined sending rule so as to enable a terminal for receiving the ID numbers in the terminal cluster to store the received ID numbers in self message queues of terminals, wherein the terminal cluster comprises at least two terminals. By virtue of the method and the device for generating numbers, the problem that the service for the generated ID numbers does not respond in time or the service is disrupted when the ID numbers have high-concurrency requests in the prior art can be solved.

Description

The generation method of numbering and device
Technical field
The present invention relates to computer realm, in particular to a kind of generation method and device of numbering.
Background technology
Along with the development of distributed system, increasing place needs to obtain unique number ID quickly and easily, such as, order number in form ordering system, the Transaction Identification Number in payment system.Connected by character string, complete serializing.
Current have a lot of method obtaining unique ID, such as: utilize certainly adding in database to obtain unique number ID, the program can ensure the global uniqueness of numbering ID, but because the database generating numbering ID is single-point, some time points can only have a numbering ID request to be responded, like this when height is concurrent just may there is response not in time in service, or the problem of service crashes (crash).Another more common scheme utilizes time-tagging as unique sign of numbering ID, although the program can deal with height and give to obtain response requirement, easily occurs the problem of the repetition of numbering ID.
For in prior art when there is high concurrent request to numbering ID, the service response causing generating numbering ID not in time or the problem of service crashes, not yet proposes effective solution at present.
Summary of the invention
Main purpose of the present invention is the generation method and the device that provide a kind of numbering, and to solve in prior art when there is high concurrent request to numbering ID, the service response causing generating numbering ID not in time or the problem of service crashes.
To achieve these goals, according to an aspect of the embodiment of the present invention, a kind of generation method of numbering is provided.The method comprises: receive for triggering the triggering signal generating numbering ID; According to triggering signal, generate the numbering ID that N number of content is different, wherein, N is the quantity of the generation numbering ID pre-set; According to predetermined transmission rule, numbering ID different for N number of content is sent in terminal cluster, to make the terminal receiving numbering ID in terminal cluster, the numbering ID received is stored in the message queue of this terminal self, wherein, terminal cluster comprises at least two terminals.
To achieve these goals, according to the another aspect of the embodiment of the present invention, provide a kind of generating apparatus of numbering, this device comprises: the first receiver module, for receiving for triggering the triggering signal generating numbering ID; Generation module, for according to triggering signal, generates the numbering ID that N number of content is different, and wherein, N is the quantity of the generation numbering ID pre-set; Distribution module, for numbering ID different for N number of content being sent in terminal cluster according to predetermined transmission rule, to make the terminal receiving numbering ID in terminal cluster be stored in the message queue of this terminal self by the numbering ID received, wherein, terminal cluster comprises at least two terminals.
According to inventive embodiments, by receiving for triggering the triggering signal generating numbering ID; According to triggering signal, generate the numbering ID that N number of content is different, wherein, N is the quantity of the generation numbering ID pre-set; According to predetermined transmission rule, numbering ID different for N number of content is sent in terminal cluster, to make the terminal receiving numbering ID in terminal cluster, the numbering ID received is stored in the message queue of this terminal self, wherein, terminal cluster comprises at least two terminals, solve prior art when there is high concurrent request to numbering ID, the service response causing generating numbering ID not in time or the problem of service crashes.Achieve the equally loaded when high concurrent request numbering ID, improve the effect that numbering ID distributes efficiency.
Accompanying drawing explanation
The accompanying drawing forming a application's part is used to provide a further understanding of the present invention, and schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart of the generation method of numbering according to the embodiment of the present invention one;
Fig. 2 is the flow chart of the generation method according to the preferred numbering of the embodiment of the present invention one;
Fig. 3 is the flow chart of the generation method according to the preferred numbering of the embodiment of the present invention one;
Fig. 4 is the generation system block diagram of the numbering according to the embodiment of the present invention one;
Fig. 5 is the structural representation of the generating apparatus of numbering according to the embodiment of the present invention two;
Fig. 6 is the structural representation of the generating apparatus according to the preferred numbering of the embodiment of the present invention two; And
Fig. 7 is the structural representation of the generating apparatus according to the preferred numbering of the embodiment of the present invention two.
Embodiment
It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.Below with reference to the accompanying drawings and describe the present invention in detail in conjunction with the embodiments.
The present invention program is understood better in order to make those skilled in the art person, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the embodiment of a part of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, should belong to the scope of protection of the invention.
It should be noted that, term " first ", " second " etc. in specification of the present invention and claims and above-mentioned accompanying drawing are for distinguishing similar object, and need not be used for describing specific order or precedence.Should be appreciated that the data used like this can be exchanged, in the appropriate case so that embodiments of the invention described herein.In addition, term " comprises " and " having " and their any distortion, intention is to cover not exclusive comprising, such as, contain those steps or unit that the process of series of steps or unit, method, system, product or equipment is not necessarily limited to clearly list, but can comprise clearly do not list or for intrinsic other step of these processes, method, product or equipment or unit.
Terminological interpretation:
Concurrent: in an operating system, refer in the time period have several program be all in startup optimization complete to operation between, and these programs are all run on same processor, but any one moment point only have a program run on treaters.
In relational database, allow multiple user to access simultaneously and change the process of shared data.SQL Server uses locking to allow multiple user to access and to change shared data and do not clash each other simultaneously.
The feature that operating system concurrent program performs:
Under concurrent environment, because the closure of program is broken, there is new feature:
1. program with calculate no longer one_to_one corresponding, a copies of programs can have multiple calculating;
2. have mutual restricting relation between concurrent program, directly restriction is presented as that a program needs the result of calculation of another program, and restriction is presented as that multiple program competes a certain resource, as processor, buffering area etc. indirectly;
3. concurrent program in commission loiters, interrupted propelling.
Numbering ID:
Identify label number.Also referred to as sequence number or account number, being coding relatively unique in certain individual system, is the equal of one " identity card ", in a certain concrete things, identify label number is generally constant, identifies this things as what, then determined by the self-ordained rule of designer.Generally speaking, this rule has certain subjectivity in design according to concrete environment for use, as: " employee's job number ", " ID card No. " " computer network address " etc.Mainly contain two kinds of compute modes for computer, logical operation and arithmetical operation, logical operation is just related to the ID function of numeral.Identify label number is very common in life, and such as you are by the model of product, and production etc. are attached to distinguish them in similar things respectively, and this also can be ID.
Message queue:
" message " is the data unit transmitted at two intercomputers.Message can be very simple, such as, only comprise text-string; Also can be more complicated, may embedded object be comprised.
Message is sent in queue." message queue " is the container preserving message in the transmitting procedure of message.Message queue manager is acted as an intermediary when message is relayed to its target from its source.The main purpose of queue is to provide route and ensures the transmission of message; If recipient is unavailable when sending message, message queue can reservation message, until can successfully pass-along message.
Load balancing:
Load balancing (Load Balancing) is based upon on existing network infrastructure, it provides the bandwidth of the effectively transparent method extended network equipment of a kind of cheapness and server, increase throughput, Strengthens network data-handling capacity, the flexibility improving network and availability.
Embodiment 1
Embodiments provide a kind of generation method of numbering.
Fig. 1 is the flow chart of the generation method of a kind of numbering according to the embodiment of the present invention.As shown in Figure 1, it is as follows that the method comprising the steps of:
Step S11, receives for triggering the triggering signal generating numbering ID.
Specifically, receive the outside triggering signal for triggering generation numbering ID sent by above-mentioned steps S11, wherein, generation numbering ID can be a special numbering ID generation server, also can be that a numbering ID in server generates service.Triggering signal can be generated by load-balanced server or load balancing service, and is sent in current number ID generation server.
Step S13, according to triggering signal, generates the numbering ID that N number of content is different, and wherein, N is the quantity of the generation numbering ID pre-set, and N is positive integer.
Concrete, by above-mentioned steps S13, according to triggering signal, generate the N number of numbering ID of quantity pre-set at every turn.The quantity N generating numbering ID artificially can be arranged according to numbering ID demand.When very large to numbering ID demand, can the numerical value of quantity N be arranged larger; When very little to numbering ID demand, the numerical value of quantity N can be turned down, better to save the calculation resources of server.
Step S15, according to predetermined transmission rule, numbering ID different for N number of content is sent in terminal cluster, to make the terminal receiving numbering ID in terminal cluster be stored in the message queue of this terminal self by the numbering ID received, wherein, terminal cluster comprises at least two terminals.
Concrete, by above-mentioned steps S15, numbering ID different for the N number of content generated is sent at least two terminals in terminal cluster.N number of for quantity numbering ID average mark can be sent in the middle of each terminal in terminal cluster by send mode; Also can judge according to numbering ID quantity remaining in each terminal in terminal cluster, the numbering ID of generation is preferentially sent to numbering ID quantity and be less than in the middle of the terminal of the amount threshold preset.
Receive numbering ID in terminal cluster after, numbering ID is stored in respective message queue by the terminal receiving numbering ID.
By above-mentioned steps S11 to step S15, by receiving the triggering signal for generating numbering ID, generating several numbering ID, and numbering ID being distributed in the middle of each terminal in terminal cluster.Like this, numbering ID is stored in the middle of different terminals, when height concurrent acquisition numbering ID, can will obtain the course allocation of numbering ID to the different terminals storing numbering ID, to reach the object of equally loaded, avoid service response delay or the collapse of numbering ID.Meanwhile, carry out, so the problem occurring that numbering ID repeats can be avoided because all numbering ID generate service by a numbering ID generation server or ID.
In summary, to the invention solves in prior art when there is high concurrent request to numbering ID, the service response causing generating numbering ID not in time or the problem of service crashes, achieves the equally loaded when high concurrent request numbering ID, the effect of raising numbering ID distribution efficiency.
Preferably, as shown in Figure 2, according to the above embodiments of the present application, before step S11 receives the triggering signal for triggering generation numbering ID, method also comprises:
Step S101, reads the quantity of not used numbering in the message queue of any one terminal, obtains the residue numbering quantitative value in the message queue of any one terminal.
Step S103, contrasts the residue numbering quantitative value in the message queue of any one terminal and the threshold value pre-set, and determining whether needs to generate triggering signal,
When residue numbering quantitative value in the message queue of this any one terminal is more than or equal to the threshold value pre-set, do not generate triggering signal;
When residue numbering quantitative value in the message queue of this any one terminal is less than the threshold value pre-set, generate triggering signal.
Concrete, by above-mentioned steps S101 and step S103, the numbering ID volume residual in the message queue of terminal in terminal cluster is read, and judge whether numbering ID volume residual is less than the threshold value pre-set.When numbering ID volume residual is less than threshold value, determine the lazy weight of the residue numbering ID in terminal, need to supplement, namely send triggering signal to numbering ID generation server.In the middle of practical application, to the setting of threshold value, can arrange according to numbering ID quantity required.
Preferably, according to the above embodiments of the present application, in step 13 according to triggering signal, after generating the different numbering ID of N number of content, method also comprises:
Step S140, is loaded into ID with additional method by numbering ID different for N number of content and generates record sheet.
Concrete, by step S140, the numbering ID at every turn generated is recorded in ID with additional method and generates in the middle of record sheet, be used for carrying out record to the numbering ID generated.
Preferably, according to the above embodiments of the present application, in step S13 according to triggering signal, generate in the different numbering ID of N number of content, step comprises:
Step S131, reads ID and generates at least one history numbering ID preserved in record sheet.
Step S133, reads the quantity N of the generation numbering ID pre-set.
Step S135, generates the content of the last item history numbering ID preserved in record sheet based on ID, order generates the different numbering ID of N number of content.
Concrete, by above-mentioned steps S131 to step S135, the history numbering ID record that ID generates in record sheet is inquired about, generates based on the last item history numbering ID in record sheet by ID, generate the N number of numbering ID newly unduplicated with history numbering ID of quantity.
In actual applications, the new different numbering ID of continuous print can be generated by sequential method order, also based on date-time, order can generate new different numbering ID, can also randomized be passed through, and through duplicate removal process, generate random new different numbering ID.Certainly, according to actual conditions, also there is the generation method of other numbering ID, can be applicable to, in the middle of method that the present embodiment provides, specifically not repeat.
Preferably, according to the above embodiments of the present application, with additional method, numbering ID different for N number of content is loaded into ID in step S140 and generates after record sheet, method also comprises:
Step S141, generates ID in any one or more terminals that record sheet is synchronized in new terminal cluster.
Concrete, by above-mentioned steps S141, ID can be generated in the middle of each terminal that record sheet is synchronized in terminal cluster, for generating the backup of record sheet to ID, to strengthen the reliability of system.
Preferably, as shown in Figure 3, according to the above embodiments of the present application, be sent in terminal cluster according to predetermined transmission rule by numbering ID different for N number of content in step S15, wherein, after terminal cluster comprises at least two terminals, method also comprises:
Step S17, receives the numbering solicited message of outside numbering requesting terminal.
Step S19, meets in numbering solicited message directive sending to terminal cluster in the terminal of load balancing condition.
Concrete, by above-mentioned steps S17 and step S19, the numbering request of numbering requesting terminal, outside is distributed, by numbering solicited message directive sending to the terminal storing message queue in terminal cluster.The request load of each terminal room balanced, proof load is balanced.Wherein, sending the numbering requesting terminal, outside of numbering solicited message, can be use the client in the application system of numbering generation service.
In the middle of practical application, the method for directive sending numbering solicited message directly can be distributed numbering solicited message by average distribution system.Also can the method that judges of passing threshold, judging the load factor of each terminal in terminal cluster, by load factor and the threshold value comparison that pre-sets, only having when reaching load balancing condition, just understand to this terminal transmission numbering solicited message.
In the middle of practical application, as shown in Figure 4, in some different terminals, newly-built message queue is used for storing generated numbering ID.Front end can arrange load-balanced server, and when there being the request obtaining numbering ID, load-balanced server can be directed to request on the message queue on different terminals, obtains numbering ID and return from message queue.Also can be that in the generating apparatus of numbering load-balancing function being integrated in the embodiment of the present invention, those skilled in the art can need sets itself according to actual scene, do not repeat herein.
Backstage has a numbering ID generation service or numbering ID generation server generates numbering ID in order, and these numbering ID is distributed on the message queue in different terminals.This service also can record the current maximum numbering ID generated, and generates when starting for next time from after maximum numbering ID.This service also can monitor the numbering ID quantity in each message queue, if quantity is lower than some threshold values, this service will start inserts newly-generated numbering ID in message queue.
So both can respond numbering ID request fast when height is concurrent, and can dispose because of multiple spot again, prevent the generation of Single Point of Faliure.
The method provided in above-described embodiment, according to the situation of actual loading, in the middle of each station server terminal that can be deployed in distributed server cluster, also can be deployed in the middle of one or more server with the situation of backstage system service, embodiment does not limit herein.
Embodiment 2
The embodiment of the present invention additionally provides a kind of generating apparatus of numbering, and as shown in Figure 5, this device can comprise: the first receiver module 21, generation module 23 and distribution module 25.
Wherein, the first receiver module 21, for receiving for triggering the triggering signal generating numbering ID.
Concrete, receive the outside triggering signal for triggering generation numbering ID sent by above-mentioned first receiver module 21, wherein, generation numbering ID can be a special numbering ID generation server, also can be that a numbering ID in server generates service.Triggering signal can be generated by load-balanced server or load balancing service, and is sent in current number ID generation server.
Generation module 23, for according to triggering signal, generates the numbering ID that N number of content is different, and wherein, N is the quantity of the generation numbering ID pre-set, and N is positive integer.
Concrete, by above-mentioned generation module 23, according to triggering signal, generate the N number of numbering ID of quantity pre-set at every turn.The quantity N generating numbering ID artificially can be arranged according to numbering ID demand.When very large to numbering ID demand, can the numerical value of quantity N be arranged larger; When very little to numbering ID demand, the numerical value of quantity N can be turned down, better to save the calculation resources of server.
Distribution module 25, for numbering ID different for N number of content being sent in terminal cluster according to predetermined transmission rule, to make the terminal receiving described numbering ID in described terminal cluster, the described numbering ID received is stored in the message queue of this terminal self, wherein, terminal cluster comprises at least two terminals.
Concrete, by above-mentioned distribution module 25, numbering ID different for the N number of content generated is sent at least two terminals in terminal cluster.N number of for quantity numbering ID average mark can be sent in the middle of each terminal in terminal cluster by send mode; Also can judge according to numbering ID quantity remaining in each terminal in terminal cluster, the numbering ID of generation is preferentially sent to numbering ID quantity and be less than in the middle of the terminal of the amount threshold preset.
Concrete, in each terminal in terminal cluster, also comprise memory module 30.Wherein, the memory module 30 of each terminal in terminal cluster is for storing the message queue of the numbering ID received.
Above-mentioned first receiver module 21, generation module 23 and distribution module 25, by receiving the triggering signal for generating numbering ID, generating several numbering ID, and being distributed to by numbering ID in the middle of each terminal in terminal cluster.Like this, numbering ID is stored in the middle of different terminals, when height concurrent acquisition numbering ID, can will obtain the course allocation of numbering ID to the different terminals storing numbering ID, to reach the object of equally loaded, avoid service response delay or the collapse of numbering ID.Meanwhile, carry out, so the problem occurring that numbering ID repeats can be avoided because all numbering ID generate service by a numbering ID generation server or ID.
In summary, to the invention solves in prior art when there is high concurrent request to numbering ID, the service response causing generating numbering ID not in time or the problem of service crashes, achieves the equally loaded when high concurrent request numbering ID, the effect of raising numbering ID distribution efficiency.
Preferably, as shown in Figure 6, device also comprises: read module 201 and processing module 203.
Wherein, read module 201, for read any one terminal message queue in the quantity of not used numbering, obtain the residue numbering quantitative value in the message queue of any one terminal;
Processing module 203, for the residue numbering quantitative value in the message queue of any one terminal and the threshold value pre-set being contrasted, determines whether to need to generate triggering signal; When residue numbering quantitative value in the message queue of this any one terminal is more than or equal to the threshold value pre-set, do not generate triggering signal; When residue numbering quantitative value in the message queue of this any one terminal is less than the threshold value pre-set, generate triggering signal.
Concrete, by above-mentioned read module 201 and processing module 203, the numbering ID volume residual in the message queue of terminal in terminal cluster is read, and judge whether numbering ID volume residual is less than the threshold value pre-set.When numbering ID volume residual is less than threshold value, determine the lazy weight of the residue numbering ID in terminal, need to supplement.Namely triggering signal is sent to numbering ID generation server.In the middle of practical application, to the setting of threshold value, can arrange according to numbering ID quantity required.
Preferably, according to the above embodiments of the present application, device also comprises: logging modle 240.
Wherein, logging modle 240, generates record sheet for numbering ID different for N number of content being loaded into ID with additional method.
Concrete, by logging modle 240, the numbering ID at every turn generated is recorded in ID with additional method and generates in the middle of record sheet, be used for carrying out record to the numbering ID generated.
Preferably, according to the above embodiments of the present application, above-mentioned generation module 23 comprises: the first sub-read module 231, second sub-read module 233 and sub-generation module 235.
Wherein, the first sub-read module 231, generates for reading ID at least one history numbering ID preserved in record sheet.
Second sub-read module 233, for reading the quantity N of the generation numbering ID pre-set.
Sub-generation module 235, for generating the content of the last item history numbering ID preserved in record sheet based on ID, order generates the different numbering ID of N number of content.
Concrete, by above-mentioned first sub-read module 231, second sub-read module 233 and sub-generation module 235, the history numbering ID record that ID generates in record sheet is inquired about, generate based on the last item history numbering ID in record sheet by ID, generate the N number of numbering ID newly unduplicated with history numbering ID of quantity.
In actual applications, the new different numbering ID of continuous print can be generated by sequential method order, also based on date-time, order can generate new different numbering ID, can also randomized be passed through, and through duplicate removal process, generate random new different numbering ID.Certainly, according to actual conditions, also there is the generation method of other numbering ID, can be applicable to, in the middle of method that the present embodiment provides, specifically not repeat.
Preferably, according to the above embodiments of the present application, said apparatus also comprises: synchronization module 241.
Wherein, synchronization module 241, generates after record sheet for numbering ID different for described N number of content being loaded into ID in logging modle 240 with additional method, is generated by ID in any one or more terminals that record sheet is synchronized in terminal cluster.
Concrete, by above-mentioned synchronization module 241, ID can be generated in the middle of each terminal that record sheet is synchronized in terminal cluster, for generating the backup of record sheet to ID, to strengthen the reliability of system.
Preferably, as shown in Figure 7, according to the above embodiments of the present application, said apparatus also comprises: the second receiver module 27 and load balancing module 29.
Wherein, the second receiver module 27, for receiving the numbering solicited message of outside numbering requesting terminal.
Load balancing module 29, for the terminal by meeting load balancing condition in numbering solicited message directive sending to terminal cluster.
Concrete, by above-mentioned second receiver module 27 and load balancing module 29, the numbering request of numbering requesting terminal, outside is distributed, by numbering solicited message directive sending to the terminal storing message queue in terminal cluster.The request load of each terminal room balanced, proof load is balanced.
In the middle of practical application, the method for directive sending numbering solicited message directly can be distributed numbering solicited message by average distribution system.Also can the method that judges of passing threshold, judging the load factor of each terminal in terminal cluster, by load factor and the threshold value comparison that pre-sets, only having when reaching load balancing condition, just understand to this terminal transmission numbering solicited message.
In the middle of practical application, as shown in Figure 4, in some different terminals, newly-built message queue is used for storing generated numbering ID.Front end can arrange load-balanced server, and when there being the request obtaining numbering ID, load-balanced server can be directed to request on the message queue on different terminals, obtains numbering ID and return from message queue.Also can be that in the generating apparatus of numbering load-balancing function being integrated in the embodiment of the present invention, those skilled in the art can need sets itself according to actual scene, do not repeat herein.
Backstage has a numbering ID generation service or numbering ID generation server generates numbering ID in order, and these numbering ID is distributed on the message queue in different terminals.This service also can record the current maximum numbering ID generated, and generates when starting for next time from after maximum numbering ID.This service also can monitor the numbering ID quantity in each message queue, if quantity is lower than some threshold values, this service will start inserts newly-generated numbering ID in message queue.
So both can respond numbering ID request fast when height is concurrent, and can dispose because of multiple spot again, prevent the generation of Single Point of Faliure.
It should be noted that, for aforesaid each embodiment of the method, in order to simple description, 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 by the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in specification all belongs to preferred embodiment, and involved action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part described in detail, can see the associated description of other embodiments.
In several embodiments that the application provides, should be understood that, disclosed device, the mode by other realizes.Such as, device embodiment described above is only schematic, the such as division of described unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or unit or communication connection can be electrical or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form of SFU software functional unit also can be adopted to realize.
If described integrated unit using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computer read/write memory medium.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words or all or part of of this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprises all or part of step of some instructions in order to make a computer equipment (can be personal computer, mobile terminal, server or the network equipment etc.) perform method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), portable hard drive, magnetic disc or CD etc. various can be program code stored medium.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (12)

1. a generation method for numbering, is characterized in that, comprising:
Receive for triggering the triggering signal generating numbering ID;
According to described triggering signal, generate the numbering ID that N number of content is different, wherein, described N is the quantity of the described numbering ID of generation pre-set;
According to predetermined transmission rule, numbering ID different for described N number of content is sent in terminal cluster, to make the terminal receiving described numbering ID in described terminal cluster, the described numbering ID received is stored in the message queue of this terminal self, wherein, described terminal cluster comprises at least two terminals.
2. method according to claim 1, is characterized in that, before receiving the triggering signal for triggering generation numbering ID, described method also comprises:
Read the quantity of not used numbering in the described message queue of terminal described in any one, obtain the residue numbering quantitative value in the message queue of any one terminal described;
Residue numbering quantitative value in the message queue of any one terminal described and the threshold value pre-set are contrasted, determines whether to need to generate described triggering signal;
During the threshold value pre-set described in the residue numbering quantitative value in the message queue of any one terminal described is more than or equal to, do not generate described triggering signal;
During the threshold value pre-set described in the residue numbering quantitative value in the message queue of any one terminal described is less than, generate described triggering signal.
3. method according to claim 1, is characterized in that, according to described triggering signal, after generating the different numbering ID of N number of content, described method also comprises:
With additional method, numbering ID different for described N number of content is loaded into ID and generates record sheet.
4. method according to claim 3, is characterized in that, the step of the numbering ID that the N number of content of described generation is different comprises:
Read described ID and generate at least one history numbering ID preserved in record sheet;
Read the described quantity N of the generation numbering ID pre-set;
Generate the content of the last item history numbering ID preserved in record sheet based on described ID, order generates the different numbering ID of described N number of content.
5. method according to claim 3, is characterized in that, with additional method, numbering ID different for described N number of content is loaded into ID generates after record sheet described, described method also comprises:
Described ID is generated record sheet be synchronized in any one or more terminals in described terminal cluster.
6. method as claimed in any of claims 1 to 5, it is characterized in that, according to predetermined transmission rule, numbering ID different for described N number of content is being sent in terminal cluster, wherein, after described terminal cluster comprises at least two terminals, described method also comprises:
Receive the numbering solicited message of outside numbering requesting terminal;
Meet in described numbering solicited message directive sending to described terminal cluster in the terminal of load balancing condition.
7. a generating apparatus for numbering, is characterized in that, comprising:
First receiver module, for receiving for triggering the triggering signal generating numbering ID;
Generation module, for according to described triggering signal, generates the numbering ID that N number of content is different, and wherein, described N is the quantity of the described numbering ID of generation pre-set;
Distribution module, for numbering ID different for described N number of content being sent in terminal cluster according to predetermined transmission rule, to make the terminal receiving described numbering ID in described terminal cluster, the described numbering ID received is stored in the message queue of this terminal self, wherein, described terminal cluster comprises at least two terminals.
8. device according to claim 7, is characterized in that, described device also comprises:
Read module, for read terminal described in any one described message queue in the quantity of not used numbering, obtain the residue numbering quantitative value in the message queue of any one terminal described;
Processing module, for the residue numbering quantitative value in the message queue of any one terminal described and the threshold value pre-set being contrasted, determines whether to need to generate described triggering signal; During the threshold value pre-set described in the residue numbering quantitative value in the message queue of any one terminal described is more than or equal to, do not generate described triggering signal; During the threshold value pre-set described in the residue numbering quantitative value in the message queue of any one terminal described is less than, generate described triggering signal.
9. device according to claim 7, is characterized in that, described device also comprises:
Logging modle, generates record sheet for numbering ID different for described N number of content being loaded into ID with additional method.
10. device according to claim 9, is characterized in that, described generation module comprises:
First sub-read module, generates for reading described ID at least one history numbering ID preserved in record sheet;
Second sub-read module, for reading the described quantity N of the generation numbering ID pre-set;
Sub-generation module, for generating the content of the last item history numbering ID preserved in record sheet based on described ID, order generates the different numbering ID of described N number of content.
11. devices according to claim 9, is characterized in that, described device also comprises:
Synchronization module, generating after record sheet for numbering ID different for described N number of content being loaded into ID in described logging modle with additional method, described ID being generated record sheet and is synchronized in any one or more terminals in described terminal cluster.
12., according to the device in claim 7 to 11 described in any one, is characterized in that, described device also comprises:
Second receiver module, for receiving the numbering solicited message of outside numbering requesting terminal;
Load balancing module, for the terminal by meeting load balancing condition in described numbering solicited message directive sending to described terminal cluster.
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 true CN104486407A (en) 2015-04-01
CN104486407B 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)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677704A (en) * 2015-12-25 2016-06-15 北京奇虎科技有限公司 Information arrangement method and device, and information management method and device
CN106506663A (en) * 2016-11-22 2017-03-15 北京科摩仕捷科技有限公司 A kind of number distributing method, server and system
CN106911780A (en) * 2017-02-28 2017-06-30 北京三快在线科技有限公司 Traffic ID generation method, apparatus and system
CN107528816A (en) * 2016-06-22 2017-12-29 中兴通讯股份有限公司 ID processing method, management system and server in distributed data base
CN107786628A (en) * 2017-07-24 2018-03-09 上海壹账通金融科技有限公司 Business numbering distribution method, device, computer equipment and storage medium
CN108804451A (en) * 2017-04-28 2018-11-13 北京京东尚科信息技术有限公司 Generate method, apparatus, electronic equipment and the readable storage medium storing program for executing of major key
CN109104490A (en) * 2018-08-29 2018-12-28 北京达佳互联信息技术有限公司 Service identification management method, device, electronic equipment and storage medium
CN109376155A (en) * 2018-11-06 2019-02-22 泰康保险集团股份有限公司 ID generation method and device, storage medium and electronic equipment
CN109450987A (en) * 2018-10-18 2019-03-08 杭州云永网络科技有限公司 Number generation method, apparatus and system and storage medium
CN111741081A (en) * 2020-06-05 2020-10-02 安徽三实信息技术服务有限公司 Distributed server management system
CN113065034A (en) * 2021-03-29 2021-07-02 上海安畅网络科技股份有限公司 Distributed system number generation method and system

Citations (4)

* 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
US20090224029A1 (en) * 2005-06-08 2009-09-10 Johannes Georg Schade Numbering process for securities, method for processing the numbered securites and numbering device to carry out the numbering process
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

Patent Citations (4)

* 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
US20090224029A1 (en) * 2005-06-08 2009-09-10 Johannes Georg Schade Numbering process for securities, method for processing the numbered securites and numbering device to carry out the numbering process
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

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677704A (en) * 2015-12-25 2016-06-15 北京奇虎科技有限公司 Information arrangement method and device, and information management method and device
CN107528816A (en) * 2016-06-22 2017-12-29 中兴通讯股份有限公司 ID processing method, management system and server in distributed data base
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
CN106506663A (en) * 2016-11-22 2017-03-15 北京科摩仕捷科技有限公司 A kind of number distributing method, server and system
CN106911780A (en) * 2017-02-28 2017-06-30 北京三快在线科技有限公司 Traffic ID generation method, apparatus and system
CN108804451A (en) * 2017-04-28 2018-11-13 北京京东尚科信息技术有限公司 Generate method, apparatus, electronic equipment and the readable storage medium storing program for executing of major key
CN107786628A (en) * 2017-07-24 2018-03-09 上海壹账通金融科技有限公司 Business numbering distribution method, device, computer equipment and storage medium
WO2019019676A1 (en) * 2017-07-24 2019-01-31 深圳壹账通智能科技有限公司 Service number assigning method and device, computer apparatus, and 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
CN109450987A (en) * 2018-10-18 2019-03-08 杭州云永网络科技有限公司 Number generation method, apparatus and system and storage medium
CN109450987B (en) * 2018-10-18 2021-08-03 杭州云永网络科技有限公司 Number generation method, device and system and storage medium
CN109376155A (en) * 2018-11-06 2019-02-22 泰康保险集团股份有限公司 ID generation method and device, storage medium and electronic equipment
CN111741081A (en) * 2020-06-05 2020-10-02 安徽三实信息技术服务有限公司 Distributed server management system
CN113065034A (en) * 2021-03-29 2021-07-02 上海安畅网络科技股份有限公司 Distributed system number generation method and system

Also Published As

Publication number Publication date
CN104486407B (en) 2017-12-19

Similar Documents

Publication Publication Date Title
CN104486407A (en) Method and device for generating numbers
US20200364608A1 (en) Communicating in a federated learning environment
CN111818112B (en) Kafka system-based message sending method and device
US20180181911A1 (en) Data object allocation method and apparatus and electronic device
CN110716796B (en) Intelligent task scheduling method and device, storage medium and electronic equipment
CN113900598B (en) Data storage method, device, equipment and storage medium based on block chain
US11971880B2 (en) Techniques for in-memory data searching
EP3516539A1 (en) Techniques for in-memory key range searches
CN111880967A (en) File backup method, device, medium and electronic equipment in cloud scene
CN104935612A (en) Data processing method and server
CN111935227A (en) Method for uploading file through browser, browser and electronic equipment
CN105302907A (en) Request processing method and device
US8903871B2 (en) Dynamic management of log persistence
CN104468330A (en) Data processing method and device of distributed information queue
CN104125294A (en) Method and system for big data safety management
US20150365474A1 (en) Computer-readable recording medium, task assignment method, and task assignment apparatus
CN114640707A (en) Message asynchronous processing method and device, electronic equipment and storage medium
CN108920278B (en) Resource allocation method and device
CN114785805A (en) Data transmission method and device, electronic equipment and storage medium
CN112052330B (en) Application keyword distribution method and device
CN113704251A (en) Method and device for layout of home page of distributed storage database all-in-one machine
CN111125187A (en) Data management method and device based on block chain
CN114860390B (en) Container data management method, device, program product, medium and electronic equipment
US11687542B2 (en) Techniques for in-memory data searching
CN110213314B (en) Method, device and server for determining storage node

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

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